PIPELININGPIPELINING
BY-BY-
RAHUL RAJRAHUL RAJ
11
PipeliningPipelining
Definition:Definition:
 A Pipeline is a series of stages, where some work isA Pipeline is a series of stages, where some work is
done at each stage. The work is not finished until itdone at each stage. The work is not finished until it
has passed through all stages.has passed through all stages.
 Each stage completes part of an instruction inEach stage completes part of an instruction in
parallel.parallel.
 The stages are connected one to the next to form aThe stages are connected one to the next to form a
pipe - instructions enter at one end, progresspipe - instructions enter at one end, progress
through the stages, and exit at the other end.through the stages, and exit at the other end.
22
ExampleExample
33
Pipelining AspectsPipelining Aspects
 The length of the longest step dictates theThe length of the longest step dictates the
length of the pipeline stages.length of the pipeline stages.
 So, the slowest resource affects the entireSo, the slowest resource affects the entire
process.process.
 Pipelining improves performance byPipelining improves performance by
increasing instruction throughput, as opposedincreasing instruction throughput, as opposed
to decreasing the execution time of anyto decreasing the execution time of any
individual instruction.individual instruction.
44
Pipelining BenefitsPipelining Benefits
 For the right instruction language, pipeliningFor the right instruction language, pipelining
increases performance linearly with the number ofincreases performance linearly with the number of
pipeline stages.pipeline stages.
• Languages are designed to be pipelined now.Languages are designed to be pipelined now.
 RISCRISC vsvs
CISC architectures.CISC architectures.
• Pipelining is easy to do with only a few additionsPipelining is easy to do with only a few additions
 Pipelining makes efficient use of resources.Pipelining makes efficient use of resources.
• Circuits consume similar amounts of powerCircuits consume similar amounts of power
whether performing calculations or just waiting.whether performing calculations or just waiting.
55
Pipelining DownsidesPipelining Downsides
 Pipelining requires additional hardwarePipelining requires additional hardware
• Every instruction must be able to be performed in each ofEvery instruction must be able to be performed in each of
the stagesthe stages
 i.e., some instruction require the ALU in more than onei.e., some instruction require the ALU in more than one
step.step.
• Registers to hold data between cyclesRegisters to hold data between cycles
• More ALU’s are required.More ALU’s are required.
 For example, 1 ALU is needed just to increase theFor example, 1 ALU is needed just to increase the
program counter.program counter.
• Branch prediction and collision avoidance units areBranch prediction and collision avoidance units are
required.required.
 Often times, you will have to clear the pipeline when you’veOften times, you will have to clear the pipeline when you’ve
written code that causes a hazard.written code that causes a hazard.
66
Type of PipeliningType of Pipelining
 Software PipeliningSoftware Pipelining
1) Can Handle Complex Instructions1) Can Handle Complex Instructions
2) Allows programs to be reused2) Allows programs to be reused
 Hardware PipeliningHardware Pipelining
1) Help designer manage complexity – a1) Help designer manage complexity – a
complex task can be divided into smaller,complex task can be divided into smaller,
more manageable pieces.more manageable pieces.
2) Hardware pipelining offers higher2) Hardware pipelining offers higher
performanceperformance
77
Type of Hardware PipelinesType of Hardware Pipelines
 Instruction Pipeline -Instruction Pipeline - AnAn instruction pipelineinstruction pipeline is veryis very
similar to a manufacturing assembly line.similar to a manufacturing assembly line.
1st stage receives some parts, performs its assembly task,1st stage receives some parts, performs its assembly task,
and passes the results to the second stage;and passes the results to the second stage;
2nd stage takes the partially assembled product from the2nd stage takes the partially assembled product from the
first stage, performs its task, and passes its work to thefirst stage, performs its task, and passes its work to the
third stage;third stage;
3rd stage does its work, passing the results to the last3rd stage does its work, passing the results to the last
stage, which completes the task and outputs its results.stage, which completes the task and outputs its results.
 Data Pipeline – Data pipeline is designed to pass dataData Pipeline – Data pipeline is designed to pass data
