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

Slides:



Advertisements
Similar presentations
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
Advertisements

1 Today  All HW1 turned in on time, this is great!  HW2 will be out soon —You will work on procedure calls/stack/etc.  Lab1 will be out soon (possibly.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
331 W9.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 9 Building a Single-Cycle Datapath [Adapted from Dave Patterson’s.
Levels in Processor Design
CMPUT Computer Organization and Architecture II1 CMPUT229 - Fall 2003 TopicE: Building a Data Path and a Control Path for a Microprocessor José Nelson.
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
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.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicH: Building a Data Path and a Control Path for a Microprocessor José Nelson.
Chapter Five The Processor: Datapath and Control.
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
The Datapath Andreas Klappenecker CPSC321 Computer Architecture.
1 Chapter 5: Datapath and Control CS 447 Jason Bakos.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
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.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.
December 26, 2015©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
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.
February 22, 2016©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
MIPS processor continued
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
MIPS Processor.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Single-cycle CPU Control
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
Single-Cycle Datapath and Control
Computer Architecture
IT 251 Computer Organization and Architecture
Multi-Cycle CPU.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
MIPS processor continued
CSCI206 - Computer Organization & Programming
Single-Cycle CPU DataPath.
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
Systems Architecture II
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
MIPS processor continued
Control Unit (single cycle implementation)
The Processor: Datapath & Control.
COMS 361 Computer Organization
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

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

2 Building a Datapath Which components do we need for the A/L, load, and branch classes of MIPS instructions? –First, we need a memory to hold our instructions Assume it has an address input, data output, and a MemRead and MemWrite control signals –A Program Counter (PC) register to hold the address of the next instruction Typical register (clk, en, rst, D, and Q) –ALU (the one we built in Chap. 4) A, B, ALUOp, and Out –Register file Dual-port (ReadAddr1, ReadAddr2, WriteReg, WriteData, RegWrite, ReadData1, ReadData2) –Instruction Register Like the PC, but holds the current instruction word

3 Building a Datapath

4 Datapaths Assuming our instruction is already fetched, using our components we need to build datapaths for the following: –PC=PC+4 –Executing A/L R-type instruction and writing back result –Executing load/store effective address calculation We need a sign extender for this –Computing a branch target address and determining whether or not a branch should be taken (for beq) We need a sign extender and a 2-bit shifter for this

5 Datapaths PC+4 datapathR-type A/L datapath

6 Datapaths Load/Store Datapath

7 Datapaths Branch (beq) Datapath

8 Simple CPU Implementation We want to implement the simplest possible implementation of our MIPS subset of instructions –lw/sw –beq –add, sub, and, or, and slt

9 Combining Datapaths Let’s combine the datapaths that we looked at into a single datapath Let’s assume that we want to execute all our instructions in a single clock cycle –This means that we can only use each datapath component once per instruction We need a separate instruction and data memory We may need to duplicate some components (but we can share components across different instruction types) We need multiplexors for this

10 Integrated Datapaths Here we combine all our datapaths We also add our fetch hardware Next we’ll need a control unit to assert the control signals

11 Control Signals Recall the ALU control table… Let’s create a small control “lookup table” for the ALU... ALU OperationFunction 000and 001or 010add 110subtract 111set on less than

12 Control Signals InstructionALUOpFuncFieldDesired ALU Action ALU Control Input LW00XXXXXXadd010 SW00XXXXXXadd010 BEQ01XXXXXXsubtract110 R-type (add) add010 R-type (sub) subtract110 R-type (and) and000 R-type (or) or001 R-type (slt) slt111 Note that ALUOp will come from the main control unit

13 Designing the Main Control Unit First, let’s take a look at all our current control signals and their effect... Signal Name Effect when deasserted Effect when asserted RegDst Register destination comes from rt field (20-16) Register destination comes from the rd field (15-11) RegWrite NoneA register is written to ALUSrc The second ALU operand comes from register file (2) The second ALU operand is the sign-extended register immediate PCSrc The PC is replaced by the output of the adder (PC+4) The PC is replaced by the adder that computes branch target MemRead NoneData memory read MemWrite NoneData memory written MemtoReg The value fed to the register file comes from the ALU The value fed to the register file comes from data memory

14 CPU with Control Unit

15 R-type Control For an R-type instruction, let’s decide what needs to be done (note this is done in parallel) –Fetch instruction and increment PC by 4 –Read two registers –ALU does computation –Result is written back to register file

16 Load/Store Control Let’s decide what needs to be done for a lw instruction –Fetch/increment PC –Read base register from reg. file –ALU computes effective address (base+offset) –Data from memory is written back to register file

17 Branch-on-Equal Control Finally, let’s decide what needs to be done in order to perform the beq instruction –Fetch/increment PC –Read two registers –ALU subtracts –ALU computes effective branch target (PC+offset*4) –Zero result from ALU decides if we should write the new value to the PC

18 Control Signals InstructionRegDstALUSrcMemto Reg RegWriteMem Read Mem Write BranchALU Op1 ALU Op2 R-type lw swX1X beqX0X000101

19 Control Next time we’ll find out why a single- cycle CPU like this is not practical –We need a FSM to handle control in order to reuse components during a single instruction execution