新的DLX(MPS)数据通路 DEX EXMEM MEME PcH nsmuccnIR MEWER 中国科学技术大学 chapter.22
中国科学技术大学 chapter3.22 新的DLX (MIPS)数据通路
在新的 Datapath下各段的操作 F lF/DR←Mem[Pcl IF/ID NPC, PC + (if ((EX/MEM. opcode = branch)& EX/MEM. cond)(EX/MEM. ALUOutput] else (PC+4); D D/EXA← Regs[IF/D Ir[rs];DEXB← Regs[F/D IR[rt]; ID/ EXNPC←F/D.NPG;DEXR←FADR; ID/EX/Imm +sign-extend(F/D IR[immediate field]; EX ALU instruction 》 EX/MEME←D/EXR; 》 EX/MEM.ALUOutput←D/ EXA func ID/EXB;or 》 EX/MEM. ALUOoutput← DIEX. A op ID/EXmm; 中国科学技术大学 chapter.23
中国科学技术大学 chapter3.23 在新的Datapath下各段的操作 • IF – IF/ID.IR ←Mem[PC]; – IF/ID.NPC,PC ←(if ((EX/MEM.opcode == branch) & EX/MEM.cond) {EX/MEM.ALUOutput} else {PC+4}); • ID – ID/EX.A ←Regs[IF/ID.IR[rs]]; ID/EX.B ← Regs[IF/ID.IR[rt]]; – ID/EX.NPC←IF/ID.NPC; ID/EX.IR ← IF/ID.IR; – ID/EX/Imm ← sign-extend(IF/ID.IR[immediate field]); • EX – ALU instruction » EX/MEM.IR ← ID/EX.IR; » EX/MEM.ALUOutput ← ID/EX.A func ID/EX.B; or » EX/MEM.ALUOoutput ← ID/EX.A op ID/EX.Imm;
Load or store instruction 》 EX/MEMIR←|D/EX|R 》 EX/MEM.ALUOutput←|DEXA+ D/EXImn 》 EX/MEM. B← ID/EXE Branch instruction 》 EX/MEM. ALUOutput← ID/EXNPC+( DIEX Imm<<2) 》 EX/MEM. cond←(D/EXA==0); MEM ALU Instruction 》MEM/B|R← EX/MEM.R 》 MEM/WB. ALUOutput← EX/MEM. ALUOutput; Load or store instruction 》MEM/WB|R← EX/MEM.R 》 MEMWB, LMD←Mem[ EX/MEM. ALUOutput];or Mem[EX/MEM. ALUOutput]- EX/MEM. B;(store) 中国科学技术大学 chapter.24
中国科学技术大学 chapter3.24 – Load or store instruction » EX/MEM.IR ← ID/EX.IR » EX/MEM.ALUOutput ← ID/EX.A + ID/EX.Imm » EX/MEM.B ← ID/EX.B – Branch instruction » EX/MEM.ALUOutput ← ID/EX.NPC + (ID/EX.Imm << 2) » EX/MEM.cond ← (ID/EX.A == 0); • MEM – ALU Instruction » MEM/WB.IR ←EX/MEM.IR » MEM/WB.ALUOutput ←EX/MEM.ALUOutput; – Load or store instruction » MEM/WB.IR ←EX/MEM.IR; » MEM/WB.LMD ← Mem[EX/MEM.ALUOutput]; or Mem[EX/MEM.ALUOutput] ← EX/MEM.B; (store)
·WB ALU instruction 》 Regs[MEM/WB. IR[rd]]← MEM/B. ALUOutput;or 》 Regs[MEM/B IR[]← MEM/B. ALUOutput; For load only 》 Regs[MEM/WB|R[r可]← MEMWB, LMD 中国科学技术大学 chapter.25
中国科学技术大学 chapter3.25 • WB – ALU instruction » Regs[MEM/WB.IR[rd]] ← MEM/WB.ALUOutput; or » Regs[MEM/WB.IR[rt]] ← MEM/WB.ALUOutput; – For load only » Regs[MEM/WB.IR[rt]] ← MEM/WB.LMD
简化的 Pipelining Time(clock cycles) cle 1: Cycle 2: Cycle 3: Cycle 4: Cycle 5: Cycle 6: Cycle 7 工nsto Ifetch 中叫四 Ifetch 叫 叫剀 DMem Ifetch 叫沙 中国科学技术大学 chapter 3. 26
中国科学技术大学 chapter3.26 简化的 Pipelining I n s t r. O r d e r Time (clock cycles) Reg ALU Ifetch DMem Reg Reg ALU Ifetch DMem Reg Reg ALU Ifetch DMem Reg Reg ALU Ifetch DMem Reg Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Cycle 6 Cycle 7