COMS 361 Computer Organization

Slides:



Advertisements
Similar presentations
Datorteknik DatapathControl bild 1 Designing a Single Cycle Datapath & Datapath Control.
Advertisements

361 datapath Computer Architecture Lecture 8: Designing a Single Cycle Datapath.
The Processor: Datapath & Control
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.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Sat Google in Mountain.
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.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
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.
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 L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures.
ECE 232 L12.Datapath.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 12 Datapath.
CS3350B Computer Architecture Winter 2015 Lecture 5.6: Single-Cycle CPU: Datapath Control (Part 1) Marc Moreno Maza [Adapted.
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.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
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
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Designing a Single-Cycle Processor
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
Processor (I).
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
CPU Organization (Design)
Single Cycle CPU Design
Vladimir Stojanovic and Nicholas Weaver
Lecturer PSOE Dan Garcia
Instructors: Randy H. Katz David A. Patterson
CS61C : Machine Structures Lecture 5. 1
The Single Cycle Datapath
Single Cycle datapath.
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
The Processor Lecture 3.2: Building a Datapath with Control
CSCE 350 Computer Architecture Designing a Single Cycle Datapath
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Access the Instruction from Memory
inst.eecs.berkeley.edu/~cs61c-to
CSC3050 – Computer Architecture
Computer Architecture Processor: Datapath
Prof. Giancarlo Succi, Ph.D., P.Eng.
John Kubiatowicz ( CS152 Computer Architecture and Engineering Lecture 7 Designing a Single Cycle Datapath Start: X:40.
Instructors: Randy H. Katz David A. Patterson
The Processor: Datapath & Control.
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:

COMS 361 Computer Organization Title: MIPS Datapath Date: 11/18/2004 Lecture Number: 21

Announcements Exam 2 Tuesday, 11/23/2004

Review Multiplication Real numbers IEEE standard 754 (floating point) Single precision Double precision Decimal to floating point conversion Limitations

Outline MIPS implementation Subset of the MIPS instruction set Data flow Control

Performance Perspective Performance of a machine is determined by Instruction count Clock cycle time Clock cycles per instruction Processor design (datapath and control) determines CPI Inst. Count Cycle Time

Processor Design 101 MIPS implementation Subset of the MIPS instruction set Data flow 5 Steps to design a processor 1) Analyze instruction set => datapath requirements 2) Select set of datapath components and establish clocking methodology 3) Assemble datapath meeting the requirements 4) Determine location and setting of control points 5) Assemble the control logic

Processor Design 101 Step 1 Analyze instruction set => datapath requirements Meaning of each instruction is given by the register transfers Datapath must include storage element for ISA registers Possibly more Datapath must support each register transfer

Instruction formats: MIPS All MIPS instructions are 32 bits long Instruction formats R-type I-type J-type op rs rt rd shamt funct 6 11 16 21 26 31 6 bits 5 bits op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits op target address 26 31 6 bits 26 bits

Instruction formats: MIPS Different fields op: operation of the instruction rs, rt, rd: the source and destination register specifiers shamt: shift amount funct: selects the variant of the operation in the “op” field address / immediate: address offset or immediate value target address: target address of the jump instruction

MIPS-lite Subset ADD and SUB OR Immediate addU rd, rs, rt subU rd, rs, rt OR Immediate ori rt, rs, imm16 op rs rt rd shamt funct 6 11 16 21 26 31 6 bits 5 bits op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits

MIPS-lite Subset LOAD and STORE Word BRANCH lw rt, rs, imm16 sw rt, rs, imm16 BRANCH beq rs, rt, imm16 op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits

Logical Register Transfers RTL gives the meaning of the instructions All start by fetching the instruction 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] ) then PC <– PC + sign_ext(Imm16)] || 00 else PC <– PC + 4

Instruction Set Requirements Memory Instruction & data Registers (32 x 32) read RS, read RT Write RT or RD PC Extender Zero and sign Add and Sub register or extended immediate Add 4 or extended immediate to PC

The Processor Design steps completed Next step: 1) Analyze instruction set => datapath requirements Next step: 2) Select set of datapath components and establish clocking methodology

Components of the Datapath Combinational Elements Elements that operate on data values Sequential Elements Elements that contain memory also called state Restore a units state by restoring previous state values Storage elements Clocking methodology An edge triggered methodology

