<<< MIPS Instruction pipeline example | Index | >>> |
Hazard is a dependency that breaks pipelining
Data hazard program needs a value that has not been computed yet
Control hazard program does not know which instruction is next
Data hazard example:
add $t1, $t2, $t3 # IF ID EX ME WB-$t1 is set here addi $t4, $t1, 1 # IF ID-$t1 is read here EX ME WB
Solution 1: processor inserts delays
add $t1, $t2, $t3 # IF ID EX ME WB-$t1 is set here addi $t4, $t1, 1 # IF XX XX XX ID-$t1 is read here EX ME WB
Solution 2: processor reorders instructions to avoid data hazards
<<< MIPS Instruction pipeline example | Index | >>> |