Pipeline Hazard Example - 2024.2 English

MicroBlaze Processor Reference Guide (UG984)

Document ID
UG984
Release Date
2024-11-27
Version
2024.2 English

The effect of a data hazard is illustrated in the following table, using the five stage pipeline.

The example shows a data hazard for a multiplication instruction, where the subsequent add instruction needs the result in register r3 to proceed. This means that the add instruction is stalled in OF during cycle 3 and 4 until the multiplication is complete.

Table 1. Multiplication Data Hazard Example
Cycle IF OF EX MEM WB
1 mul r3, r4, r5
2 add r6, r3, r4 mul r3, r4, r5
3 add r6, r3, r4 mul r3, r4, r5
4 add r6, r3, r4 - mul r3, r4, r5
5 add r6, r3, r4 - - mul r3, r4, r5
6 add r6, r3, r4 - -