Detecting a Hazard
The EXECUTE entity must look at in src1, src2 values and compare them against dest values from the other inputs.
- Comparison order is IMPORTANT. Must compare mpacket, then wpacket, then rpacket.
Some special cases:
- If dest value is 0, (indicates r0), no need to forward because r0 never changes.
- If mpacket opcode is Load or Store, NEVER forward (dest value is never produced by execute unit)
- If wpacket opcode is Load, need to use mem_data value!
- If rpacket write_flag is false, never forward!