Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is difference between Superscaling and pipelining?

Well looks too simple a question to be asked but i asked after going through few ppts on both.

Both methods increase instruction throughput. And Superscaling almost always makes use of pipelining as well. Superscaling has more than one execution unit and so does pipelining or am I wrong here?

like image 989
Alex Xander Avatar asked Nov 01 '09 07:11

Alex Xander


People also ask

What is the use of pipelining and superscalar operation?

A microprocessor uses pipelining or superscalar technology is said to have pipeline or superscalar design. Pipelining allows the processor to read a new instruction from memory before it is finished processing the current one.

What is the main difference between super pipelining and pipelining?

Pipelining Basically these ranks is given because of the reason that super scalar execute two instruction per clock cycle whereas super pipelining execute one and half instruction per clock cycle and pipelining execute one instruction per cycle.

What is superscalar pipeline design?

Superscalar architecture is a method of parallel computing used in many processors. In a superscalar computer, the central processing unit (CPU) manages multiple instruction pipelines to execute several instructions concurrently during a clock cycle.

What is a super pipeline?

The super-pipelining is based on dividing the stages of a pipeline into several substages, and thus, it increases the number of instructions which are handled by the pipeline at the same time [12]. For example, by dividing each stage into two substages, a pipeline can perform at twice the speed in the ideal situation.


2 Answers

Superscalar design involves the processor being able to issue multiple instructions in a single clock, with redundant facilities to execute an instruction. We're talking about within a single core, mind you -- multicore processing is different.

Pipelining divides an instruction into steps, and since each step is executed in a different part of the processor, multiple instructions can be in different "phases" each clock.

They're almost always used together. This image from Wikipedia shows both concepts in use, as these concepts are best explained graphically:

Superscalar/pipelining in use

Here, two instructions are being executed at a time in a five-stage pipeline.


To break it down further, given your recent edit:

In the example above, an instruction goes through 5 stages to be "performed". These are IF (instruction fetch), ID (instruction decode), EX (execute), MEM (update memory), WB (writeback to cache).

In a very simple processor design, every clock a different stage would be completed so we'd have:

  1. IF
  2. ID
  3. EX
  4. MEM
  5. WB

Which would do one instruction in five clocks. If we then add a redundant execution unit and introduce superscalar design, we'd have this, for two instructions A and B:

  1. IF(A) IF(B)
  2. ID(A) ID(B)
  3. EX(A) EX(B)
  4. MEM(A) MEM(B)
  5. WB(A) WB(B)

Two instructions in five clocks -- a theoretical maximum gain of 100%.

Pipelining allows the parts to be executed simultaneously, so we would end up with something like (for ten instructions A through J):

  1. IF(A) IF(B)
  2. ID(A) ID(B) IF(C) IF(D)
  3. EX(A) EX(B) ID(C) ID(D) IF(E) IF(F)
  4. MEM(A) MEM(B) EX(C) EX(D) ID(E) ID(F) IF(G) IF(H)
  5. WB(A) WB(B) MEM(C) MEM(D) EX(E) EX(F) ID(G) ID(H) IF(I) IF(J)
  6. WB(C) WB(D) MEM(E) MEM(F) EX(G) EX(H) ID(I) ID(J)
  7. WB(E) WB(F) MEM(G) MEM(H) EX(I) EX(J)
  8. WB(G) WB(H) MEM(I) MEM(J)
  9. WB(I) WB(J)

In nine clocks, we've executed ten instructions -- you can see where pipelining really moves things along. And that is an explanation of the example graphic, not how it's actually implemented in the field (that's black magic).

The Wikipedia articles for Superscalar and Instruction pipeline are pretty good.

like image 80
Jed Smith Avatar answered Oct 14 '22 05:10

Jed Smith


A long time ago, CPUs executed only one machine instruction at a time. Only when it was completely finished did the CPU fetch the next instruction from memory (or, later, the instruction cache).

Eventually, someone noticed that this meant that most of a CPU did nothing most of the time, since there were several execution subunits (such as the instruction decoder, the integer arithmetic unit, and FP arithmetic unit, etc.) and executing an instruction kept only one of them busy at a time.

Thus, "simple" pipelining was born: once one instruction was done decoding and went on towards the next execution subunit, why not already fetch and decode the next instruction? If you had 10 such "stages", then by having each stage process a different instruction you could theoretically increase the instruction throughput tenfold without increasing the CPU clock at all! Of course, this only works flawlessly when there are no conditional jumps in the code (this led to a lot of extra effort to handle conditional jumps specially).

Later, with Moore's law continuing to be correct for longer than expected, CPU makers found themselves with ever more transistors to make use of and thought "why have only one of each execution subunit?". Thus, superscalar CPUs with multiple execution subunits able to do the same thing in parallel were born, and CPU designs became much, much more complex to distribute instructions across these fully parallel units while ensuring the results were the same as if the instructions had been executed sequentially.

like image 41
Michael Borgwardt Avatar answered Oct 14 '22 05:10

Michael Borgwardt