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

Similar documents
CS61C : Machine Structures

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

UC Berkeley CS61C : Machine Structures

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

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

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

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

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

CS61C : Machine Structures

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

CS61C : Machine Structures

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

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

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

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

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

Lecture #17: CPU Design II Control

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

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

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

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

CS61C : Machine Structures

Ch 5: Designing a Single Cycle Datapath

CPU Organization (Design)

COMP303 Computer Architecture Lecture 9. Single Cycle Control

UC Berkeley CS61C : Machine Structures

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

Working on the Pipeline

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

UC Berkeley CS61C : Machine Structures

CPU Design Steps. EECC550 - Shaaban

MIPS-Lite Single-Cycle Control

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

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

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

If you didn t do as well as you d hoped

Major CPU Design Steps

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

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

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

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

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

Lecture 6 Datapath and Controller

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

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

Single Cycle CPU Design. Mehran Rezaei

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

The Processor: Datapath & Control

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

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

Designing a Multicycle Processor

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

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering

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

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

Processor (I) - datapath & control. Hwansoo Han

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

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

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering

The MIPS Processor Datapath

CS3350B Computer Architecture Winter 2015

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

CPSC614: Computer Architecture

Chapter 4. The Processor

CpE 442. Designing a Multiple Cycle Controller

Lecture 7 Pipelining. Peng Liu.

CENG 3420 Lecture 06: Datapath

Chapter 4. The Processor

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

Midterm I March 1, 2001 CS152 Computer Architecture and Engineering

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

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

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Systems Architecture

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

CS61c Final Review Fall Andy Carle 12/12/2004

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

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

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

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

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

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

Chapter 4. The Processor

ECE232: Hardware Organization and Design

CS Computer Architecture Spring Week 10: Chapter

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

Guerrilla Session 3: MIPS CPU

ECE4680 Computer Organization and Architecture. Designing a Pipeline Processor

CS 110 Computer Architecture Review Midterm II

Laboratory 5 Processor Datapath

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

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

CSE140: Components and Design Techniques for Digital Systems

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 27: Single- Cycle CPU Datapath Design

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

Transcription:

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1 Guest Lecturer: Sagar Karandikar hfp://inst.eecs.berkeley.edu/~cs61c/

http://research.microsoft.com/apps/pubs/default.aspx?id=212001! Technology In the News Microsoft Catapult, ISCA 2014 FPGAs are programmable hardware used by computer architects and digital circuit designers, lie somewhere between CPUs and custom chips (ASICs). Microsoft published a paper at ISCA about using FPGAs in datacenters for page ranking processing for Bing. In a test deployment, MS reported up to 95% more throughput for only 10% more power. The added TCO was less than 30%. Microsoft used Altera Stratix V FPGAs in a PCIe form-factor with 8GB of DDR3 RAM on each board. The FPGAs were connected using a 10Gb SAS network. - AnandTech

Review CPU design involves Datapath, Control 5 Stages for MIPS InstrucTons 1. InstrucTon Fetch 2. InstrucTon Decode & Register Read 3. ALU (Execute) 4. Memory 5. Register Write Datapath Tming: single long clock cycle or one short clock cycle per stage

Datapath and Control Datapath based on data transfers required to perform instructons Controller causes the right transfers to happen PC instruction memory rd rs rt registers ALU Data memory +4 imm opcode, funct == zero Controller

CPU Clocking (1/2) For each instructon, how do we control the flow of informaton though the datapath? Single Cycle CPU: All stages of an instructon completed within one long clock cycle Clock cycle sufficiently long to allow each instructon to complete all stages without interrupton within one cycle 1. Instruction Fetch 2. Decode/ Register Read 3. Execute 4. Memory 5. Reg. Write

CPU Clocking (2/2) AlternaTve multple- cycle CPU: only one stage of instructon per clock cycle Clock is made as long as the slowest stage 1. Instruction Fetch 2. Decode/ Register Read 3. Execute 4. Memory 5. Register Write Several significant advantages over single cycle executon: Unused stages in a partcular instructon can be skipped OR instructons can be pipelined (overlapped)

