Pipelining
What is Pipelining?
A technique used in advanced microprocessors where
the microprocessor begins executing a second
instruction before the first has been completed.
A Pipeline is a series of stages, where some work is
done at each stage. The work is not finished until it has
passed through all stages.
How Pipelining Works?
The pipeline is divided into segments and each
segment can execute it operation concurrently with the
other segments. Once a segment completes an
operations, it passes the result to the next segment in
the pipeline and fetches the next operations from the
preceding segment.
Four Pipelined Instructions
IF
IF
IF
IF
ID
ID
ID
ID
EX
EX
EX
EX M
M
M
M
W
W
W
W
5
1
1
1
Instruction Fetch
The instruction Fetch (IF) stage is responsible for
obtaining the requested instruction from memory.
Instruction Decode
The Instruction Decode (ID) stage is responsible for
decoding the instruction and sending out the various
control lines to the other parts of the processor.
Execution
The Execution (EX) stage is where any calculations are
performed. The main component in this stage is the
ALU.
Memory and IO
The Memory and IO (MEM) stage is responsible for
storing and loading values to and from memory. It also
responsible for input or output from the processor.
Write Back
The Write Back (WB) stage is responsible for writing the
result of a calculation, memory access or input into the
register file.
Pipelining
Benefits and Impact
on Throughput
Benefits
The cycle time of the processor is reduced, thus
increasing instruction issue-rate in most cases
Some combinatorial circuits such as adders or
multiplier scan be made faster by adding more circuitry.
If pipelining is used instead, it can save circuitry vs. a
more complex combinatorial circuit.
 If pipelining is used, the CPU Arithmetic logic unit can
be designed faster, but more complex.
 Pipelining in theory increases performance over an un-
pipelined core by a factor of the number of stages (assuming
the clock frequency also increases by the same factor).
 Pipelined CPUs generally work at a higher clock frequency
than the RAM clock frequency, increasing computers overall
performance.
Impact on Throughput
One of the most important performance
measures of a system is its throughput rate
Defined as the number of outputs(sometimes the
number of instructions processed) per unit time.
 It directly reflects the processing power of a processor
system--the higher its throughput rate, the more
powerful the system is.
 Pipelining is one specific technique
to improve throughput, as is the use of faster modules.
When we use the pipelining the throughput of the
processor increases.
The reason of increase in throughput is that multiple
tasks are performed on the multiple instructions on the
same time.
Throughput is measured at the rate at which instruction
execution is completed.
Structural Hazards
Structural Hazards
Resource conflict when the hardware cannot support all
possible combination of instruction simultaneously.
Attempt to use the same hardware resource by two
different instructions during the same cycle is know as
Structural hazard.
Example:
Reasons?
Some functional unit is not fully pipelined. Then a
sequence of instructions using that un-pipelined unit
cannot proceed at the rate of one per clock cycle.
 Some resource has not been duplicated enough to
allow all combinations of instructions in the pipeline to
execute.
How to solve?
To solve the hazard, we stall the pipeline until the
resource is freed.
A stall is commonly called pipeline bubble, since it
floats through the pipeline taking space but carry no
useful work.
Another way of solving the hazard is to add more
hardware. (costly)
Problem Solved
Summary
Pipelining.
Benefits of pipelining.
Impact of pipelining on throughput.
Structural Hazards.

Pipelining , structural hazards

  • 1.
  • 2.
    What is Pipelining? Atechnique used in advanced microprocessors where the microprocessor begins executing a second instruction before the first has been completed. A Pipeline is a series of stages, where some work is done at each stage. The work is not finished until it has passed through all stages.
  • 3.
    How Pipelining Works? Thepipeline is divided into segments and each segment can execute it operation concurrently with the other segments. Once a segment completes an operations, it passes the result to the next segment in the pipeline and fetches the next operations from the preceding segment.
  • 4.
  • 5.
    Instruction Fetch The instructionFetch (IF) stage is responsible for obtaining the requested instruction from memory. Instruction Decode The Instruction Decode (ID) stage is responsible for decoding the instruction and sending out the various control lines to the other parts of the processor.
  • 6.
    Execution The Execution (EX)stage is where any calculations are performed. The main component in this stage is the ALU. Memory and IO The Memory and IO (MEM) stage is responsible for storing and loading values to and from memory. It also responsible for input or output from the processor.
  • 7.
    Write Back The WriteBack (WB) stage is responsible for writing the result of a calculation, memory access or input into the register file.
  • 8.
  • 9.
    Benefits The cycle timeof the processor is reduced, thus increasing instruction issue-rate in most cases Some combinatorial circuits such as adders or multiplier scan be made faster by adding more circuitry. If pipelining is used instead, it can save circuitry vs. a more complex combinatorial circuit.
  • 10.
     If pipeliningis used, the CPU Arithmetic logic unit can be designed faster, but more complex.  Pipelining in theory increases performance over an un- pipelined core by a factor of the number of stages (assuming the clock frequency also increases by the same factor).  Pipelined CPUs generally work at a higher clock frequency than the RAM clock frequency, increasing computers overall performance.
  • 11.
    Impact on Throughput Oneof the most important performance measures of a system is its throughput rate Defined as the number of outputs(sometimes the number of instructions processed) per unit time.  It directly reflects the processing power of a processor system--the higher its throughput rate, the more powerful the system is.  Pipelining is one specific technique to improve throughput, as is the use of faster modules.
  • 12.
    When we usethe pipelining the throughput of the processor increases. The reason of increase in throughput is that multiple tasks are performed on the multiple instructions on the same time. Throughput is measured at the rate at which instruction execution is completed.
  • 14.
  • 15.
    Structural Hazards Resource conflictwhen the hardware cannot support all possible combination of instruction simultaneously. Attempt to use the same hardware resource by two different instructions during the same cycle is know as Structural hazard.
  • 16.
  • 17.
    Reasons? Some functional unitis not fully pipelined. Then a sequence of instructions using that un-pipelined unit cannot proceed at the rate of one per clock cycle.  Some resource has not been duplicated enough to allow all combinations of instructions in the pipeline to execute.
  • 18.
    How to solve? Tosolve the hazard, we stall the pipeline until the resource is freed. A stall is commonly called pipeline bubble, since it floats through the pipeline taking space but carry no useful work. Another way of solving the hazard is to add more hardware. (costly)
  • 19.
  • 20.
    Summary Pipelining. Benefits of pipelining. Impactof pipelining on throughput. Structural Hazards.