COMP303 Computer Architecture Lecture 9. Single Cycle Control

Similar documents
COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control

MIPS-Lite Single-Cycle Control

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2)

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

How to design a controller to produce signals to control the datapath

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering

Lecture #17: CPU Design II Control

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

UC Berkeley CS61C : Machine Structures

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

CS152 Computer Architecture and Engineering Lecture 10: Designing a Single Cycle Control. Recap: The MIPS Instruction Formats

UC Berkeley CS61C : Machine Structures

Recap: The MIPS Subset ADD and subtract EEL Computer Architecture shamt funct add rd, rs, rt Single-Cycle Control Logic sub rd, rs, rt

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

CPU Organization (Design)

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

CS61C : Machine Structures

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

Single Cycle CPU Design. Mehran Rezaei

CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

Designing a Multicycle Processor

CPU Design Steps. EECC550 - Shaaban

Working on the Pipeline

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

Major CPU Design Steps

CS 61C: Great Ideas in Computer Architecture Control and Pipelining

Ch 5: Designing a Single Cycle Datapath

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

Lecture 6 Datapath and Controller

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 19 CPU Design: The Single-Cycle II & Control !

The Processor: Datapath & Control

361 multipath..1. EECS 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor

CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1

CS 152 Computer Architecture and Engineering. Lecture 10: Designing a Multicycle Processor

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

UC Berkeley CS61C : Machine Structures

CENG 3420 Lecture 06: Datapath

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor

Instructor: Randy H. Katz hcp://inst.eecs.berkeley.edu/~cs61c/fa13. Fall Lecture #18. Warehouse Scale Computer

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture Lecture 12: Single- Cycle CPU, Datapath & Control Part 2

Chapter 4. The Processor. Computer Architecture and IC Design Lab

ECE 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Midterm I March 3, 1999 CS152 Computer Architecture and Engineering

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

