25-07-2014, 10:04 AM
Pipelining
Pipelining.ppt (Size: 270 KB / Downloads: 756)
Overview
Pipelining is widely used in modern processors.
Pipelining improves system performance in terms of throughput.
Pipelined organization requires sophisticated compilation techniques.
Making the Execution of Programs Faster
Use faster circuit technology to build the processor and the main memory.
Arrange the hardware so that more than one operation can be performed at the same time.
In the latter way, the number of operations performed per second is increased even though the elapsed time needed to perform any one operation is not changed.
Role of Cache Memory
Each pipeline stage is expected to complete in one clock cycle.
The clock period should be long enough to let the slowest pipeline stage to complete.
Faster stages can only wait for the slowest one to complete.
Since main memory is very slow compared to the execution, if each instruction needs to be fetched from main memory, pipeline is almost useless.
Fortunately, we have cache.
Pipeline Performance
The potential increase in performance resulting from pipelining is proportional to the number of pipeline stages.
However, this increase would be achieved only if all pipeline stages require the same time to complete, and there is no interruption throughout program execution.
Unfortunately, this is not true.
Quiz
Four instructions, the I2 takes two clock cycles for execution. Pls draw the figure for 4-stage pipeline, and figure out the total cycles needed for the four instructions to complete.
Operand Forwarding
Instead of from the register file, the second instruction can get data directly from the output of ALU after the previous instruction is completed.
A special arrangement needs to be made to “forward” the output of ALU to the input of ALU.
Conditional Braches
A conditional branch instruction introduces the added hazard caused by the dependency of the branch condition on the result of a preceding instruction.
The decision to branch cannot be made until the execution of that instruction has been completed.
Branch instructions represent about 20% of the dynamic instruction count of most programs.