Recap - Generic MIPS 5 Stage Pipeline: Data Path Considerations
Recap - Generic MIPS 5 Stage Pipeline: Data Path Considerations
Actions can only effect the contents of the corresponding pipe stage
(interlocks and forwarding conform to this).
Availability of any resource (data or hardware) must be assured before an
instruction is “released” from the ID stage;
• Unconditional branch instructions being the only exception, in which case a prediction
mechanism is necessary.
Malcolm I. Heywood 2
CSCI3121
Hennessy and Paterson, Computer Architecture a Quantitative Approach (4th Ed)
Appendix A – Instruction Set Pipelining.
Stage Instruction
IF/ID.IR ←Mem[PC];
IF
IF/ID.NPC, PC ← (if ((EX/MEM.opcode == branch) & EX.MEM.cond)
then { EX/MEM.ALUout } else {PC + 4}
ID/EX.A ← Reg[IF/ID.IR[rs]]; ID/EX.B ← [IF.ID.IR[rt]];
ID
ID/EX.NPC ← IF/ID.NPC; ID/EX.IR ← IF/ID.IR;
ID/EX.Imm ← SIGN-EXTEND(IF/ID.IR[immediate field])
ALU instruction Load / Store instruction Branch instruction
Malcolm I. Heywood 3
CSCI3121
Hennessy and Paterson, Computer Architecture a Quantitative Approach (4th Ed)
Appendix A – Instruction Set Pipelining.
IF → ID ID → EX EX → MEM MB → WB
IR IR IR IR
NPC NPC
Imm
A
B B
ALUout ALUout
cond LMD
PC, NPC
GPR
Control Considerations
• Releasing instruction from ID → EX is called instruction issue;
• MIPS integer pipe,
o tests all data hazards BEFORE instruction issue;
o identifies all necessary forwarding BEFORE instruction issue;
• Limiting tests for data hazards and forwarding to the ID stage simplifies hardware as the
pipeline registers already retain the state of currently issued instructions.
• Inserting a stall,
o Set ID/EX registers to ‘0’ (≡ NOP);
o Recirculate ID/EX register values to retain the stalled instruction at current
position.
• Forwarding control:
o Source ?
o Destination ?
o Implication,
Perform comparison between destination (EX/MEM.IR and MEM/WB.IR)
against source (ID/EX.IR and EX/MEM.IR);
Results in a total of 10 different comparisons per instruction, Table 2.
Malcolm I. Heywood 4
CSCI3121
Hennessy and Paterson, Computer Architecture a Quantitative Approach (4th Ed)
Appendix A – Instruction Set Pipelining.
Malcolm I. Heywood 5
CSCI3121
Hennessy and Paterson, Computer Architecture a Quantitative Approach (4th Ed)
Appendix A – Instruction Set Pipelining.
Malcolm I. Heywood 6
CSCI3121