Agenda Stages of the Datapath Datapath InstrucTon Walkthroughs Datapath Design

Five Components of a Computer Processor Control Datapath Computer Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Disk (where programs, data live when not running) Display, Printer

Processor Design: 5 steps Step 1: Analyze instructon set to determine datapath requirements Meaning of each instructon is given by register transfers Datapath must include storage element for ISA registers Datapath must support each register transfer Step 2: Select set of datapath components & establish clock methodology Step 3: Assemble datapath components that meet the requirements Step 4: Analyze implementaton of each instructon to determine secng of control points that realizes the register transfer Step 5: Assemble the control logic

The MIPS InstrucTon Formats All MIPS instructons are bits long. 3 formats: R- type I- type J- type 31 31 31 op rs rt rd shamt funct 6 bits 5 bits 5 bits 16 bits 26 op 26 target address 6 bits 26 bits The different fields are: op: operaton ( opcode ) of the instructon rs, rt, rd: the source and destnaton register specifiers shamt: shih amount funct: selects the variant of the operaton in the op field address / immediate: address offset or immediate value target address: target address of jump instructon 21 16 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits 26 21 16 op rs rt address/immediate 11 6 0 0 0

The MIPS- lite Subset ADDU and SUBU addu rd,rs,rt! subu rd,rs,rt OR Immediate: ori rt,rs,imm16 LOAD and STORE Word lw rt,rs,imm16! sw rt,rs,imm16 BRANCH: 31 31 31 31 beq rs,rt,imm16 26 21 16 op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits 26 21 op rs rt immediate 6 bits 5 bits 5 bits 16 bits 26 21 op rs rt immediate 6 bits 5 bits 5 bits 16 bits 26 21 op rs rt immediate 6 bits 5 bits 5 bits 16 bits 16 16 16 11 6 0 0 0 0

Register Transfer Level (RTL) Colloquially called Register Transfer Language RTL gives the meaning of the instructons All start by fetching the instructon itself {op, rs, rt, rd, shamt, funct} MEM[ PC ]! {op, rs, rt, Imm16} MEM[ PC ]! Inst Register Transfers! ADDU R[rd] R[rs] + R[rt]; PC PC + 4! SUBU R[rd] R[rs] R[rt]; PC PC + 4! ORI R[rt] R[rs] zero_ext(imm16); PC PC + 4! LOAD R[rt] MEM[ R[rs] + sign_ext(imm16)]; PC PC + 4! STORE MEM[ R[rs] + sign_ext(imm16) ] R[rt]; PC PC + 4! BEQ if ( R[rs] == R[rt] ) PC PC + 4 + {sign_ext(imm16), 2 b00}! else PC PC + 4!

Step 1: Requirements of the InstrucTon Set Memory (MEM) InstrucTons & data (will use one for each) Registers (R:, - bit wide registers) Read RS Read RT Write RT or RD Program Counter (PC) Extender (sign/zero extend) Add/Sub/OR/etc unit for operaton on register(s) or extended immediate (ALU) Add 4 (+ maybe extended immediate) to PC Compare registers?

A B Step 2: Components of the Datapath CombinaTonal Elements Storage Elements + Clocking Methodology Building Blocks Adder CarryIn Select A Sum CarryOut B MUX Adder MulTplexer A Y B OP ALU ALU Result

ALU Needs for MIPS- lite + Rest of MIPS AddiTon, subtracton, logical OR, ==: ADDU! R[rd] = R[rs] + R[rt];...! SUBU! R[rd] = R[rs] R[rt];...!! ORI! R[rt] = R[rs] zero_ext(imm16)...! BEQ! if ( R[rs] == R[rt] )... Test to see if output == 0 for any ALU operaton gives == test. How? P&H also adds AND, Set Less Than (1 if A < B, 0 otherwise) ALU follows Chapter 5

Storage Element: Idealized Memory Write Enable Address Magic Memory Data In One input bus: Data In One output bus: Data Out Clk Memory word is found by: For Read: Address selects the word to put on Data Out For Write: Set Write Enable = 1: address selects the memory word to be wrifen via the Data In bus Clock input (CLK) CLK input is a factor ONLY during write operaton During read operaton, behaves as a combinatonal logic block: Address valid Data Out valid aher access Tme DataOut

