Instructor: Justin Hsia 7/23/2012Summer 2012 -- Lecture #201 CS 61C: Great Ideas in Computer Architecture MIPS CPU Datapath, Control Introduction.

Slides:



Advertisements
Similar presentations
Instructor: Justin Hsia
Advertisements

CS152 Lec9.1 CS152 Computer Architecture and Engineering Lecture 9 Designing Single Cycle Control.
361 datapath Computer Architecture Lecture 8: Designing a Single Cycle Datapath.
CS61C L19 CPU Design : Designing a Single-Cycle CPU (1) Beamer, Summer 2007 © UCB Scott Beamer Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L26 Single Cycle CPU Datapath II (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L20 Single-Cycle CPU Control (1) Beamer, Summer 2007 © UCB Scott Beamer Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2007 © UCB 3.6 TB DVDs? Maybe!  Researchers at Harvard have found a way to use.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Sat Google in Mountain.
CS 61C L34 Single Cycle CPU Control I (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Microprocessor Design
CS61C L25 Single Cycle CPU Datapath (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
CS61C L25 CPU Design : Designing a Single-Cycle CPU (1) Garcia, Fall 2006 © UCB T-Mobile’s Wi-Fi / Cell phone  T-mobile just announced a new phone that.
CS 61C L17 Control (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #17: CPU Design II – Control
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
CS61C L25 CPU Design : Designing a Single-Cycle CPU (1) Garcia, Spring 2007 © UCB Google Summer of Code  Student applications are now open (through );
EEM 486: Computer Architecture Lecture 3 Designing a Single Cycle Datapath.
CS61C L27 Single-Cycle CPU Control (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 27 Single-cycle.
CS 61C L16 Datapath (1) A Carle, Summer 2004 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #16 – Datapath Andy.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single-Cycle CPU Datapath Control Part 1 Guest Lecturer: Sagar Karandikar.
CS61C L20 Single Cycle Datapath, Control (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
361 control Computer Architecture Lecture 9: Designing Single Cycle Control.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures.
CS61CL L09 Single Cycle CPU Design (1) Huddleston, Summer 2009 © UCB Jeremy Huddleston inst.eecs.berkeley.edu/~cs61c CS61CL : Machine Structures Lecture.
ECE 232 L12.Datapath.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 12 Datapath.
ELEN 350 Single Cycle Datapath Adapted from the lecture notes of John Kubiatowicz(UCB) and Hank Walker (TAMU)
CS61C L27 Single Cycle CPU Control (1) Garcia, Fall 2006 © UCB Wireless High Definition?  Several companies will be working on a “WirelessHD” standard,
Instructor: Sagar Karandikar
CS3350B Computer Architecture Winter 2015 Lecture 5.6: Single-Cycle CPU: Datapath Control (Part 1) Marc Moreno Maza [Adapted.
Instructor: Sagar Karandikar
EEM 486: Computer Architecture Designing Single Cycle Control.
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
Designing a Single Cycle Datapath In this lecture, slides from lectures 3, 8 and 9 from the course Computer Architecture ECE 201 by Professor Mike Schulte.
CS 61C: Great Ideas in Computer Architecture Datapath
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
CPE 442 single-cycle datapath.1 Intro. To Computer Architecture CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath.
W.S Computer System Design Lecture 4 Wannarat Suntiamorntut.
Datapath and Control Unit Design
CS3350B Computer Architecture Winter 2015 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza [Adapted.
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
Csci 136 Computer Architecture II –Single-Cycle Datapath Xiuzhen Cheng
EEM 486: Computer Architecture Lecture 3 Designing Single Cycle Control.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single-Cycle CPU Datapath & Control Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic.
Single Cycle Controller Design
CS 110 Computer Architecture Lecture 11: Single-Cycle CPU Datapath & Control Instructor: Sören Schwertfeger School of Information.
CS 61C: Great Ideas in Computer Architecture MIPS Datapath 1 Instructors: Nicholas Weaver & Vladimir Stojanovic
CPU Design - Datapath. Review Use muxes to select among input S input bits selects 2 S inputs Each input can be n-bits wide, indep of S Can implement.
IT 251 Computer Organization and Architecture
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
CPU Control Lecture 16 CDA
Computer Organization Fall 2017 Chapter 4A: The Processor, Part A
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
Single Cycle CPU Design
Vladimir Stojanovic and Nicholas Weaver
Instructors: Randy H. Katz David A. Patterson
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
Guest Lecturer TA: Shreyas Chand
COMS 361 Computer Organization
inst.eecs.berkeley.edu/~cs61c-to
Computer Architecture Processor: Datapath
Prof. Giancarlo Succi, Ph.D., P.Eng.
Instructors: Randy H. Katz David A. Patterson
COMS 361 Computer Organization
What You Will Learn In Next Few Sets of Lectures
Designing a Single-Cycle Processor
Processor: Datapath and Control
Presentation transcript:

Instructor: Justin Hsia 7/23/2012Summer Lecture #201 CS 61C: Great Ideas in Computer Architecture MIPS CPU Datapath, Control Introduction

Review of Last Lecture Critical path constrains clock rate – Timing constants: setup, hold, and clk-to-q times – Can adjust with extra registers (pipelining) Finite State Machines examples of sequential logic circuits – Can implement systems with Register + CL Use MUXes to select among input – S input bits selects one of 2 S inputs Build n-bit adder out of chained 1-bit adders – Can also do subtraction and overflow detection! 7/23/2012Summer Lecture #202

Pipelining Analogy Santa’s Workshop: elves assemble rocking horses in two parts, each taking ≈ 30 min 1)Attaching wooden pieces together 2)Painting Takes one elf ≈ 60 min – Pass a new set of wood pieces every hour Split process among two elves in separate rooms (painting is messy) – With added 5 min to transfer from room to room, takes about 65 min to finish one rocking horse – Can pass 1 st elf new set of wood pieces every 30 min, 2 nd elf finishes a rocking horse every 30 min 7/23/2012Summer Lecture #203

Great Idea #1: Levels of Representation/Interpretation 7/23/2012Summer Lecture #204 lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) Higher-Level Language Program (e.g. C) Assembly Language Program (e.g. MIPS) Machine Language Program (MIPS) Hardware Architecture Description (e.g. block diagrams) Compiler Assembler Machine Interpretation temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; Logic Circuit Description (Circuit Schematic Diagrams) Architecture Implementation We are here

system datapath control state registers combinational logic multiplexer comparator code registers registerlogic switching networks Hardware Design Hierarchy 7/23/2012Summer Lecture #205 Today

Agenda Processor Design Administrivia Datapath Overview Assembling the Datapath Control Introduction 7/23/2012Summer Lecture #206

Five Components of a Computer Components a computer needs to work – Control – Datapath – Memory – Input – Output 7/23/2012Summer Lecture #207 Processor Computer Control (“brain”) Datapath (“brawn”) MemoryDevices Input Output

The Processor Processor (CPU): Implements the instructions of the Instruction Set Architecture (ISA) – Datapath: part of the processor that contains the hardware necessary to perform operations required by the processor (“the brawn”) – Control: part of the processor (also in hardware) which tells the datapath what needs to be done (“the brain”) 7/23/2012Summer Lecture #208

Processor Design Process Five steps to design a processor: 1. Analyze instruction set  datapath requirements 2. Select set of datapath components & establish clock methodology 3. Assemble datapath meeting the requirements 4. Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5. Assemble the control logic Formulate Logic Equations Design Circuits 7/23/2012Summer Lecture #209 Control Datapath Memory Processor Input Output Now

The MIPS-lite Instruction 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: – beq rs,rt,imm16 7/23/2012Summer Lecture #2010 oprsrtrdshamtfunct bits 5 bits oprsrtimmediate bits16 bits5 bits oprsrtimmediate bits16 bits5 bits oprsrtimmediate bits16 bits5 bits

Register Transfer Language (RTL) All start by fetching the instruction: RTL gives the meaning of the instructions: 7/23/2012Summer Lecture #2011 R-format: {op, rs, rt, rd, shamt, funct}  MEM[ PC ] I-format: {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] ) then PC  PC+4 + (sign_ext(imm16) || 00) else PC  PC+4

Step 1: Requirements of the Instruction Set Memory (MEM) – Instructions & data (separate: in reality just caches) – Load from and store to Registers (32 32-bit regs) – Read rs and rt – Write rt or rd PC – Add 4 (+ maybe extended immediate) Extender (sign/zero extend) Add/Sub/OR unit for operation on register(s) or extended immediate – Compare if registers equal? 7/23/2012Summer Lecture #2012

Generic Datapath Layout Break up the process of “executing an instruction” – Smaller phases easier to design and modify independently Proj1 had 3 phases: Fetch, Decode, Execute – Now expand Execute 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Step 2: Components of the Datapath Combinational Elements – Gates and wires State Elements + Clock Building Blocks: 7/23/2012Summer Lecture # A B Y Select MUX MultiplexerALU 32 A B Result OP ALU 32 A B Sum CarryOut CarryIn Adder

ALU Requirements MIPS-lite: add, sub, OR, equality 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] )... Equality test: Use subtraction and implement output to indicate if result is 0 P&H also adds AND, Set Less Than (1 if A < B, 0 otherwise) Can see ALU from P&H C.5 (on CD) 7/23/2012Summer Lecture #2015

Storage Element: Idealized Memory Memory (idealized) – One input bus: Data In – One output bus: Data Out Memory access: – Read: Write Enable = 0, data at Address is placed on Data Out – Write: Write Enable = 1, Data In written to Address Clock input (CLK) – CLK input is a factor ONLY during write operation – During read, behaves as a combinational logic block: Address valid  Data Out valid after “access time” 7/23/2012Summer Lecture #2016 CLK Data In Write Enable 32 DataOut Address

Storage Element: Register As seen in Logisim intro – N-bit input and output buses – Write Enable input Write Enable: – De-asserted (0): Data Out will not change – Asserted (1): Data In value placed onto Data Out on the rising edge of CLK 7/23/2012Summer Lecture #2017 CLK Data In Write Enable NN Data Out

Storage Element: Register File Register File consists of 32 registers: – Output buses busA and busB – Input bus busW Register selection – Place data of register RA (number) onto busA – Place data of register RB (number) onto busB – Store data on busW into register RW (number) when Write Enable is 1 Clock input (CLK) – CLK input is a factor ONLY during write operation – During read, behaves as a combinational logic block: RA or RB valid  busA or busB valid after “access time” 7/23/2012Summer Lecture #2018 Clk busW Write Enable 32 busA 32 busB 555 RWRARB 32 x 32-bit Registers

Agenda Processor Design Administrivia Datapath Overview Assembling the Datapath Control Introduction 7/23/2012Summer Lecture #2019

Administrivia HW 4 due Wednesday Project 2, Part 2 due Sunday 7/29 – Extra Credit also due 7/29 (Fastest Matrix Multiply) No lab on Thursday – work on project 7/23/2012Summer Lecture #2020

Agenda Processor Design Administrivia Datapath Overview Assembling the Datapath Control Introduction Clocking Methodology 7/23/2012Summer Lecture #2021

Datapath Overview (1/5) Phase 1: Instruction Fetch (IF) – Fetch 32-bit instruction from memory – Increment PC (PC = PC + 4) 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Datapath Overview (2/5) Phase 2: Instruction Decode (ID) – Read the opcode and appropriate fields from the instruction – Gather all necessary registers values from Register File 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Datapath Overview (3/5) Phase 3: Execute (EX) – ALU performs operations: arithmetic ( +, -, *, / ), shifting, logical ( &, | ), comparisons ( slt, == ) – Also calculates addresses for loads and stores 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Datapath Overview (4/5) Phase 4: Memory Access (MEM) – Only load and store instructions do anything during this phase; the others remain idle or skip this phase – Should be fast due to caches 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Datapath Overview (5/5) Phase 5: Register Write (WB for “write back”) – Write the instruction result back into the Register File – Those that don’t (e.g. sw, j, beq ) remain idle or skip this phase 7/23/2012Summer Lecture # Instruction Fetch 2. Decode/ Register Read 3. Execute4. Memory 5. Register Write PC instruction memory +4 Register File rt rs rd ALU Data memory imm MUX

Why Five Stages? Could we have a different number of stages? – Yes, and other architectures do So why does MIPS have five if instructions tend to idle for at least one stage? – The five stages are the union of all the operations needed by all the instructions – There is one instruction that uses all five stages: load ( lw / lb ) 7/23/201227Summer Lecture #20

Agenda Processor Design Administrivia Datapath Overview Assembling the Datapath Control Introduction 7/23/2012Summer Lecture #2028

Step 3: Assembling the Datapath Assemble datapath to meet RTL requirements – Exact requirements will change based on ISA – Here we will examine each instruction of MIPS-lite The datapath is all of the hardware components and wiring necessary to carry out all of the different instructions – Make sure all components (e.g. RegFile, ALU) have access to all necessary signals and buses – Control will make sure instructions are properly executed (the decision making) 7/23/2012Summer Lecture #2029

Datapath by Instruction All instructions: Instruction Fetch (IF) – Fetch the Instruction: mem[PC] – Update the program counter: Sequential Code: PC  PC + 4 Branch and Jump: PC  “something else” 7/23/2012Summer Lecture #2030 Next Address Logic 32 Instruction Address Instruction Memory PC CLK

Datapath by Instruction All instructions: Instruction Decode (ID) – Pull off all relevant fields from instruction to make available to other parts of datapath MIPS-lite only has R-format and I-format Control will sort out the proper routing (discussed later) 7/23/2012Summer Lecture #2031 Wires and Splitters 32 Instr opcode rs rt rd shamt funct imm

Step 3: Add & Subtract ADDU R[rd]  R[rs]+R[rt]; Hardware needed: – Instruction Mem and PC (already shown) – Register File (RegFile) for read and write – ALU for add/subtract 7/23/2012Summer Lecture #2032 CLK busW 32 busA 32 busB 555 RWRARB 32 x 32-bit Registers 32 Result ALU 32 A B

Step 3: Add & Subtract ADDU R[rd]  R[rs]+R[rt]; Connections: – RegFile and ALU Inputs – Connect RegFile and ALU – RegWr (1) and ALUctr ( ADD/SUB ) set by control in ID 7/23/2012Summer Lecture # Result CLK busW 32 busA 32 busB 555 RWRARB 32 x 32-bit Registers ALUctr RegWr rsrtrd ALU 32 A B

Step 3: Or Immediate ORI R[rt]  R[rs]|zero_ext(Imm16); Is the hardware below sufficient? – Zero extend imm16 ? – Pass imm16 to input of ALU? – Write result to rt ? 7/23/2012Summer Lecture # Result CLK busW 32 busA 32 busB 555 RWRARB 32 x 32-bit Registers ALUctr RegWr rsrtrd ALU

Step 3: Or Immediate ORI R[rt]  R[rs]|zero_ext(Imm16); Add new hardware: – Still support add/sub – New control signals: RegDst, ALUSrc 7/23/2012Summer Lecture # ALUctr CLK RegWr 32 busA 32 busB 55 RWRARB RegFile rs rt rd ZeroExt 3216 imm16 ALUSrc ALU 5 RegDst 2:1 MUX How to implement this?

Step 3: Load LOAD R[rt]  MEM[R[rs]+sign_ext(Imm16)]; Hardware sufficient? – Sign extend imm16 ? – Where’s MEM? 7/23/2012Summer Lecture # ALUctr CLK RegWr 32 busA 32 busB 55 RWRARB RegFile rs rt rd ZeroExt 3216 imm16 ALUSrc ALU 5 RegDst

Step 3: Load LOAD R[rt]  MEM[R[rs]+sign_ext(Imm16)]; New control signals: ExtOp, MemWr, MemtoReg 7/23/2012Summer Lecture # ALUctr CLK busW RegWr 32 busA 32 busB 55 RWRARB RegFile rs rt rd RegDst Extender 3216 imm16 ALUSrc ExtOp MemtoReg CLK Data In 32 MemWr ALU 0 1 WrEnAddr Data Memory 5 ??? Must now also handle sign extension What goes here during a store?

Step 3: Store STORE MEM[R[rs]+sign_ext(Imm16)]  R[rt]; Connect busB to Data In (no extra control needed!) 7/23/2012Summer Lecture # ALUctr CLK busW RegWr 32 busA 32 busB 55 RWRARB RegFile rs rt rd RegDst Extender 3216 imm16 ALUSrc ExtOp MemtoReg CLK Data In 32 MemWr ALU 0 1 WrEnAddr Data Memory 5

Step 3: Branch If Equal BEQ if(R[rs]==R[rt]) then PC  PC+4 + (sign_ext(Imm16) || 00) Need comparison output from ALU 7/23/2012Summer Lecture # ALUctr CLK busW RegWr 32 busA 32 busB 55 RWRARB RegFile rs rt rd RegDst Extender 3216 imm16 ALUSrc ExtOp MemtoReg CLK Data In 32 MemWr ALU 0 1 WrEnAddr Data Memory 5 zero =

Next Address Logic 32 Instruction Address Instruction Memory PC CLK Step 3: Branch If Equal BEQ if(R[rs]==R[rt]) then PC  PC+4 + (sign_ext(Imm16) || 00) Revisit “next address logic”: 7/23/2012Summer Lecture #2040 imm16 CLK PC 4 PC Ext Adder MUX Instruction Addr Instruction Memory Instr Fetch Unit ??? nPC_sel zero How to hook these up? Sign extend and ×4

Step 3: Branch If Equal BEQ if(R[rs]==R[rt]) then PC  PC+4 + (sign_ext(Imm16) || 00) Revisit “next address logic”: – nPC_sel should be 1 if branch, 0 otherwise 7/23/2012Summer Lecture #2041 nPC_sel MUX 0 1 zero MUX PC+4 PC+4 + branchAddr nextPC (nPC) nPC_selzeroMUX How does this change if we add bne ?

BEQ if(R[rs]==R[rt]) then PC  PC+4 + (sign_ext(Imm16) || 00) Revisit “next address logic”: imm16 CLK PC 4 PC Ext Adder MUX Instruction Addr Instruction Memory Instr Fetch Unit nPC_sel zero Step 3: Branch If Equal 7/23/2012Summer Lecture #2042

Get To Know Your Staff Category: Movies 7/23/2012Summer Lecture #2043

Agenda Processor Design Administrivia Datapath Overview Assembling the Datapath Control Introduction 7/23/2012Summer Lecture #2044

Processor Design Process Five steps to design a processor: 1. Analyze instruction set  datapath requirements 2. Select set of datapath components & establish clock methodology 3. Assemble datapath meeting the requirements 4. Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5. Assemble the control logic Formulate Logic Equations Design Circuits 7/23/2012Summer Lecture #2045 Control Datapath Memory Processor Input Output Now

Control Need to make sure that correct parts of the datapath are being used for each instruction – Have seen control signals in datapath used to select inputs and operations – For now, focus on what value each control signal should be for each instruction in the ISA – Next lecture, we will see how to implement the proper combinational logic to implement the control 7/23/2012Summer Lecture #2046

Desired Datapath For addu R[rd]  R[rs]+R[rt]; 7/23/2012Summer Lecture #2047 nPC_sel=? RegDst=? RegWr=? ExtOp=? ALUSrc=? ALUctr=? MemWr=? MemtoReg=? ADD X

Desired Datapath For ori R[rt]  R[rs]|ZeroExt(imm16); 7/23/2012Summer Lecture # OR Zero

Desired Datapath For load R[rt]  MEM{R[rs]+SignExt[imm16]}; 7/23/2012Summer Lecture # ADD Sign

Desired Datapath For store MEM{R[rs]+SignExt[imm16]}  R[rt]; 7/23/2012Summer Lecture # X 0 ADD X 1 1 Sign

Desired Datapath For beq BEQ if(R[rs]==R[rt]) then PC  PC+4 + (sign_ext(Imm16) || 00) 7/23/2012Summer Lecture #2051 Br X 0 SUB X 0 0 X

MIPS-lite Datapath Control Signals ExtOp:0  “zero”; 1  “sign” ALUsrc:0  busB;1  imm16 ALUctr:“ADD”, “SUB”, “OR” nPC_sel:0  +4; 1  branch MemWr:1  write memory MemtoReg:0  ALU; 1  Mem RegDst:0  “rt”; 1  “rd” RegWr:1  write register 7/23/2012Summer Lecture # ALUctr CLK busW RegWr 32 busA 32 busB 55 RWRARB rs rt rd RegDst Extender 3216 imm16 ALUSrc ExtOp MemtoReg CLK Data In 32 MemWr 01 RegFile 0 1 ALU 0 1 Data Memory WrEnAddr 5 zero = nPC_sel Instr Fetch Unit CLK

Summary (1/2) Five steps to design a processor: 1)Analyze instruction set  datapath requirements 2)Select set of datapath components & establish clock methodology 3)Assemble datapath meeting the requirements 4)Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5)Assemble the control logic Formulate Logic Equations Design Circuits 7/23/2012Summer Lecture #2053 Control Datapath Memory Processor Input Output

Summary (2/2) Determining control signals – Any time a datapath element has an input that changes behavior, it requires a control signal (e.g. ALU operation, read/write) – Any time you need to pass a different input based on the instruction, add a MUX with a control signal as the selector (e.g. next PC, ALU input, register to write to) Your datapath and control signals will change based on your ISA 7/23/2012Summer Lecture #2054