csse232 computer architecture i
play

CSSE232 Computer Architecture I Pipelining Summary of - PowerPoint PPT Presentation

CSSE232 Computer Architecture I Pipelining Summary of Instruc;on Execu;on sae $t0, $t1($t2) sll $at, $t1, 2 add $at, $at, $t2 sw $t0,


  1. CSSE232 ¡ Computer ¡Architecture ¡I ¡ Pipelining ¡

  2. Summary ¡of ¡Instruc;on ¡Execu;on ¡ • sae ¡$t0, ¡$t1($t2) ¡ • sll ¡$at, ¡$t1, ¡2 ¡ • add ¡$at, ¡$at, ¡$t2 ¡ • sw ¡$t0, ¡0($at) ¡ Action for R-type Action for memory-reference Action for Action for Step name instructions instructions branches jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction A = Reg [IR[25-21]] decode/register fetch B = Reg [IR[20-16]] ALUOut = PC + (sign-extend (IR[15-0]) << 2) Execution, address ALUOut = A op B ALUOut = A + sign-extend if (A ==B) then PC = PC [31-28] II computation, branch/ (IR[15-0]) PC = ALUOut (IR[25-0]<<2) jump completion Memory access or R-type Reg [IR[15-11]] = Load: MDR = Memory[ALUOut] completion ALUOut or Store: Memory [ALUOut] = B Load: Reg[IR[20-16]] = MDR Memory read completion

  3. Outline ¡ • Review ¡of ¡mul;cycle ¡datapath ¡and ¡control ¡ • Pipelining ¡ • Pipeline ¡control ¡

  4. Differences ¡between ¡single-­‑cycle, ¡mul;-­‑cycle, ¡ and ¡pipelining ¡ • Components ¡ – Memory, ¡adders, ¡extra ¡registers ¡ • Control ¡ ¡ – Fixed ¡vs ¡Finite ¡state ¡ • Performance ¡ – Cycles ¡

  5. Ac;vity ¡ • You ¡have ¡a ¡date ¡at ¡9:45pm. ¡Its ¡6:00pm ¡and ¡ you’ve ¡just ¡realized ¡that ¡you ¡have ¡no ¡clean ¡ clothes. ¡You ¡have ¡4 ¡loads ¡of ¡laundry. ¡The ¡laundry ¡ process ¡includes ¡4 ¡steps: ¡ – Wash ¡ – Dry ¡ – Fold ¡ – Put ¡away ¡ ¡ Assume ¡each ¡step ¡takes ¡30 ¡mins. ¡Describe ¡a ¡process ¡for ¡ comple;ng ¡the ¡laundry ¡by ¡9:45pm. ¡

  6. Pipelining ¡Analogy ¡ n Four ¡loads: ¡ n Sequen;al: ¡8 ¡hrs ¡ n Pipeline: ¡3.5 ¡hrs ¡ n Speedup ¡ = ¡8/3.5 ¡= ¡2.3 ¡ • Pipelined ¡laundry: ¡overlapping ¡ execu;on ¡ – Parallelism ¡improves ¡performance ¡

  7. Mul;cycle ¡Approach ¡ ¡ PCSrc M Add u x Note ¡par;culari;es ¡of ¡ • Add ALU 4 ¡ result Shift ¡ ¡ ¡ ¡mul;cycle ¡vs. ¡single-­‑ ¡ left 2 Registers ALU operation 3 ¡ ¡ ¡ ¡diagrams ¡ Read MemWrite ALUSrc Read register 1 PC Read address Read MemtoReg data 1 register 2 Zero ¡ Instruction ALU ALU Read Write Read Address result M register data 2 data M Instruction u – single ¡memory ¡for ¡data ¡ u x Write memory Data x data memory Write RegWrite ¡ ¡ ¡ ¡and ¡instruc;ons ¡ data 16 32 Sign MemRead – single ¡ALU, ¡no ¡extra ¡adders ¡ extend – extra ¡registers ¡to ¡ ¡ Single-cycle datapath ¡ ¡ ¡ ¡hold ¡data ¡between ¡ ¡ ¡ ¡ ¡ ¡clock ¡cycles ¡ ¡ Instruction register Data PC Address A Register # Instruction Memory Registers ALU ALUOut or data Register # Memory data B Data register Register # Multicycle datapath (high-level view)

  8. Summary ¡of ¡Instruc;on ¡Execu;on ¡ Action for R-type Action for memory-reference Action for Action for Step name instructions instructions branches jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction A = Reg [IR[25-21]] decode/register fetch B = Reg [IR[20-16]] ALUOut = PC + (sign-extend (IR[15-0]) << 2) Execution, address ALUOut = A op B ALUOut = A + sign-extend if (A ==B) then PC = PC [31-28] II computation, branch/ (IR[15-0]) PC = ALUOut (IR[25-0]<<2) jump completion Memory access or R-type Reg [IR[15-11]] = Load: MDR = Memory[ALUOut] completion ALUOut or Store: Memory [ALUOut] = B Load: Reg[IR[20-16]] = MDR Memory read completion

  9. MIPS ¡Pipeline ¡ Five ¡stages, ¡one ¡step ¡per ¡stage ¡ • 1. IF: ¡Instruc;on ¡fetch ¡from ¡memory ¡ 2. ID: ¡Instruc;on ¡decode ¡& ¡register ¡read ¡ 3. EX: ¡Execute ¡opera;on ¡or ¡calculate ¡address ¡ 4. MEM: ¡Access ¡memory ¡operand ¡ 5. WB: ¡Write ¡result ¡back ¡to ¡register ¡

  10. Single ¡cycle ¡+ ¡stages ¡ • IF, ¡ID, ¡EX, ¡MEM, ¡WB ¡ PCSrc M Add u x Add ALU 4 result Shift left 2 Registers ALU operation Read 3 MemWrite ALUSrc Read register 1 PC Read address Read data 1 MemtoReg Zero register 2 Instruction ALU ALU Read Write Read Address result M register data data 2 M u Instruction u x Write memory Data x data memory Write RegWrite data 32 16 Sign MemRead extend

  11. Summary ¡of ¡Instruc;on ¡Execu;on ¡ Step Action for R-type Action for memory-reference Action for Action for Step name instructions instructions branches jumps Instruction fetch IR = Memory[PC] 1: IF PC = PC + 4 Instruction A = Reg [IR[25-21]] 2: ID decode/register fetch B = Reg [IR[20-16]] ALUOut = PC + (sign-extend (IR[15-0]) << 2) Execution, address ALUOut = A op B ALUOut = A + sign-extend if (A ==B) then PC = PC [31-28] II 3: EX computation, branch/ (IR[15-0]) PC = ALUOut (IR[25-0]<<2) jump completion Memory access or R-type Reg [IR[15-11]] = Load: MDR = Memory[ALUOut] 4: MEM completion ALUOut or Store: Memory [ALUOut] = B 5: WB Load: Reg[IR[20-16]] = MDR Memory read completion

  12. Single ¡cycle ¡+ ¡stages ¡ • Where ¡should ¡the ¡stages ¡go? ¡ PCSrc M Add u x Add ALU 4 result Shift left 2 Registers ALU operation Read 3 MemWrite ALUSrc Read register 1 PC Read address Read data 1 MemtoReg Zero register 2 Instruction ALU ALU Read Write Read Address result M register data data 2 M u Instruction u x Write memory Data x data memory Write RegWrite data 32 16 Sign MemRead extend

  13. MIPS ¡Pipelined ¡Datapath ¡

  14. Pipeline ¡registers ¡ • Need ¡registers ¡between ¡stages ¡ – To ¡hold ¡informa;on ¡produced ¡in ¡previous ¡cycle ¡

  15. IF ¡for ¡Load, ¡Store, ¡… ¡

  16. ID ¡for ¡Load, ¡Store, ¡… ¡

  17. EX ¡for ¡Load ¡

  18. MEM ¡for ¡Load ¡

  19. WB ¡for ¡Load ¡ Wrong ¡ register ¡ number ¡

  20. Corrected ¡Datapath ¡for ¡Load ¡ The ¡first ¡of ¡many ¡adjustments ¡needed ¡

  21. EX ¡for ¡Store ¡

  22. MEM ¡for ¡Store ¡

  23. WB ¡for ¡Store ¡

  24. Mul;-­‑Cycle ¡Pipeline ¡Diagram ¡ • Form ¡showing ¡resource ¡usage ¡

  25. Mul;-­‑Cycle ¡Pipeline ¡Diagram ¡ • Tradi;onal ¡form ¡

  26. Single-­‑Cycle ¡Pipeline ¡Diagram ¡ • State ¡of ¡pipeline ¡in ¡a ¡given ¡cycle ¡

  27. Pipelined ¡Control ¡(Simplified) ¡

  28. Pipelined ¡Control ¡ • Control ¡signals ¡derived ¡from ¡instruc;on ¡ – As ¡in ¡single-­‑cycle ¡implementa;on ¡

  29. Pipelined ¡Control ¡

  30. Outline ¡ • Review ¡of ¡mul;cycle ¡datapath ¡and ¡control ¡ • Pipelining ¡ • Pipeline ¡control ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend