CS/EE 362 multipath..1 ©DAP & SIK 1995 CS/EE 362 Hardware Fundamentals Lecture 14: Designing a Multi-Cycle Datapath (Chapter 5: Hennessy and Patterson)

Slides:



Advertisements
Similar presentations
CPE 442 pipeline.1 Intro to Computer Architecture CpE 242 Computer Architecture and Engineering Designing a Pipeline Processor.
Advertisements

Pipeline Computer Architecture Lecture 12: Designing a Pipeline Processor.
CS152 Lec9.1 CS152 Computer Architecture and Engineering Lecture 9 Designing Single Cycle Control.
361 multicontroller.1 ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller.
361 datapath Computer Architecture Lecture 8: Designing a Single Cycle Datapath.
CS61C L26 Single Cycle CPU Datapath II (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2007 © UCB 3.6 TB DVDs? Maybe!  Researchers at Harvard have found a way to use.
361 multipath..1 ECE 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor.
CS152 / Kubiatowicz Lec10.1 3/1/99©UCB Spring 1999 Alternative datapath (book): Multiple Cycle Datapath °Miminizes Hardware: 1 memory, 1 adder Ideal Memory.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
Ceg3420 control.1 ©UCB, DAP’ 97 CEG3420 Computer Design Lecture 9.2: Designing Single Cycle Control.
EECC550 - Shaaban #1 Lec # 4 Winter CPU Organization Datapath Design: –Capabilities & performance characteristics of principal Functional.
Microprocessor Design
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
CS152 / Kubiatowicz Lec8.1 2/22/99©UCB Spring 1999 CS152 Computer Architecture and Engineering Lecture 8 Designing Single Cycle Control Feb 22, 1999 John.
CS 61C L17 Control (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #17: CPU Design II – Control
CS151B Computer Systems Architecture Winter 2002 TuTh 2-4pm BH Instructor: Prof. Jason Cong Lecture 8 Designing a Single Cycle Control.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Sep 9, 2002 Topic: Pipelining Basics.
EECC550 - Shaaban #1 Lec # 4 Winter Major CPU Design Steps 1Using independent RTN, write the micro- operations required for all target.
EEM 486: Computer Architecture Lecture 3 Designing a Single Cycle Datapath.
CS 61C L16 Datapath (1) A Carle, Summer 2004 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #16 – Datapath Andy.
361 control Computer Architecture Lecture 9: Designing Single Cycle Control.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures.
ECE 232 L12.Datapath.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 12 Datapath.
ELEN 350 Single Cycle Datapath Adapted from the lecture notes of John Kubiatowicz(UCB) and Hank Walker (TAMU)
CS3350B Computer Architecture Winter 2015 Lecture 5.6: Single-Cycle CPU: Datapath Control (Part 1) Marc Moreno Maza [Adapted.
CPE 442 pipeline.1 Intro to Computer Architecture CpE 242 Computer Architecture and Engineering Designing a Pipeline Processor.
Computer Organization CS224 Fall 2012 Lesson 26. Summary of Control Signals addsuborilwswbeqj RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp.
CASE STUDY OF A MULTYCYCLE DATAPATH. Alternative Multiple Cycle Datapath (In Textbook) Minimizes Hardware: 1 memory, 1 ALU Ideal Memory Din Address 32.
CPE 442 multipath..1 Intro. to Computer Architecture CpE 242 Computer Architecture and Engineering Designing a Multiple Cycle Processor.
EEM 486: Computer Architecture Designing Single Cycle Control.
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
CPE 442 single-cycle datapath.1 Intro. To Computer Architecture CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath.
W.S Computer System Design Lecture 4 Wannarat Suntiamorntut.
Datapath and Control Unit Design
CS3350B Computer Architecture Winter 2015 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza [Adapted.
Computer Organization CS224 Chapter 4 Part a The Processor Spring 2011 With thanks to M.J. Irwin, T. Fountain, D. Patterson, and J. Hennessy for some lecture.
Designing a Single- Cycle Processor 國立清華大學資訊工程學系 黃婷婷教授.
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
CS4100: 計算機結構 Designing a Single-Cycle Processor 國立清華大學資訊工程學系 一零零學年度第二學期.
Csci 136 Computer Architecture II –Single-Cycle Datapath Xiuzhen Cheng
EEM 486: Computer Architecture Lecture 3 Designing Single Cycle Control.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single-Cycle CPU Datapath & Control Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic.
Single Cycle Controller Design
1 EEL-4713 Ann Gordon - Ross EEL-4713 Computer Architecture Designing a Multiple-Cycle Processor.

Problem with Single Cycle Processor Design
CpE 442 Designing a Multiple Cycle Controller
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
Designing a Multicycle Processor
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
Single Cycle CPU Design
CS 704 Advanced Computer Architecture
CS 704 Advanced Computer Architecture
Instructors: Randy H. Katz David A. Patterson
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
CpE 442 Microprogramming and Exceptions
CpE 242 Computer Architecture and Engineering Designing a Multiple Cycle Processor Start X:40.
COMS 361 Computer Organization
EECS 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor Start X:40.
EECS 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller Start X:40.
CpE 242 Computer Architecture and Engineering Designing a Pipeline Processor Start X:40.
Instructors: Randy H. Katz David A. Patterson
CpE 442 Designing a Multiple Cycle Controller
Alternative datapath (book): Multiple Cycle Datapath
COMS 361 Computer Organization
What You Will Learn In Next Few Sets of Lectures
Processor: Datapath and Control
Presentation transcript:

CS/EE 362 multipath..1 ©DAP & SIK 1995 CS/EE 362 Hardware Fundamentals Lecture 14: Designing a Multi-Cycle Datapath (Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers

CS/EE 362 multipath..2 ©DAP & SIK 1995 Drawbacks of this Single Cycle Processor °Long cycle time: Cycle time must be long enough for the load instruction: -PC’s Clock -to-Q + -Instruction Memory Access Time + -Register File Access Time + -ALU Delay (address calculation) + -Data Memory Access Time + -Register File Setup Time + -Clock Skew °Cycle time is much longer than needed for all other instructions. Examples: R-type instructions do not require data memory access Jump does not require ALU operation nor data memory access

CS/EE 362 multipath..3 ©DAP & SIK 1995 Overview of a Multiple Cycle Implementation °The root of the single cycle processor’s problems: The cycle time has to be long enough for the slowest instruction °Solution: Break the instruction into smaller steps Execute each step (instead of the entire instruction) in one cycle -Cycle time: time it takes to execute the longest step -Keep all the steps to have similar length This is the essence of the multiple cycle processor °The advantages of the multiple cycle processor: Cycle time is much shorter Different instructions take different number of cycles to complete -Load takes five cycles -Jump only takes three cycles Allows a functional unit to be used more than once per instruction

CS/EE 362 multipath..4 ©DAP & SIK 1995 The Five Steps of a Load Instruction Clk PC Rs, Rt, Rd, Op, Func Clk-to-Q ALUctr Instruction Memory Access Time Old ValueNew Value RegWrOld ValueNew Value Delay through Control Logic busA Register File Access Time Old ValueNew Value busB ALU Delay Old ValueNew Value Old ValueNew Value Old Value ExtOpOld ValueNew Value ALUSrcOld ValueNew Value AddressOld ValueNew Value busWOld ValueNew Delay through Extender & Mux Data Memory Access Time Instruction FetchInstr Decode / Reg. Fetch AddressReg WrData Memory Register File Write Time

CS/EE 362 multipath..5 ©DAP & SIK 1995 Instruction Fetch Cycle: In the Beginning °Every cycle begins right AFTER the clock tick: mem[PC] PC + 4 Ideal Memory WrAdr Din RAdr 32 Dout MemWr=? PC 32 Clk ALU 32 ALUop=? ALU Control 4 Instruction Reg 32 IRWr=? Clk PCWr=? Clk You are here! One “Logic” Clock Cycle

CS/EE 362 multipath..6 ©DAP & SIK 1995 Instruction Fetch Cycle: The End °Every cycle ends AT the next clock tick (storage element updates): IR + 4 Ideal Memory WrAdr Din RAdr 32 Dout MemWr= PC 32 Clk ALU 32 ALUOp = ALU Control 4 0 Instruction Reg 32 IRWr= Clk PCWr= Clk You are here! One “Logic” Clock Cycle

CS/EE 362 multipath..7 ©DAP & SIK 1995 Instruction Fetch Cycle: Overall Picture Target Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg IRWr= 32 busA 32busB PCWr= ALUSelA= Mux PC Mux ALUSelB= Mux Zero PCWrCond=PCSrc=BrWr= 32 IorD= 1: ALUOp= Others: 0s x: Ifetch

CS/EE 362 multipath..8 ©DAP & SIK 1995 Register Fetch / Instruction Decode °busA <- RegFile[rs] ; busB <- RegFile[rt] ; °ALU is not being used: ALUctr = ? Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= RegDst= Mux PC Mux Imm ALUSelB= Mux Zero PCWrCond= PCSrc= 32 IorD= Func Op Go to the Control 6 6

CS/EE 362 multipath..9 ©DAP & SIK 1995 Register Fetch / Instruction Decode (Continue) °busA <- Reg[rs] ; busB <- Reg[rt] ; °Target <- PC + SignExt(Imm16)*4 Target Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= RegDst= Mux PC Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux Zero PCWrCond= PCSrc=BrWr= 32 IorD= Func Op Control 6 6 Beq Rtype Ori Memory : 1: ALUOp= Others: 0s x: ALUSelB= Rfetch/Decode

CS/EE 362 multipath..10 ©DAP & SIK 1995 Branch Completion °if (busA == busB) PC <- Target Target Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= RegDst= Mux PC Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux Zero PCWrCond= PCSrc=BrWr= 32 IorD= 1: ALUOp= x: ALUSelB= BrComplete

CS/EE 362 multipath..11 ©DAP & SIK 1995 R-type Execution °ALU Output <- busA op busB Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= 1: ALUOp= ALUSelB= x: RExec

CS/EE 362 multipath..12 ©DAP & SIK 1995 R-type Completion °R[rd] <- ALU Output Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= 1:r ALUOp= x: ALUSelB= Rfinish

CS/EE 362 multipath..13 ©DAP & SIK 1995 A Multiple Cycle Delay Path °There is no register to save the results between: Register Fetch: busA <- Reg[rs] ; busB <- Reg[rt] R-type Execution: ALU output <- busA op busB R-type Completion: Reg[rd] <- ALU output ALU 32 ALU Control Instruction Reg 32 Reg File Ra Rw busW Rb busA 32busB Rs Rt Mux 0 1 Rt Rd Mux Zero PCWr ALUselA ALUselB Register here to save outputs of Rfetch? Register here to save outputs of RExec? ALUOp

CS/EE 362 multipath..14 ©DAP & SIK 1995 A Multiple Cycle Delay Path (Continue) °Register is NOT needed to save the outputs of Register Fetch: IRWr = 0: busA and busB will not change after Register Fetch °Register is NOT needed to save the outputs of R-type Execution: busA and busB will not change after Register Fetch Control signals ALUSelA, ALUSelB, and ALUOp will not change after R-type Execution Consequently ALU output will not change after R-type Execution °In theory, you need a register to hold a signal value if: (1) The signal is computed in one clock cycle and used in another. (2) AND the inputs to the functional block that computes this signal can change before the signal is written into a state element. °You can save a register if Cond 1 is true BUT Cond 2 is false: But in practice, this will introduce a multiple cycle delay path: -A logic delay path that takes multiple cycles to propagate from one storage element to the next storage element

CS/EE 362 multipath..15 ©DAP & SIK 1995 Pros and Cons of a Multiple Cycle Delay Path °A 3-cycle path example: IR (storage) -> Reg File Read -> ALU -> Reg File Write (storage) °Advantages: Register savings We can share time among cycles: -If ALU takes longer than one cycle, still “a OK” as long as the entire path takes less than 3 cycles to finish ALU 32 ALU Control Instruction Reg 32 Reg File Ra Rw busW Rb busA 32busB Rs Rt Mux 0 1 Rt Rd Mux Zero ALUselB

CS/EE 362 multipath..16 ©DAP & SIK 1995 Pros and Cons of a Multiple Cycle Delay Path (Continue) °Disadvantage: Static timing analyzer, which ONLY looks at delay between two storage elements, will report this as a timing violation You have to ignore the static timing analyzer’s warnings But you may end up ignoring real timing violations I always TRY to put in registers between cycles to avoid MCDP ALU 32 ALU Control Instruction Reg 32 Reg File Ra Rw busW Rb busA 32busB Rs Rt Mux 0 1 Rt Rd Mux Zero ALUselB

CS/EE 362 multipath..17 ©DAP & SIK 1995 Ori Execution °ALU output <- busA or ZeroExt[Imm16] Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= ALUOp= 1: ALUSelB= x: OriExec

CS/EE 362 multipath..18 ©DAP & SIK 1995 Ori Completion °Reg[rt] <- ALU output Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= 1: ALUOp= x: ALUSelB= OriFinish

CS/EE 362 multipath..19 ©DAP & SIK 1995 Memory Address Calculation °ALU output <- busA + SignExt[Imm16] Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= ALUOp= 1: ALUSelB= x: AdrCal

CS/EE 362 multipath..20 ©DAP & SIK 1995 Memory Access for Store °mem[ALU output] <- busB Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra RwRw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= ALUOp= x: 1: ALUSelB= SWmem

CS/EE 362 multipath..21 ©DAP & SIK 1995 Memory Access for Load °Mem Dout <- mem[ALU output] Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= ALUOp= x: 1: ALUSelB= LWmem

CS/EE 362 multipath..22 ©DAP & SIK 1995 Write Back for Load °Reg[rt] <- Mem Dout Ideal Memory WrAdr Din RAdr 32 Dout MemWr= 32 ALU 32 ALUOp= ALU Control Instruction Reg 32 IRWr= 32 Reg File Ra Rw busW Rb busA 32busB RegWr= Rs Rt Mux 0 1 Rt Rd PCWr= ALUSelA= Mux 01 RegDst= Mux PC MemtoReg= Extend ExtOp= Mux Imm 32 << 2 ALUSelB= Mux 1 0 Target 32 Zero PCWrCond=PCSrc=BrWr= 32 IorD= ALUOp= x: 1: ALUSelB= LWwr

CS/EE 362 multipath..23 ©DAP & SIK 1995 Putting it all together: Multiple Cycle Datapath Ideal Memory WrAdr Din RAdr 32 Dout MemWr 32 ALU 32 ALUOp ALU Control Instruction Reg 32 IRWr 32 Reg File Ra Rw busW Rb busA 32busB RegWr Rs Rt Mux 0 1 Rt Rd PCWr ALUSelA Mux 01 RegDst Mux PC MemtoReg Extend ExtOp Mux Imm 32 << 2 ALUSelB Mux 1 0 Target 32 Zero PCWrCondPCSrcBrWr 32 IorD

CS/EE 362 multipath..24 ©DAP & SIK 1995 Summary °Disadvantages of the Singple Cycle Proccessor Long cycle time Cycle time is too long for all instructions except the Load °Multiple Cycle Processor: Divide the instructions into smaller steps Execute each step (instead of the entire instruction) in one cycle °Do NOT cofuse Multiple Cycle Processor with Multipe Cycle Dealy Path Multiple Cycle Processor executes each instruction in multiple clock cycles Multiple Cycle Delay Path: a combinational logic path between two storage elements that takes more than one clock cycle to complete °It is possible (desirable) to build a MC Processor without MCDP: Use a register to save a signal’s value whenever a signal is generated in one clock cycle and used in another cycle later

CS/EE 362 multipath..25 ©DAP & SIK 1995 Putting it all together: Control State Diagram 1: PCWr, IRWr ALUOp=Add Others: 0s x: PCWrCond RegDst, Mem2R Ifetch 1: BrWr, ExtOp ALUOp=Add Others: 0s x: RegDst, PCSrc ALUSelB=10 IorD, MemtoReg Rfetch/Decode 1: PCWrCond ALUOp=Sub x: IorD, Mem2Reg ALUSelB=01 RegDst, ExtOp ALUSelA BrComplete PCSrc 1: RegDst ALUOp=Rtype ALUSelB=01 x: PCSrc, IorD MemtoReg ALUSelA ExtOp RExec 1: RegDst, RegWr ALUOp=Rtype ALUselA x: IorD, PCSrc ALUSelB=01 ExtOp Rfinish ALUOp=Or IorD, PCSrc 1: ALUSelA ALUSelB=11 x: MemtoReg OriExec 1: ALUSelA ALUOp=Or x: IorD, PCSrc RegWr ALUSelB=11 OriFinish ALUOp=Add PCSrc 1: ExtOp ALUSelB=11 x: MemtoReg ALUSelA AdrCal ALUOp=Add x: PCSrc,RegDst 1: ExtOp ALUSelB=11 MemtoReg MemWr ALUSelA SWMem ALUOp=Add x: MemtoReg 1: ExtOp ALUSelB=11 ALUSelA, IorD PCSrc LWmem ALUOp=Add x: PCSrc 1: ALUSelA ALUSelB=11 MemtoReg RegWr, ExtOp IorD LWwr lw or sw lwsw Rtype Ori beq