361 multicontroller.1 ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller.

Slides:



Advertisements
Similar presentations
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 11: Control Unit Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization, ed-5.
Advertisements

CPE 442 pipeline.1 Intro to Computer Architecture CpE 242 Computer Architecture and Engineering Designing a Pipeline Processor.
Pipeline Computer Architecture Lecture 12: Designing a Pipeline Processor.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
CS61C L26 Single Cycle CPU Datapath II (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
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.
Microprocessor Design
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Sep 9, 2002 Topic: Pipelining Basics.
361 control Computer Architecture Lecture 9: Designing Single Cycle Control.
CS61C L27 Single Cycle CPU Control (1) Garcia, Fall 2006 © UCB Wireless High Definition?  Several companies will be working on a “WirelessHD” standard,
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
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 µprog..1 Intro. To Computer Architecture CpE 442 Microprogramming and Exceptions.
CS/EE 362 multicontroller..1 ©DAP & SIK 1995 CS/EE 362 Hardware Fundamentals Lecture 15: Designing a Multi-Cycle Controller (Chapter 5: Hennessy and Patterson)
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.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
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.
CS3350B Computer Architecture Winter 2015 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza [Adapted.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
Overview of Control Hardware Development
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
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.
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)
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Design a MIPS Processor (II)

Problem with Single Cycle Processor Design
CpE 442 Designing a Multiple Cycle Controller
IT 251 Computer Organization and Architecture
IT 251 Computer Organization and Architecture
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
Designing a Multicycle Processor
CS/COE0447 Computer Organization & Assembly Language
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
CPU Organization (Design)
CS 704 Advanced Computer Architecture
CS 704 Advanced Computer Architecture
John Lazzaro ( CS152 – Computer Architecture and Engineering Lecture 8 – Multicycle Design and Microcode John.
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.
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
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

361 multicontroller.1 ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller

361 multicontroller.2 Review 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

361 multicontroller.3 Review: 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

361 multicontroller.4 Review: 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=0 PC 32 Clk ALU 32 ALUOp = Add ALU Control 4 00 Instruction Reg 32 IRWr=1 Clk PCWr=1 Clk You are here! One “Logic” Clock Cycle

361 multicontroller.5 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

361 multicontroller.6 Instruction Fetch Cycle: Overall Picture Target Ideal Memory WrAdr Din RAdr 32 Dout MemWr=0 32 ALU 32 ALUOp=Add ALU Control Instruction Reg IRWr=1 32 busA 32busB PCWr=1 ALUSelA=0 Mux PC Mux ALUSelB=00 Mux Zero PCWrCond=xPCSrc=0BrWr=0 32 IorD=0 1: PCWr, IRWr ALUOp=Add Others: 0s x: PCWrCond RegDst, Mem2R Ifetch

361 multicontroller.7 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=0 32 ALU 32 ALUOp=Add ALU Control Instruction Reg 32 IRWr=0 32 Reg File Ra Rw busW Rb busA 32busB RegWr=0 Rs Rt Mux 0 1 Rt Rd PCWr=0 ALUSelA=0 RegDst=x Mux PC Extend ExtOp=1 Mux Imm 32 << 2 ALUSelB=10 Mux Zero PCWrCond=0 PCSrc=xBrWr=1 32 IorD=x Func Op Control 6 6 Beq Rtype Ori Memory : 1: BrWr, ExtOp ALUOp=Add Others: 0s x: RegDst, PCSrc ALUSelB=10 IorD, MemtoReg Rfetch/Decode

361 multicontroller.8 R-type Execution °ALU Output <- busA op busB Ideal Memory WrAdr Din RAdr 32 Dout MemWr=0 32 ALU 32 ALUOp=Rtype ALU Control Instruction Reg 32 IRWr=0 32 Reg File Ra Rw busW Rb busA 32busB RegWr=0 Rs Rt Mux 0 1 Rt Rd PCWr=0 ALUSelA=1 Mux 01 RegDst=1 Mux PC MemtoReg=x Extend ExtOp=x Mux Imm 32 << 2 ALUSelB=01 Mux 1 0 Target 32 Zero PCWrCond=0PCSrc=xBrWr=0 32 IorD=x 1: RegDst ALUOp=Rtype ALUSelB=01 x: PCSrc, IorD MemtoReg ALUSelA ExtOp RExec

361 multicontroller.9 R-type Completion °R[rd] <- ALU Output Ideal Memory WrAdr Din RAdr 32 Dout MemWr=0 32 ALU 32 ALUOp=Rtype ALU Control Instruction Reg 32 IRWr=0 32 Reg File Ra Rw busW Rb busA 32busB RegWr=1 Rs Rt Mux 0 1 Rt Rd PCWr=0 ALUSelA=1 Mux 01 RegDst=1 Mux PC MemtoReg=0 Extend ExtOp=x Mux Imm 32 << 2 ALUSelB=01 Mux 1 0 Target 32 Zero PCWrCond=0PCSrc=xBrWr=0 32 IorD=x 1: RegDst, RegWr ALUOp=Rtype ALUselA x: IorD, PCSrc ALUSelB=01 ExtOp Rfinish

361 multicontroller.10 Outline of Today’s Lecture °Recap °Review of FSM control °From Finite State Diagrams to Microprogramming

361 multicontroller.11 Overview °Control may be designed using one of several initial representations. The choice of sequence control, and how logic is represented, can then be determined independently; the control can then be implemented with one of several methods using a structured logic technique. Initial RepresentationFinite State Diagram Microprogram Sequencing ControlExplicit Next State Microprogram counter Function + Dispatch ROMs Logic RepresentationLogic EquationsTruth Tables Implementation TechniquePLAROM “hardwired control”“microprogrammed control”

361 multicontroller.12 Initial Representation: Finite 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

361 multicontroller.13 Sequencing Control: Explicit Next State Function °Next state number is encoded just like datapath controls Opcode State Reg Inputs OutputsOutputs Control Logic Multicycle Datapath

361 multicontroller.14 Logic Representative: Logic Equations °Next state from current state State 0 -> State1 State 1 -> S2, S6, S8, S10 State 2 ->__________ State 3 ->__________ State 4 ->State 0 State 5 -> State 0 State 6 -> State 7 State 7 -> State 0 State 8 -> State 0 State 9-> State 0 State 10 -> State 11 State 11 -> State 0 °Alternatively, prior state & condition S4, S5, S7, S8, S9, S11 -> State0 _________________ -> State 1 _________________ -> State 2 _________________ -> State 3 _________________ -> State 4 State2 & op = sw -> State 5 _________________ -> State 6 State 6 -> State 7 _________________ -> State 8 State2 & op = jmp -> State 9 _________________ -> State 10 State 10 -> State 11

361 multicontroller.15 Implementation Technique: Programmed Logic Arrays °Each output line the logical OR of logical AND of input lines or their complement: AND minterms specified in top AND plane, OR sums specified in bottom OR plane Op5 Op4 Op3 Op2 Op1 Op0 S3 S2 S1 S0 NS3 NS2 NS1 NS0 R = beq = lw = sw = ori = jmp = = = = = = = = = = = = = 0101

361 multicontroller.16 Implementation Technique: Programmed Logic Arrays °Each output line the logical OR of logical AND of input lines or their complement: AND minterms specified in top AND plane, OR sums specified in bottom OR plane Op5 Op4 Op3 Op2 Op1 Op0 S3 S2 S1 S0 NS3 NS2 NS1 NS0 lw = sw = R = ori = beq = jmp = = = = = = = = = = = = = 1011

361 multicontroller.17 Multicycle Control °Given numbers of FSM, can turn determine next state as function of inputs, including current state °Turn these into Boolean equations for each bit of the next state lines °Can implement easily using PLA °What if many more states, many more conditions? °What if need to add a state?

361 multicontroller.18 °Before Explicit Next State: Next try variation 1 step from right hand side °Few sequential states in small FSM: suppose added floating point? °Still need to go to non-sequential states: e.g., state 1 => 2, 6, 8, 10 Initial RepresentationFinite State Diagram Microprogram Sequencing ControlExplicit Next State Microprogram counter Function + Dispatch ROMs Logic RepresentationLogic EquationsTruth Tables Implementation TechniquePLAROM Next Iteration: Using Sequencer for Next State “hardwired control”“microprogrammed control”

361 multicontroller.19 Sequencer-based control unit Opcode State Reg Inputs Outputs Control Logic Multicycle Datapath 1 Address Select Logic Adder Types of “branching” Set state to 0 Dispatch (state 1 & 2) Use incremented state number

361 multicontroller.20 Sequencer-based control unit details Opcode State Reg Inputs Control Logic 1 Address Select Logic Adder Dispatch ROM 1 OpNameState Rtype jmp beq ori lw sw0010 Dispatch ROM 2 OpNameState lw sw0101 ROM2ROM1 Mux

361 multicontroller.21 Implementing Control with a ROM °Instead of a PLA, use a ROM with one word per state (“Control word”) State number Control Word Bits 18-2 Control Word Bits …11 11…00

361 multicontroller.22 Initial RepresentationFinite State Diagram Microprogram Sequencing ControlExplicit Next State Microprogram counter Function + Dispatch ROMs Logic RepresentationLogic EquationsTruth Tables Implementation TechniquePLAROM °ROM can be thought of as a sequence of control words °Control word can be thought of as instruction: “microinstruction” °Rather than program in binary, use assembly language Next Iteration: Using Microprogram for Representation “hardwired control”“microprogrammed control”

361 multicontroller.23 Microprogramming °Control is the hard part of processor design ° Datapath is fairly regular and well-organized ° Memory is highly regular ° Control is irregular and global Microprogramming: -- A Particular Strategy for Implementing the Control Unit of a processor by "programming" at the level of register transfer operations Microarchitecture: -- Logical structure and functional capabilities of the hardware as seen by the microprogrammer

361 multicontroller.24 Macroinstruction Interpretation Main Memory execution unit control memory CPU ADD SUB AND DATA User program plus Data this can change! AND microsequence e.g., Fetch Calc Operand Addr Fetch Operand(s) Calculate Save Answer(s) one of these is mapped into one of these

361 multicontroller.25 Microprogramming Pros and Cons °Ease of design °Flexibility Easy to adapt to changes in organization, timing, technology Can make changes late in design cycle, or even in the field °Can implement very powerful instruction sets (just more control memory) °Generality Can implement multiple instruction sets on same machine. Can tailor instruction set to application. °Compatibility Many organizations, same instruction set °Costly to implement °Slow

361 multicontroller.26 Summary: Multicycle Control °Microprogramming and hardwired control have many similarities, perhaps biggest difference is initial representation and ease of change of implementation, with ROM generally being easier than PLA Initial RepresentationFinite State Diagram Microprogram Sequencing ControlExplicit Next State Microprogram counter Function + Dispatch ROMs Logic RepresentationLogic EquationsTruth Tables Implementation TechniquePLAROM “hardwired control”“microprogrammed control”