Pipelining hazards and solutions- Three types of pipeline hazards
Data hazards arise because of the unavailability of an operand
- For example, an instruction may require an operand that will be the result of a preceding, still uncompleted instruction.
Structural hazards may arise from some combinations of instructions that cannot be accommodated because of resource conflicts
- For example, if processor has only one register file write port and two instructions want to write in the register file at the same time.
Control hazards arise from branch, jump, and other control flow instructions
- For example, a taken branch interrupts the flow of instructions into the pipeline ? the branch target must be fetched before the pipeline can resume execution.
Common solution is to stall the pipeline until the hazard is resolved, inserting one or more “bubbles” in the pipeline.