Data Hazards: Solution - II
Solution II (hardware)
Detect problem and stall the pipeline
Freeze IF, RF stages for 2 cycles and insert NOPs into IRALU for 2 cycles
i
i + 1
i + 5
i + 6
ADD
CMP
MUL
ADD
CMP
CMP
ADD
NOP1
NOP2
ADD
NOP1
NOP2
IF
RF
WB
MUL
CMP
CMP
CMP
MUL
SUB
MUL
SUB
MUL
ALU
ADD(r1, r2, r3)
CMPLEC(r3, 5, r0)
r3 written
r3 read
i + 2
i + 3
i + 4
Previous slide
Next slide
Back to first slide
View graphic version