Single Cycle Controller Design

Slides:



Advertisements
Similar presentations
CS152 Lec9.1 CS152 Computer Architecture and Engineering Lecture 9 Designing Single Cycle Control.
Advertisements

EECC550 - Shaaban #1 Lec # 4 Summer Major CPU Design Steps 1Using independent RTN, write the micro- operations required for all target ISA.
361 datapath Computer Architecture Lecture 8: Designing a Single Cycle Datapath.
The Processor: Datapath & Control
CS61C L26 Single Cycle CPU Datapath II (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L20 Single-Cycle CPU Control (1) Beamer, Summer 2007 © UCB Scott Beamer Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
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.
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.
CS 61C L35 Single Cycle CPU Control II (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L34 Single Cycle CPU Control I (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Microprocessor Design
EECC250 - Shaaban #1 lec #22 Winter The Von-Neumann Computer Model Partitioning of the computing engine into components: –Central Processing.
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
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.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
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.
CS61C L27 Single-Cycle CPU Control (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 27 Single-cycle.
CS 61C L16 Datapath (1) A Carle, Summer 2004 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #16 – Datapath Andy.
CS61C L20 Single Cycle Datapath, Control (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
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)
CS61C L27 Single Cycle CPU Control (1) Garcia, Fall 2006 © UCB Wireless High Definition?  Several companies will be working on a “WirelessHD” standard,
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.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Computer Organization CS224 Fall 2012 Lesson 26. Summary of Control Signals addsuborilwswbeqj RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp.
EEM 486: Computer Architecture Designing Single Cycle Control.
Designing a Single Cycle Datapath In this lecture, slides from lectures 3, 8 and 9 from the course Computer Architecture ECE 201 by Professor Mike Schulte.
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
CPE 442 single-cycle datapath.1 Intro. To Computer Architecture CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath.
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 國立清華大學資訊工程學系 黃婷婷教授.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
CS4100: 計算機結構 Designing a Single-Cycle Processor 國立清華大學資訊工程學系 一零零學年度第二學期.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
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.
CS 110 Computer Architecture Lecture 11: Single-Cycle CPU Datapath & Control Instructor: Sören Schwertfeger School of Information.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Designing a Single-Cycle Processor
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
CPU Organization (Design)
Single Cycle CPU Design
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
Instructors: Randy H. Katz David A. Patterson
EEL Computer Architecture Single-Cycle Control Logic
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
The Processor Lecture 3.2: Building a Datapath with Control
COMS 361 Computer Organization
inst.eecs.berkeley.edu/~cs61c-to
CSC3050 – Computer Architecture
Instructors: Randy H. Katz David A. Patterson
The Processor: Datapath & Control.
COMS 361 Computer Organization
What You Will Learn In Next Few Sets of Lectures
Designing a Single-Cycle Processor
Processor: Datapath and Control
Presentation transcript:

Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Processor (CPU) Input Control Memory Datapath Output Today’s Topic: Designing the Control Unit for the Single Cycle Datapath

Steps to Design a Processor 1. Analyze instruction set => datapath requirements Define the instruction set to be implemented Specify the implementation requirements for the datapath Specify the physical implementation 2. Select set of datapath components & establish clock methodology 3. Assemble datapath meeting the requirements 4. Analyze implementation of each instruction to determine setting of control points that effects the register transfer. 5. Assemble the control logic MIPS makes it easier Instructions same size Source registers always in same place Immediates same size, location Operations always on registers/immediates Datapath Design Control Logic Design See Example

Step 4: Determine Control Points of the Data Path General Ideas Where to find the control points? Common Places are: Read / Write Enable Signals for State Elements (Memory, Register File) Select Signals for Multiplexors Enable Signals for Combinational Logic (e.g., SignExtender) Control Signals that Determine ALU Operations Control Signals in Any Data Path Components How to Determine the Setting of the Control Signals Need to Understand the Operations of the Components in Different Control Signal Setting Need to Understand How the Data is Supposed to Flow Through the Data Path for Each Instruction See add data path example

Step 4: Determine Control Points of the Data Path Control Signal for Instruction Fetch Fetch the Instruction from Instruction Memory: Instruction  mem[ PC] For single cycle data paths, there is no control signal for the PC because it is updated every clock. This is true for all instructions

Step 4: Determine Control Points of the Datapath Control Signals for Add Instruction • R[ rd]  R[ rs] + R[ rt] Branch = 0 Jump = 0 RegDst = ? RegDst = 1 ALUctr = add ALUctr = ? ALUctr RegWr = 1 RegWr = ? MemtoReg = 0 MemtoReg = ? MemWr = 0 ExtOP = x ALUSrc = ? ALUSrc = 0

Step 4: Determine Control Points of the Datapath Control Signals for Or Immediate • R[ rt]  R[ rs] or ZeroExt( imm16) Branch = 0 Jump = 0 RegDst = 0 RegDst = ? ALUctr = or ALUctr = ? ALUctr RegWr = 1 RegWr = ? MemtoReg = 0 MemtoReg = ? MemWr = 0 ExtOP = 0 ExtOP = ? ALUSrc = 1 ALUSrc = ?

Step 4: Determine Control Points of the Datapath Control Signals for Load R[ rt]  Data Memory [R[ rs] + SignExt( imm16)] Branch = 0 Jump = 0 RegDst = ? RegDst = 0 ALUctr = ? ALUctr = add ALUctr RegWr = 1 RegWr = ? MemtoReg = ? MemtoReg = 1 MemWr = 0 ExtOP = ? ExtOP = 1 ALUSrc = ? ALUSrc = 1

Step 4: Determine Control Points of the Datapath Control Signals for Store Data Memory [R[rs] + SignExt(imm16) ]  R[rt] Branch = 0 Jump = 0 RegDst = x ALUctr = ? ALUctr = add ALUctr RegWr = 0 MemtoReg = x MemWr = 1 MemWr = ? Mem=R[rt] ExtOP = ? ExtOP = 1 ALUSrc = ? ALUSrc = 1

Instruction Fetch Unit at the End of Instructions Except for Branch and Jump PC  PC + 4 This is the Same for all Instructions Except: Branch and Jump Jump = 0 Branch = 0 Zero = x ExtOP = x

Step 4: Determine Control Points of the Datapath Control Signals for Branch If (R[rs] - R[rt] == 0 ) Then Zero  1 ; else Zero  0 Branch = 1 Jump = 0 RegDst = x ALUctr = ? ALUctr = sub ALUctr Zero See next page RegWr = 0 MemtoReg = x MemWr = 0 ExtOP = x ALUSrc = ? ALUSrc = 0

Instruction Fetch Unit at the End of Branch If ( Zero == 1 ) Then PC = PC + 4 + SignExt( imm16) * 4 ; Else PC = PC + 4 Jump = 0 ExtOP = 1 Branch = 1 Zero = 1

Step 4: Determine Control Points of the Datapath Control Signals for Jump The data path has nothing to do! Make sure control signals are set correctly!

Instruction Fetch Unit at the End of Jump PC  PC_incr< 31: 28> concat target< 25: 0> concat “00” Jump = 1 ExtOP = X Branch = 0 Zero = x

Step 4: Determine Control Points of the Datapath All Required Control Signals for the Given Data Path Instruction<31:0> Instruction Memory PC <31:26> <5:0> <21:25> <16:20> <11:15> < 0 :15> Op Fun Rs Rt Rd Imm16 To data path To control unit Control Unit Branch Jump RegWr RegDst ExtOp ALUSrc ALUctr MemWr MemtoReg Zero DATA PATH

Step 5: Assemble the Control Logic Example: Control signals for a combined data path for add and lw instructions Questions: (1) How to make sure the control signals have correct values for different instructions? Ans: Need a control unit to generate control signals for instructions (2) How does the control unit look like? For single cycle data path, this is just a big decoder! Next Addr Logic Op Code Control Unit PC+4 1 X + add 1 + lw PC RegDst RegWr ExtOP ALUsrc ALUctr MemtoReg Instruction Memory rs R[rs] RA1 Data Memory rt Register File RA2 ALU rd mux WA imm16 1 Wr data R[rt] mux 1 ext mux 1 See Control Unit Design Example

Step 5: Assemble the Control Logic Control Signals for a Full Control Unit Decoder Inputs These signals can easily be expressed as functions of op and func Decoder Outputs See next slide

ALUctr Signals + + ALU0 ALU1 ALU31 Cin Less Cout a0 b0 result0 a1 b1 overflow set Binvert op[1:0] zero a b cin 1 2 3 result + sum Less op[1:0] Binvert cout a b cin cout sum a b cin 1 2 3 result + sum Less op[1:0] Binvert Overflow detection set overflow

The “Truth Table” for the Main Control Decoder Inputs See example next slide Decoder Outputs See Slides 21 to 24

Implementation of the Main Control Unit Example: the RegWrite Control Signal Decoder Inputs Decoder Output RegWrite = R- type + ori + lw = !op<5> & !op<4> & !op<3> & !op<2> & !op<1> & !op<0> (i.e., R- type) + !op<5> & !op<4> & op<3> & op<2> & !op<1> & op<0> (i.e., ori) + op<5> & !op<4> & !op<3> & ! op<2> & op<1> & op<0> (i.e., lw) Key Idea: Any controller output signal can be expressed as a logical sum (i.e., or) of logical products (i.e., and terms)

Step 5: Assemble the Control Logic (Summary) Implementation of the Entire Main Control

The Concept of Local Decoding 6 func With local decoding, Main Control has only 26 = 64 minterms and local control has only 29 = 512 minterms Without local decoding, Main Control has to include func input and will have 26+6 = 4K minterms

Encoding ALUop Address concatenation do not need ALU I-type op For R-type, actual operation is determined by the func field (see text p. 153 for func encoding) Add offset to address for lw and sw Subtract to compare

Truth Table for ALUctr op I-type uses the opcodes but not the func field R-type has only 1 opcode but uses the func field for encoding • ALUop = f (opcode) ; as shown in the previous slide • ALUctr = f (ALUop, func)

Logic Equations for the ALUctr Signals This makes func< 3> a don’t care ALUctr<2>: ALUctr<2> = !ALUop<2> & !ALUop<1> & ALUop<0> + ALUop<2> & !ALUop<1> & !ALUop<0> & !func<2> & func<1> & ! func<0> ALUctr<1>: ALUctr<1> = !ALUop<2> & !ALUop<1> + ALUop<2> & !ALUop<1> & !ALUop<0> & !func< 2> ALUctr<0>: ALUctr<0> = !ALUop<2> & ALUop<1> & !ALUop< 0>+ ALUop<2> & !ALUop<1> & !ALUop<0> & !func<3> & func<2> & !func<1> & func<0>+ ALUop<2> & !ALUop<1> & !ALUop<0> & func<3> & !func< 2> & func< 1> & ! func< 0>

Putting It All Together: A Single Cycle Processor Control Data Path clock clock clock

A Real MIPS Processor

Single Cycle Processor Delay Path Comparisons for Three Instruction Types Clock (T1) 1 Clock Cycle Clock (T2)

Worst Case Timing: Load Instruction Clk to-Q Old Value New Value Instruction Memory Access Time Old Value New Value Delay Through Control Logic Old Value New Value Old Value New Value Old Value New Value RegWr busA busB Address busW Old Value New Value Register File Access Time Old Value New Value Delay through Extender & Mux Old Value New Value ALU Delay Old Value New Value Data Memory Access & MUX Time Old Value New Value

Drawback of the 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 Cycle Time is Much Longer than Needed for all Other Instructions