Pipelining/Problem 5c

Explain what a control hazard is and how to avoid it


Control hazard: Instruction fetch depends on some in-flight instruction being executed. For example: the target address of a branch or jump is not immediately available after the branch/jump exits from fetch stage.

  • design a hazard unit to detect the hazard and stall the pipeline

  • branch prediction

  • using delay slot in the instruction scheduling