NOP
NOP / no-op: An instruction that does no operation to change state.
You can use NOPs when NOPs when Data Forwarding does not work, because you would physically need to go back in time.
Good piazza post that helps better understand NOP:
- https://piazza.com/class/l7rm65q9rgn2rz/post/411
- So it really comes down to the architecture. In the above architectures, the branch comparison place differs. Which is why you have looser or stricter requirements on when to forward.
- The dependence goes backwards in time so we need to “stall”, i.e. actually wait for the instruction to complete
In addition to a forwarding unit, we need a Hazard Detection Unit.
When you cannot do Data Forwarding, you gotta do stalling with Data Forwarding, you gotta do stalling with NOPs.