1 Chapter 5: Datapath and Control (Part 3) CS 447 Jason Bakos.

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

Multicycle Datapath & Control Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers We will be reusing functional units –ALU used to compute address and to increment PC –Memory used for instruction and.
1 Chapter Five The Processor: Datapath and Control.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
EECE476 Lecture 9: Multi-cycle CPU Datapath Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders.
331 W9.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 9 Building a Single-Cycle Datapath [Adapted from Dave Patterson’s.
1 COMP541 Sequencing – III (Sequencing a Computer) Montek Singh April 9, 2007.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
©UCB CS 161Computer Architecture Chapter 5 Lecture 11 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Lecture 16: Basic CPU Design
Shift Instructions (1/4)
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
1 Chapter 5: Datapath and Control CS 447 Jason Bakos.
CPU Architecture Why not single cycle? Why not single cycle? Hardware complexity Hardware complexity Why not pipelined? Why not pipelined? Time constraints.
1 The Processor: Datapath and Control We will design a microprocessor that includes a subset of the MIPS instruction set: –Memory access: load/store word.
Multiple cycle implementation Each instruction takes more than one clock cycles to execution Q: How to break an instruction? Break each instruction into.
The Multicycle Processor CPSC 321 Andreas Klappenecker.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
Lecture 24: CPU Design Today’s topic –Multi-Cycle ALU –Introduction to Pipelining 1.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
2/8/02CSE MultiCycle From One Cycle to Many Note: Some of the material in this lecture are COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Chapter 4 CSF 2009 The processor: Building the datapath.
Lecture 8: Processors, Introduction EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
COMP541 Multicycle MIPS Montek Singh Apr 8, 2015.
EE204 L12-Single Cycle DP PerformanceHina Anwar Khan EE204 Computer Architecture Single Cycle Data path Performance.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
1 Chapter 5: Datapath and Control (Part 2) CS 447 Jason Bakos.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Systems Architecture I
Morgan Kaufmann Publishers The Processor
Multiple Cycle Implementation of MIPS-Lite CPU
CSCE 212 Chapter 5 The Processor: Datapath and Control
Computer Architecture
CS/COE0447 Computer Organization & Assembly Language
Chapter Five The Processor: Datapath and Control
Systems Architecture I
Vishwani D. Agrawal James J. Danaher Professor
Multicycle Approach We will be reusing functional units
Processor: Multi-Cycle Datapath & Control
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Chapter Four The Processor: Datapath and Control
5.5 A Multicycle Implementation
Systems Architecture I
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

1 Chapter 5: Datapath and Control (Part 3) CS 447 Jason Bakos

2 Single-Cycle CPU CPI of the single cycle CPU from the last lecture had a CPI of 1 –Clock cycle is determined by the longest possible path in the machine loads are the worst – they use 5 functional units in series –Performance, utilization, and efficiency are not going to be good, because most instructions don’t need such a long clock cycle –A variable-speed clock could be used to solve this problem, but hinders parallelism Pipelining overlaps instruction executions

3 Multicycle Implementation Break instructions into steps, where each step requires one clock cycle We want to reuse functional units within an instruction instead of just across instructions –Reduces hardware Use single memory for instructions and data Single ALU instead of one ALU and two adders Add registers to functional units to hold intermediate results (state data) for future cycles –Use within instruction executions Register file and memory hold state data to be used across instruction executions –These are programmer-visible We will need a FSM to control CPU

4 Registers Locations of registers is determined by the following: –What combinatorial units will fit in one clock cycles Assume memory access, regfile access (two reads or one write), or ALU operation Any data needed by these operations must be stored in a temporary register –Instruction Register, Memory Data Register, A, B, and ALUOut registers added to design –All these except IR only need to hold data between two adjacent clock cycles –What data are needed in later cycles implementing the instruction

5 Multiplexors Need to add extra multiplexors (or expand existing muxes) to facilitate the reuse of the ALU within instructions –Add mux to first ALU input –Expand mux to second ALU input

6 Multicycle CPU

7 Breaking Instruction Execution into Clock Cycles Goal is to balance the latency of the operations performed during each clock cycle –At most one of the following can occur in series: One ALU operation One register file access (or multiple in parallel) One memory access (this is a joke, but we’ll accept this for now)

8 Execution Stages In order to clearly define the CPU operation for each step in the operation, we’ll use RTL (register transfer language) Architecture research has defined 5 standard phases of instruction execution –Instruction fetch –Decode Fetch register values from register file –Execute Perform arithmetic/logic operation –Memory Load/Store memory –Write back Write register result back to register file

9 Execution Stages Fetch –IR=Memory[PC] –PC=PC+4 Decode –A=Reg[IR[25..21]] –B=Reg[IR[20..16]] –ALUOut=PC+(sign_extend(IR[15..0]) << 2

10 Execution Stages Execute –Memory access ALUOut=A+sign_extend(IR[15..0]) –R-type ALUOut=A op B –Branch (beq) if (A==B) PC=ALUOut –PC=PC[31..28] || (IR[25..0]<<2)

11 Execution Stages Memory Access/Write Back –Load MDR=Memory[ALUOut] –Store Memory[ALUOut]=B –R-type Reg[IR[15..11]]=ALUOut Memory Read Completion –Load Reg[IR[20..16]]=MDR

12 Control Signals Control Unit signals –Refer to figure 5.34 (pg. 384) in the book ALU Control signals –Provide an appropriate ALUOp signal based on what the ALU is being used for (if for an R-type, perform lookup based on function code)

13 Control Signals All that’s left is for us to build the control unit as a FSM and the ALU control as a lookup table

14 Control Unit The fetch and decode stages are the same for every instruction...

15 Control Unit Here’s the states and transitions for the memory-reference instructions

16 Control Unit Here’s the states and transitions for R-type, branch, and jump instructions

17 Control Unit Final control unit FSM...

18 Problems to Think About How could we add bne, blt, and bgez instructions to our CPU? Do do you calculate CPI for our CPU if we are given instruction-type distributions?