Pipelined Processor Design: Computer Architecture and Assembly Language
Pipelined Processor Design: Computer Architecture and Assembly Language
CSE 333
Computer Architecture and Assembly Language
Control Hazards
Summary
Pipelining Example
Laundry Example: Three Stages
Register
Register
Register
Input S1 S2 Sk Output
Clock
Let i = time delay in stage Si
Clock cycle = max(i) is the maximum stage delay
Clock frequency f = 1/ = 1/max(i)
A pipeline can process n tasks in k + n – 1 cycles
k cycles are needed to complete the first task
n – 1 cycles are needed to complete the remaining n – 1 tasks
CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 CC9 Time
Resolving Structural Hazards
Serious Hazard:
Hazard cannot be ignored
add $s4, $s2, $t5 IM Reg Reg Reg Reg ALU DM Reg
Branch
L1: target instruction Target IF Reg ALU DM
Addr
In Summary
Three types of pipeline hazards
Structural hazards: conflict using a resource during same cycle
Data hazards: due to data dependencies between instructions
Control hazards: due to branch and jump instructions