Basic Pipeline Steps (continued)
Memory access/branch completion (MEM): only for load, store, and branch instructions. If the instruction is:
- register-register: the content of the ALU output register is transferred to the ALU result register.
- load: the data is read from memory (as pointed to by the ALU output register) and is placed in the load memory data register;
- store: the data in the store value register is written into the D-cache (as pointed to by the ALU output register);
- control transfer: for jump and branch that is taken: the PC is replaced by the ALU output register content; otherwise, the PC remains unchanged (in both cases, the next step WB is skipped);
Write back (WB): the result of the instruction execution (register-register or load instruction) is stored into the register file in the first half of the phase. In particular, the load memory data register or the ALU result register is written into the register file.