MIPS architecture and pipeline
The MIPS processor is a RISC (Reduced Instruction Set Computer) which follows a LOAD/STORE architecture where the ALU operands come from the CPU general purposes registers and they cannot come directly from the memory: load data from the memory to the registers and store data from the registers to the memory.
MIPS pipeline
The MIPS architecture has a 5 stages pipeline:
- Instruction Fetch (IF): Send the content of the program counter (PC) register to the instruction memory and fetch the current instruction. Then update the PC adding 4 (each instruction is 4 bytes long)
- Instruction Decode (ID): Decode the current instruction and read from the register file the value of the registers
- Execution (EX): The ALU operates on the operands prepared in the previous steps.
- Memory access (MEM): Load and store instructions require to access the memory.
- Write back (WB): Write to the register file.
Optimized pipeline
Assume the register file read occurs in the second half of the clock cycle and the write in the first half.
To improve performance in case of branch hazards, we need to add more hardware resources to:
- Compare registers to derive the Branch Outcome
- Compute the Branch Target Address
- Update the PC register
as soon as possible in the pipeline.
MIPS optimized processor anticipated the comparison of registers, computation of BTA and update of PC during ID stage.
No Comments