Clocking Typical execution: Read contents of some state elements Send values through some combinational logic Write results to one or more state elements Clock cycle time determined by how long it takes for signals to reach state element 2 C l o c k y e S t a m n 1 b i g 2

Basic Building Blocks Combinational Logic Elements Adder MUX ADDER MUX Carry Out Sum Carry In A B 32 ADDER Y 32 A B Select MUX

Basic Building Blocks Combinational Logic Elements ALU ALU Operation A 32 ALU Result

Basic Building Blocks Storage Element: Register Similar to the D Flip Flop except N-bit input and output Write Enable input Write Enable negated (0): Data Out will not change asserted (1): Data Out will become Data In N Data Out Data In Write Enable Clock

Basic Building Blocks Storage Element: Register File MIPS 32 general purpose 32-bit registers stored in a structure called a register file any register can be read or written to specify the register number in the file How will the register file be used?

Basic Building Blocks R-type instructions Read two registers Register numbers specified in the instruction Two inputs specifying register numbers to read Two outputs corresponding to the two read registers M u x Register N-2 Read data 1 Read Register Number 1 Register 0 Register 1 ... Register N-1 Read data 2 Read Register Number 2

Basic Building Blocks R-type instructions Register file Input side n - 1 d e c r R g i s – C D u m b W a

Basic Building Blocks Register File R-type instructions Perform an ALU operation Store result Third input specifying the register number to write Fourth input for the data to store Control signal enables write into a register Clock input (CLK) A factor ONLY during write operation Behaves as a combinational logic block during read R e a d r g i s t n u m b 1 2 f l W Clk

Basic Building Blocks Memory (idealized) Select memory word One input bus: Data In One output bus: Data Out Select memory word Address selects the word to put on Data Out Write Enable = activated Address selects the memory word to be written Word is on Data In bus Clock input (CLK) a factor ONLY during write operation 32 Data Out Data In Write Enable Clock Address

The Processor All MIPS instructions use the ALU after reading the registers Why? Memory-reference? Effective address must be computed Arithmetic? Operation execution Control flow? Comparison

The Processor Instruction completion differs among classes after using the ALU Memory-reference Access memory write data for a store read data for a load Arithmetic Write the ALU data into a register Control flow May need to modify the address in the PC

The Processor Design steps completed Next step: 1) Analyze instruction set => datapath requirements 2) Select set of datapath components and establish clocking methodology Next step: 3) Assemble datapath meeting the requirements

Implementation Details Abstract / Simplified / High-Level View

Fetch Instruction Functional Unit Fetch the Instruction: mem[PC] Update the program counter: Sequential Code: PC <- PC + 4 Branch and Jump: PC <- “some other address” PC Adder Sum 4 Instruction address memory 32

Fetch Instruction Functional Unit Fetch the Instruction: mem[PC] Update the program counter: Sequential Code: PC <- PC + 4 Branch and Jump: PC <- “some other address” PC Adder Sum 4 Instruction address memory 32

Arithmetic Instructions addU rd, rs, rt R[rd] <- R[rs] op R[rt] Ra, Rb, and Rw come from instruction’s rs, rt, and rd fields ALUctr and RegWr Control logic after decoding the instruction

Arithmetic Instructions op rs rt rd shamt funct 6 11 16 21 26 31 6 bits 5 bits ALUctr Rs Read register number 1 5 Read data 1 A ALU Read register number 2 32 Rt Result 5 32 Write register Rd Read data 2 5 B 32 Write data RegWr Clk 32

Register-Register Timing Clk PC ALUctr RegWr busA, B Result Rs, Rt, Rd, Op, Func Clk-to-Q Instruction Memory Access Time Old Value New Value Delay through Control Logic Register File Access Time ALU Delay Register Write Occurs Here Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUctr A B ALU Result

Logical Operations with Immediate ori rt, rs, imm16 R[rt] <- R[rs] op ZeroExt[imm16] ] Destination register can be either rt or rd Select the correct instruction field for destination register address 11 op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits rd? immediate 16 15 31 16 bits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Logical Operations with Immediate R[rt] <- R[rs] op ZeroExt[imm16] ] Incorporate zero extension unit Add zero extended 16-bit immediate operand B input of ALU Read Data 2 Zero extended 16-bit immediate operand

Logical Operations with Immediate Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUctr A B ALU Result RegDst MUX ALUsrc 0 Ext