Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.

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

331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
331 W9.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 9 Building a Single-Cycle Datapath [Adapted from Dave Patterson’s.
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.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
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.
CSE331 W09.1Irwin Fall 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 9 Section 1: Mary Jane Irwin (
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
The CPU Processor (CPU): the active part of the computer, which does all the work (data manipulation and decision-making) Datapath: portion of the processor.
Processor: Datapath and Control
Computer Architecture Chapter 5 Fall 2005 Department of Computer Science Kent State University.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
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.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
1. Building A CPU  We’ve built a small ALU l Add, Subtract, SLT, And, Or l Could figure out Multiply and Divide  What about the rest l How do.
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.
CSE331 W10.1Irwin&Li Fall 2006 PSU CSE 331 Computer Organization and Design Fall 2006 Week 10 Section 1: Mary Jane Irwin (
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.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
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.
CS.305 Computer Architecture The Processor: Datapath and Control Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
Design a MIPS Processor
COM181 Computer Hardware Lecture 6: The MIPs CPU.
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
Access the Instruction from Memory
CS Computer Architecture Week 10: Single Cycle Implementation
CS 230: Computer Organization and Assembly Language
Single-Cycle Datapath and Control
Computer Architecture
Single Cycle Processor
Basic MIPS Architecture
Design of the Control Unit for Single-Cycle Instruction Execution
MIPS processor continued
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
Topic 5: Processor Architecture Implementation Methodology
Composing the Elements
Composing the Elements
The Processor Lecture 3.3: Single-cycle Implementation
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
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:

Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data

Executing Load and Store Operations  Load and store operations compute a memory address by adding the base register (in rs ) to the 16-bit signed offset field in the instruction  The 32 bits in the base register were read from the Register File during decode  The offset value in the low order 16 bits of the instruction must be sign extended to create a 32-bit signed value I-Type: oprsrt address offset

Data Memory Address Write Data Read Data MemWrite MemRead 1632 Sign Extend 16-bit offset RegWrite Read Addr 1 zero ALU overflow Write Data Instruction Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU control  sw - value read from the Register File during decode must be written to the Data Memory  lw - value read from the Data Memory must be stored in the Register File Executing Load and Store Operations

Executing Branch Operations  Branch operations have to compare the operands read from the Register File during decode ( rs and rt values) for equality ( zero ALU output is asserted)  compute the branch target address by adding the updated PC to the sign extended 16-bit signed offset field in the instruction  offset value in the low order 16 bits of the instruction must be sign extended to create a 32-bit signed value and then shifted left 2 bits to turn it into a word address I-Type: oprsrt address offset

Executing Branch Operations RegWrite Read Addr 1 zero ALU overflow Write Data Instruction Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU control (to branch control logic -take branch if zero line is high) Add Branch target address Shift left 2 Add 4 PC PC + 4 (perform a subtraction) bit offset Sign Extend

Executing Jump Operations  Jump operations have to replace the lower 28 bits of the PC+4 with the lower 26 bits of the fetched instruction shifted left by 2 bits Read Address Instruction Memory Add PC Shift left 2 28 Jump address J-Type: op jump target address

Creating a Single Datapath from the Parts  We need to assemble the datapath segments, add control lines as needed, and design the control path  Fetch, decode and execute each instruction in one clock cycle – single cycle design. Cycle time is determined by length of the longest path  No datapath resource can be used more than once per instruction, so some must be duplicated (that is why we have a separate Instruction Memory and Data Memory)  To share datapath elements between different instruction classes will need multiplexors at the input of the shared elements  Need control lines to do the selection of inputs

Fetch, R, and Memory Access Portions Read Address Instruction Memory Add PC 4 RegWrite ovf zero ALU control ALU Data Memory Address Write Data Read Data MemWrite MemRead lw RR Sign Extend 1632 lw / sw Register File Write Data Read Addr 1 Read Addr 2 Write Addr Read Data 1 Read Data 2

Multiplexor Insertion MemtoReg Read Address Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU ovf zero ALU controlRegWrite Data Memory Address Write Data Read Data MemWrite MemRead Sign Extend 1632 ALUSrc

Adding the Branch Portion Add 4 Shift left 2 Add Read Address Instruction Memory PC Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU ovf zero ALU controlRegWrite Data Memory Address Write Data Read Data MemWrite MemRead Sign Extend 1632 MemtoReg ALUSrc R lw / sw R lw PCSrc Branch not taken, R, lw /sw

 We wait for everything to settle down - ALU might not produce “right answer” right away  Cycle time determined by length of the longest path  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions: lw, sw, add, sub, and, or, slt, beq.  Sequential components (PC, RegFile, Memory) are edge triggered - state elements are written on every clock cycle; if not, need explicit write control signal  write occurs only when both the write control is asserted and the clock edge occurs Datapath - review

Single cycle datapath  Observations - op field always in bits  address of the two registers to be read are always specified by the rs and rt fields (bits and 20-16)  address of register to be written is in one of two places – in rt (bits 20-16) for lw ; in rd (bits 15-11) for R - type instructions  base register for lw and sw always in rs (bits 25-21)  offset for beq, lw, and sw always in bits 15-0 I-Type: oprsrt address offset R-type: oprsrtrdfunctshamt 10

(Almost) Complete Single Cycle Datapath Read Address Instr[31-0] Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr ALU ovf zero Data Memory Address Write Data Read Data MemWrite MemRead Register File Read Data 1 Read Data 2 RegWrite Sign Extend 1632 Shift left 2 Add RegDst 0 1 ALUSrc 0 1 MemtoReg 1 0 PCSrc 1 0 ALU control ALUOp Instr[5-0] Instr[15-0] Instr[25-21] Instr[20-16] Instr[ ]