Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.

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.
CS152 / Kubiatowicz Lec8.1 9/26/01©UCB Fall 2001 CS152 Computer Architecture and Engineering Lecture 8 Designing Single Cycle Control September 26, 2001.
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.
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.
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.
Single Cycle Controller Design
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:

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

Savio Chau Steps to Design a Processor 5 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 Cpntrol Logic Design See Example

Savio Chau 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) –Enable Signals for Combinational Logic (e.g., SignExtender) –Control Signals that Determine ALU Operations –Select Signals for Multiplexors –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

Savio Chau 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

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

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

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

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

Savio Chau 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 ExtOP = x Branch = 0Zero = x Jump = 0

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

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

Savio Chau 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!

Savio Chau Instruction Fetch Unit at the End of Jump PC  PC_incr concat target concat “00” ExtOP = X Branch = 0Zero = x Jump = 1

Savio Chau Step 4: Determine Control Points of the Datapath All Required Control Signals for the Given Data Path ALUctrRegDstALUSrcExtOpMemtoRegMemWr Zero Instruction Imm16RdRsRt Jump Adr Instruction Memory DATA PATH Control Op Fun RegWrBranch

Savio Chau Step 5: Assemble the Control Logic 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 PC Instruction Memory RA1 RA2 WA Wr data ALU Next Addr Logic PC+4 rs rd imm16 R[rs] Data Memory Register File rt mux ext R[rt] RegWr ALUctr ExtOP RegDst ALUsrc MemtoReg Example: Control signals for a combined data path for add and lw instructions See Control Unit Design Example 1X00+1add lw Op Code Control Unit (2)How does the control unit look like? For single cycle data path, this is just a big decoder!

Savio Chau Step 5: Assemble the Control Logic Control Signals for a Full Control Unit These signals can easily be expressed as functions of the opcodes See following discussions

Savio Chau The Concept of Local Decoding Without local decoding, Main Control has to include func input and will have = 4K minterms func 6 With local decoding, Main Control has only 2 6 = 64 minterms and local control has only 2 9 = 512 minterms See next slide

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

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

Savio Chau ALUctr Signals a b c in result sum Less op[1:0]Binvert c out C in ALU 0 Less C out a0a0 b0b0 result 0 C in ALU 1 Less C out a1a1 b1b1 result 1 C in ALU 31 Less a 31 b 31 result 31 overflow set Binvert op[1:0] zero 0 0 a b c in c out sum a b c in result sum Less op[1:0] Binvert Overflow detection set overflow

Savio Chau Logic Equations for the ALUctr Signals ALUctr : ALUctr = !ALUop & !ALUop & ALUop + ALUop & !ALUop & !ALUop & !func & func & ! func This makes func a don’t care ALUctr = !ALUop & !ALUop + ALUop & !ALUop & !ALUop & !func ALUctr : ALUctr = !ALUop & ALUop & !ALUop + ALUop & !ALUop & !ALUop & !func & func & !func & func + ALUop & !ALUop & !ALUop & func & !func & func & ! func ALUctr :

Savio Chau The “Truth Table” for the Main Control See last 4 slides

Savio Chau Implementation of the Main Control Unit Example: the RegWrite Control Signal RegWrite= R- type + ori + lw = !op & !op & !op & !op & !op & !op (i.e., R- type) + !op & !op & op & op & !op & op (i.e., ori) + op & !op & !op & ! op & op & op (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)

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

Savio Chau Putting It All Together: A Single Cycle Processor clock

Savio Chau A Real MIPS Data Path

Savio Chau Single Cycle Processor Delay Path Comparisons for Three Instruction Types Clock (T 1 ) Clock (T 2 ) 1 Clock Cycle

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

Savio Chau 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