Storage Element: Register (Building Block) Similar to D Flip Flop except N- bit input and output Write Enable input Write Enable: Data In Negated (or deasserted) (0): Data Out will not change Asserted (1): Data Out will become Data In on positve edge of clock N Write Enable clk Data Out N

Storage Element: Register File Register File consists of registers: Two - bit output busses: busa and busb One - bit input bus: busw Register is selected by: Write Enable busw RA (number) selects the register to put on busa (data) RB (number) selects the register to put on busb (data) RW (number) selects the register to be wrifen via busw (data) when Write Enable is 1 Clock input (clk) Clk input is a factor ONLY during write operaton During read operaton, behaves as a combinatonal logic block: RA or RB valid busa or busb valid aher access Tme. Clk RW RA RB 5 5 5 x - bit Registers busa busb

Administrivia No classes on Tuesday If you have discussion on Tuesday, go to a M/W discussion. Project 3-1 out Sunday Free to choose new partners, but not forced Start early! Heads Up: No Lab Thanksgiving Week

Step 3a: InstrucTon Fetch Unit Register Transfer Requirements Datapath Assembly InstrucTon Fetch Read Operands and Execute OperaTon Common RTL operatons Fetch the InstrucTon: mem[pc] Update the program counter: SequenTal Code: PC PC + 4 Branch and Jump: PC something else clk PC Address InstrucTon Memory Next Address Logic InstrucTon Word

Step 3b: Add & Subtract R[rd] = R[rs] op R[rt] (addu rd,rs,rt)! Ra, Rb, and Rw come from instructon s Rs, Rt, and Rd fields 31 26 21 16 11 6 0 op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits ALUctr and RegWr: control logic aher decoding the instructon busw Rd Rs Rt RegWr 5 5 5 clk Rw Ra Rb x - bit Registers busa busb Already defined the register file & ALU ALUctr ALU Result

Clocking Methodology Clk............ Storage elements clocked by same edge Flip- flops (FFs) and combinatonal logic have some delays Gates: delay from input change to output change Signals at FF D input must be stable before actve clock edge to allow signal to travel within the FF (set- up Tme), and we have the usual clock- to- Q delay CriTcal path (longest path through logic) determines length of clock period

Register- Register Timing: One Complete Cycle Clk PC Old Value Rs, Rt, Rd, Op, Func ALUctr New Value Old Value Old Value InstrucTon Memory Access Time New Value Delay through Control Logic New Value RegWr Old Value New Value Register File Access Time busa, B Old Value New Value ALU Delay busw Old Value New Value RegWr Rd Rs Rt ALUctr 5 5 5 Register Write Rw Ra Rb busa busw Occurs Here RegFile busb clk ALU

Pucng it All Together:A Single Cycle Datapath 4 PC Ext imm16 Adder Adder npc_sel Mux Inst Memory 00 PC clk Adr Rs RegDst Rd RegWr busw 1 clk <21:25> imm16 Rt 0 <16:20> Rt Rs 5 5 Rw Ra Rb RegFile 16 Rd Rt 5 <11:15> Extender busa busb ExtOp <0:15> Imm16 Equal Instruction<31:0> 0 1 ALUSrc ALUctr MemtoReg MemWr = ALU Data In clk WrEn Adr Data Memory 0 1

Peer InstrucTon A. Our ALU is a synchronous device B. We should use the main ALU to compute PC = PC + 4 C. The ALU is inactve for memory reads or writes. Op-on 1 2 3 A F F F A T T T B F T F C F T T C T F F D T F T E T T F E F F T

Processor Design: 3 of 5 steps Step 1: Analyze instructon set to determine datapath requirements Meaning of each instructon is given by register transfers Datapath must include storage element for ISA registers Datapath must support each register transfer Step 2: Select set of datapath components & establish clock methodology Step 3: Assemble datapath components that meet the requirements Step 4: Analyze implementaton of each instructon to determine secng of control points that realizes the register transfer Step 5: Assemble the control logic