from stage to stage.from stage to stage.
88
99
THANK YOU
ANY QUERIES???
99
THANK YOU
ANY QUERIES???

Pipelining

  • 1.
  • 2.
    PipeliningPipelining Definition:Definition:  A Pipelineis a series of stages, where some work isA Pipeline is a series of stages, where some work is done at each stage. The work is not finished until itdone at each stage. The work is not finished until it has passed through all stages.has passed through all stages.  Each stage completes part of an instruction inEach stage completes part of an instruction in parallel.parallel.  The stages are connected one to the next to form aThe stages are connected one to the next to form a pipe - instructions enter at one end, progresspipe - instructions enter at one end, progress through the stages, and exit at the other end.through the stages, and exit at the other end. 22
  • 3.
  • 4.
    Pipelining AspectsPipelining Aspects The length of the longest step dictates theThe length of the longest step dictates the length of the pipeline stages.length of the pipeline stages.  So, the slowest resource affects the entireSo, the slowest resource affects the entire process.process.  Pipelining improves performance byPipelining improves performance by increasing instruction throughput, as opposedincreasing instruction throughput, as opposed to decreasing the execution time of anyto decreasing the execution time of any individual instruction.individual instruction. 44
  • 5.
    Pipelining BenefitsPipelining Benefits For the right instruction language, pipeliningFor the right instruction language, pipelining increases performance linearly with the number ofincreases performance linearly with the number of pipeline stages.pipeline stages. • Languages are designed to be pipelined now.Languages are designed to be pipelined now.  RISCRISC vsvs CISC architectures.CISC architectures. • Pipelining is easy to do with only a few additionsPipelining is easy to do with only a few additions  Pipelining makes efficient use of resources.Pipelining makes efficient use of resources. • Circuits consume similar amounts of powerCircuits consume similar amounts of power whether performing calculations or just waiting.whether performing calculations or just waiting. 55
  • 6.
    Pipelining DownsidesPipelining Downsides Pipelining requires additional hardwarePipelining requires additional hardware • Every instruction must be able to be performed in each ofEvery instruction must be able to be performed in each of the stagesthe stages  i.e., some instruction require the ALU in more than onei.e., some instruction require the ALU in more than one step.step. • Registers to hold data between cyclesRegisters to hold data between cycles • More ALU’s are required.More ALU’s are required.  For example, 1 ALU is needed just to increase theFor example, 1 ALU is needed just to increase the program counter.program counter. • Branch prediction and collision avoidance units areBranch prediction and collision avoidance units are required.required.  Often times, you will have to clear the pipeline when you’veOften times, you will have to clear the pipeline when you’ve written code that causes a hazard.written code that causes a hazard. 66
  • 7.
    Type of PipeliningTypeof Pipelining  Software PipeliningSoftware Pipelining 1) Can Handle Complex Instructions1) Can Handle Complex Instructions 2) Allows programs to be reused2) Allows programs to be reused  Hardware PipeliningHardware Pipelining 1) Help designer manage complexity – a1) Help designer manage complexity – a complex task can be divided into smaller,complex task can be divided into smaller, more manageable pieces.more manageable pieces. 2) Hardware pipelining offers higher2) Hardware pipelining offers higher performanceperformance 77
  • 8.
    Type of HardwarePipelinesType of Hardware Pipelines  Instruction Pipeline -Instruction Pipeline - AnAn instruction pipelineinstruction pipeline is veryis very similar to a manufacturing assembly line.similar to a manufacturing assembly line. 1st stage receives some parts, performs its assembly task,1st stage receives some parts, performs its assembly task, and passes the results to the second stage;and passes the results to the second stage; 2nd stage takes the partially assembled product from the2nd stage takes the partially assembled product from the first stage, performs its task, and passes its work to thefirst stage, performs its task, and passes its work to the third stage;third stage; 3rd stage does its work, passing the results to the last3rd stage does its work, passing the results to the last stage, which completes the task and outputs its results.stage, which completes the task and outputs its results.  Data Pipeline – Data pipeline is designed to pass dataData Pipeline – Data pipeline is designed to pass data from stage to stage.from stage to stage. 88
  • 9.
  • 10.