Professional Documents
Culture Documents
Powerpoint Templates
Page 1
Instruction hazards
Instruction fetch units fetch instructions and supply the execution units with a steady stream of instructions. If the stream is interrupted then the pipeline stalls. Stream of instructions may be interrupted because of a cache miss or a branch instruction.
Powerpoint Templates
Page 2
Powerpoint Templates
Page 3
I3
F3
Ik
Fk
Ek
Ik+1
Fk+1
Ek+1
Pipeline stalls for one clock cycle. Time lost as a result of a branch instruction is called as branch penalty. Branch penalty is one clock cycle. Powerpoint Templates
Page 4
Powerpoint Templates
Page 5
Dk+1 E k+1
Powerpoint Templates
Page 6
Fetch unit fetches instructions before they are needed & stores them in a queue
E : Execute instruction
W : Write results
Dispatch unit takes instructions from the front of the queue and dispatches them to the Execution unit. Dispatch unit also decodes the instruction.
Powerpoint Templates
Page 7
Powerpoint Templates
Page 8
Initial length of the queue is 1. Fetch adds 1 to the queue, dispatch reduces the length by 1. Queue length remains the same for first 4 clock cycles. I1 stalls the pipeline for 2 cycles. Queue has space, so the fetch unit continues and queue length rises to 3 in clock cycle 6.
D k+1 E k+1
I2, I3, I4 and Ik are executed in successive clock cycles. Fetch unit computes the branch address concurrently with the execution of other Powerpoint branch folding. instructions. This is called as Templates Page 9 9
Powerpoint Templates
Page 10