We now examine in detail how the basic pipeline CPU executes the load instruction.
The instruction is encoded as follows:
Br Cond ------ LD ST BRA Opcode Im Cen <-- Dest -> <- Src1 --> <-- Src2 -> +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
The instruction is encoded as follows:
Br Cond ------ LD ST BRA Opcode Im Cen <-- Dest -> <- Src1 --> <-- Src2 -> +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
The stall signal is actually derived using a combination of a number of signals - we must find all possible conflict situations and form the stall signal for each conflicting situation. We will learn about other conflicting situations soon....
In this example, you see that first situation where you need to stall:
|
Stall the IF stage when the instruction in the MEM stage is a LOAD
instruction
(this fact can be recognized from the LD bit in the instruction) |
For now, I will assume that the LOAD instruction does not affect the outcome of the instruction in the EX stage - i.e., in this example, I do not require that the EX stage be stalled.
Later, you will see that you may also need to stall the EX stage when the MEM stage contains a LOAD instruction....