Imagine there is a machine that has shared memory for both data and instructions (which means a control hazard can occur between the MEM
and IF
stages). Can instructions such as ADD
that do nothing during the MEM
stage cause a control hazard with other instructions that are in the IF
stage?
ADD $1, $1, $3 : IF ID EX MEM WB
SUB $4, $5, $6 : IF ID EX MEM WB
In the example above, is there a control hazard between the MEM
stage of the ADD
instruction and the IF
stage of the SUB
instruction?
Edit: Description of the each instruction.
IF - Instruction Fetch
ID - Instruction Decode
EX - Execute
MEM - Memory Access
WB - Write-Back