CS152 Computer Architecture and Engineering. Lecture 8 Multicycle Design and Microcode John Lazzaro (

ECE468. Computer Organization and Architecture. Designing a Multiple Cycle Processor

CS3350B Computer Architecture Quiz 3 March 15, 2018

ECE 361 Computer Architecture Lecture 11: Designing a Multiple Cycle Controller. Review of a Multiple Cycle Implementation

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

ECE4680. Computer Organization and Architecture. Designing a Multiple Cycle Processor

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

add rd, rs, rt Review: A Single Cycle Datapath We have everything Lecture Recap: Meaning of the Control Signals

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath Control Part 1

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Processor (I) - datapath & control. Hwansoo Han

Review: Abstract Implementation View

CS 110 Computer Architecture Review Midterm II

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

Systems Architecture

CPE 335 Computer Organization. Basic MIPS Architecture Part I

ECE4680. Computer Organization and Architecture. Designing a Multiple Cycle Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition. Chapter 4. The Processor

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

CpE 442. Designing a Multiple Cycle Controller

CPSC614: Computer Architecture

ECE232: Hardware Organization and Design

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

LECTURE 5. Single-Cycle Datapath and Control

Chapter 4. The Processor

CS61c Final Review Fall Andy Carle 12/12/2004

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

RISC Design: Multi-Cycle Implementation

CSE 141 Computer Architecture Summer Session I, Lecture 3 Performance and Single Cycle CPU Part 1. Pramod V. Argade

Midterm I March 1, 2001 CS152 Computer Architecture and Engineering

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single Cycle MIPS CPU

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

Laboratory 5 Processor Datapath

Systems Architecture I

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2. Clk

The overall datapath for RT, lw,sw beq instrucution

Computer Science 141 Computing Hardware

ECS 154B Computer Architecture II Spring 2009

Transcription:

COMP33 Computer Architecture Lecture 9 Single Cycle Control

A Single Cycle Datapath We have everything except control signals (underlined) RegDst busw Today s lecture will look at how to generate the control signals RegWr Rd imm6 5 5 Rs 5 Rw Ra Rb -bit Registers 6 busb Sign Extender npc_sel busa Src Instruction Fetch Unit ctr Data In Equal Instruction<3:> <2:25> WrEn Rs <6:2> MemWr Adr Data Rd MemRd <:5> <:5> Imm6 MemtoReg

RTL: R-Type Instructions 3 26 2 6 6 op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits Example: add rd, rs, rt Mem[PC] Fetch the instruction from memory R[rd] R[rs] + R[rt] The actual operation PC PC + 4 Calculate the next instruction s address

Instruction Fetch Unit at the Beginning of Add Fetch the instruction from Instruction memory: Instruction mem[pc] Done for all instructions => Don t need special control bits npc_sel Inst Instruction<3:> Adr 4 imm6 PC Ext Adder Adder PC

The Single Cycle Datapath during Add R[rd] R[rs] op R[rt] RegDst = RegWr = busw 3 Rd imm6 5 5 26 Rs 5 Rw Ra Rb -bit Registers 6 busb Sign Extender 2 op rs rt rd shamt funct npc_sel= +4 busa ctr = Add 6 Data In Src = Instruction Fetch Unit Equal Instruction<3:> <2:25> 6 WrEn <6:2> Rs Rd Imm6 MemtoReg = MemWr = Adr Data <:5> MemRd = <:5>

Instruction Fetch Unit at the End of Add PC PC + 4 This is the same for all instructions except Branch and Jump npc_sel = +4 Inst Instruction<3:> 4 Adr imm6 PC Ext Adder Adder PC

The Single Cycle Datapath during Load R[rt] Data {R[rs] + SignExt[imm6]} RegDst = RegWr = busw 3 Rd imm6 5 5 Rs 5 Rw Ra Rb -bit Registers 6 26 busb Sign Extender 2 op rs rt immediate npc_sel= +4 busa 6 ctr = Add Src = Instruction Fetch Unit Data In Equal Instruction<3:> <2:25> WrEn <6:2> Rs Rd Imm6 MemtoReg = MemWr = Adr Data <:5> MemRd = <:5>

The Single Cycle Datapath during Store 3 26 2 6 op rs rt immediate Data {R[rs] + SignExt[imm6]} R[rt] RegDst = x RegWr = busw Rd imm6 5 5 Rs 5 Rw Ra Rb -bit Registers 6 busb Sign Extender npc_sel= +4 busa ctr =Add Data In Src = Instruction Fetch Unit Equal Instruction<3:> <2:25> WrEn <6:2> Rs Rd Imm6 MemtoReg = x MemWr = Adr Data <:5> MemRd = <:5>

The Single Cycle Datapath during Branch if (R[rs] - R[rt] == ) then Equal ; else Equal RegDst = x RegWr = busw 3 Rd imm6 5 5 Rs 5 Rw Ra Rb -bit Registers 6 26 busb Extender 2 op rs rt immediate npc_sel= Br busa 6 ctr = Subtract Src = Instruction Fetch Unit Data In Equal Instruction<3:> <2:25> WrEn Rs <6:2> MemWr = Adr Data Rd <:5> MemRd = <:5> Imm6 MemtoReg = x

Instruction Fetch Unit at the End of Branch 3 26 2 6 op rs rt immediate if (Equal & Branch) then PC = PC + 4 + SignExt[imm6]*4 ; else PC = PC + 4 npc_sel Inst Instruction<3:> 4 Adr Adder PC See book for what the datapath and control looks like for jump instructions. imm6 PC Ext Adder

Control Lines Determined by the opcode Reg Memto Reg Mem Mem Instr. Des Src Reg Wr Rd Wr Branch op op R-type lw sw X X beq X X op op : -> Add, -> Subtract, -> Function field determines op.

Step 4: Given Datapath: RTL -> Control Instruction<3:> Inst Adr <:5> <26:3> Op Fun <2:25> <:5> <:5> <6:2> Rs Rd Imm6 Control npc_sel RegWr RegDst Src ctr MemWr MemRd MemtoReg Equal DATA PATH

Control Bits Instruction opcode op Instruction operation Function field Desired action control LW load word XXXXXX add SW store word XXXXXX add beq branch equal XXXXXX subtract R-type add add R-type subtract subtract R-type AND and R-type OR or R-type set on less than set on less than opcode 6 Main Control func 6 op 2 Control (Local) ctr 3

The Truth Table for the 3 Control Bits op Function filed Operation op op F5 F4 F3 F2 F F X X X X X X X X X X X X X X X X X X X X X X X X X X X X funct<5:> Instruction Operation add subtract and or set-on-less-than

The Logic Equation for ctr<2> op Function filed Operation op op F5 F4 F3 F2 F F X X X X X X X X X X X X X X X X X X X X X X X X X X X X ctr<2> = op + (op & func<>)

The Logic Equation for ctr<> op Function filed Operation op op F5 F4 F3 F2 F F X X X X X X X X X X X X X X X X X X X X X X X X X X X X ctr<> =!op +!func<2>

The Logic Equation for ctr<> op Function filed Operation op op F5 F4 F3 F2 F F X X X X X X X X X X X X X X X X X X X X X X X X X X X X ctr<> = op & (func<3> + func<>)

The Control Block func 6 op 2 Control (Local) ctr 3 ctr<2> = op + (op & func<>) ctr<> =!op +!func<2> ctr<> = op & (func<3> + func<>)

The Truth Table for the Main Control op 6 Main Control RegDst Src : op 2 func 6 Control (Local) ctr 3 opcode R-type lw sw beq RegDst Src MemtoReg RegWrite MemRead MemWrite Branch op (Symbolic) R-type Add x x Add x x Subtract op op

The Truth Table for RegWrite opcode R-type lw sw beq RegWrite RegWrite = R-type + lw =!op<5> &!op<4> &!op<3> &!op<2> &!op<> &!op<> (R-type) + op<5> &!op<4> &!op<3> &!op<2> & op<> & op<> (lw) op<5>.. op<5>.. op<5>.. op<5>.. <> <> <> <> R-type lw sw beq RegWrite

PLA Implementation of the Main Control op<5>.. op<5>.. op<5>.. op<5>.. <> <> <> <> R-type lw sw beq RegWrite Src RegDst MemtoReg MemRead MemWrite Branch op<> op<>

op 6 Instr<3:26> RegDst Putting it All Together: A Single Cycle Processor busw Main Control RegWr Rd imm6 Instr<5:> 5 5 Rs 5 Rw Ra Rb -bit Registers 6 op RegDst Src : busb Sign Extender busa 2 npc_sel Src Instruction Fetch Unit ctr func Instr<5:> 6 Data In Equal Instruction<3:> Control <2:25> WrEn Rs <6:2> MemWr Adr Data Rd MemRd ctr <:5> 3 <:5> Imm6 MemtoReg

An abstract view of the critical path - load instruction Next Address Ideal Instruction Instruction Address PC Rd 5 Instruction Rs 5 5 Rw Ra Rb -bit Registers Imm 6 A B Critical Path (Load Operation) = PC s -to-q + Instruction s Access Time + Register File s Access Time + to Perform a -bit Add + Data Access Time + Setup Time for Register File Write + Clock Skew Data Address Data In Ideal Data Worst case delay for load is much longer than needed for all other instructions, yet this sets the cycle time.