CPE 335 Computer Organization. Basic MIPS Architecture Part I

Similar documents
CENG 3420 Lecture 06: Datapath

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

CPE 335. Basic MIPS Architecture Part II

Review: Abstract Implementation View

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

LECTURE 5. Single-Cycle Datapath and Control

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

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Processor (I) - datapath & control. Hwansoo Han

Systems Architecture

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

Lecture 10: Simple Data Path

Chapter 4 The Processor 1. Chapter 4A. The Processor

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

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

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Systems Architecture I

The overall datapath for RT, lw,sw beq instrucution

CS Computer Architecture Spring Week 10: Chapter

The MIPS Processor Datapath

Computer Science 141 Computing Hardware

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

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

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

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

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

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

Fundamentals of Computer Systems

CC 311- Computer Architecture. The Processor - Control

ECS 154B Computer Architecture II Spring 2009

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

Chapter 4. The Processor

Chapter 4. The Processor

Ch 5: Designing a Single Cycle Datapath

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

Topic #6. Processor Design

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

CPU Organization (Design)

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

The Processor: Datapath & Control

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

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

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

LECTURE 6. Multi-Cycle Datapath and Control

MIPS-Lite Single-Cycle Control

CPE 335 Computer Organization. Basic MIPS Pipelining Part I

ECE260: Fundamentals of Computer Engineering

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

Chapter 5: The Processor: Datapath and Control

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1

ECE232: Hardware Organization and Design

Single Cycle CPU Design. Mehran Rezaei

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

CSEN 601: Computer System Architecture Summer 2014

RISC Processor Design

ECE473 Computer Architecture and Organization. Processor: Combined Datapath

COMP303 Computer Architecture Lecture 9. Single Cycle Control

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

Major CPU Design Steps

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

Computer Hardware Engineering

Chapter 4. The Processor Designing the datapath

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

Processor: Multi- Cycle Datapath & Control

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

CSE140: Components and Design Techniques for Digital Systems

comp 180 Lecture 25 Outline of Lecture The ALU Control Operation & Design The Datapath Control Operation & Design HKUST 1 Computer Science

Processor (multi-cycle)

RISC Design: Multi-Cycle Implementation

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

Data paths for MIPS instructions

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

The Processor: Datapath & Control

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

Computer Hardware Engineering

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

Lecture 6 Datapath and Controller

Multiple Cycle Data Path

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

Single Cycle Data Path

Lecture 7 Pipelining. Peng Liu.

ENE 334 Microprocessors

Chapter 4. The Processor

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

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

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Lecture 5: The Processor

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

ECE369. Chapter 5 ECE369

CSE 2021 COMPUTER ORGANIZATION

Laboratory 5 Processor Datapath

Introduction. Datapath Basics

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

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

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

Transcription:

CPE 335 Computer Organization Basic MIPS Architecture Part I Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides http://www.abandah.com/gheith/courses/cpe335_s8/index.html CPE232 Basic MIPS Architecture

The Processor: Datapath & Control Our implementation ti of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions: add, sub, and, or, slt control flow instructions: beq, j Generic implementation ti use the program counter (PC) to supply the instruction address and fetch the instruction from memory (and update the PC) decode the instruction (and read registers) execute the instruction Execute Fetch PC = PC+4 Decode All instructions (except j) use the after reading the registers How? memory-reference? arithmetic? control flow? CPE232 Basic MIPS Architecture 2

Clocking Methodologies The clocking methodology defines when signals can be read and when they are written An edge-triggered methodology Typical execution read contents of state elements send values through combinational logic write results to one or more state elements State element Combinational logic State element 2 clock one clock cycle Assumes 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 CPE232 Basic MIPS Architecture 3

Fetching s Fetching instructions involves reading the instruction from the updating the PC to hold the address of the next instruction 4 PC ress PC is updated d every cycle, so it does not need an explicit it write control signal is read every cycle, so it doesn t need an explicit read control signal CPE232 Basic MIPS Architecture 4

Decoding s Decoding instructions involves sending the fetched instruction s opcode and function field bits to the control unit Control Unit r r 2 Register File Write r Data Data 2 reading two values from the Register File - Register File addresses are contained in the instruction CPE232 Basic MIPS Architecture 5

Register File CPE232 Basic MIPS Architecture 6

Register File Ports Use two multiplexers l whose control lines are the register numbers. CPE232 Basic MIPS Architecture 7

Register File Write Port We need 5-to-32 decoder in addition to the Write signal to generate actual write signal The register data is common to all registers CPE232 Basic MIPS Architecture 8

Executing R Format Operations Rf format operations (add, sub, slt, and, or) ) 3 25 2 5 5 R-type: op rs rt rd shamt funct perform the (op and funct) operation on values in rs and rt store the result back into the Register File (into location rd) RegWrite control r dr 2 Register Write r File Data Data 2 overflow zero The Register File is not written every cycle (e.g. sw), so we need an explicit write control signal for the Register File CPE232 Basic MIPS Architecture 9

Executing Load and Store Operations Load and store operations involves compute memory address by adding the base register (read from the Register File during decode) to the 6-bit signed-extended offset field in the instruction store value (read from the Register File during decode) written to the Data load value, read from the Data, written to the Register File RegWrite control MemWrite r Register dr 2 Data File Write r Data 2 overflow zero ress Data Data Sign 6 Extend 32 Mem CPE232 Basic MIPS Architecture

Executing Branch Operations Branch operations involves compare the operands read from the Register File during decode for equality (zero output) compute the branch target address by adding the updated PC to the 6-bit signed-extended offset field in the instr 4 Shift left 2 Branch target address control PC r Register r 2 Data File Write r Data 2 zero (to branch control logic) Sign 6 Extend 32 CPE232 Basic MIPS Architecture

Executing Jump Operations Jump operation involves replace the lower 28 bits of the PC with the lower 26 bits of the fetched instruction shifted left by 2 bits PC 4 ress ti 26 Shift left 2 4 28 Jump address CPE232 Basic MIPS Architecture 2

Creating a Single Datapath from the Parts Assemble the datapath segments and add control lines and multiplexors as needed Single cycle design fetch, decode and execute each instructions in one clock cycle no datapath resource can be used more than once per instruction, so some must be duplicated (e.g., separate and Data, several adders) multiplexors needed at the input of shared elements with control lines to do the selection write signals to control writing to the Register File and Data Cycle time is determined by length of the longest path CPE232 Basic MIPS Architecture 3

Fetch, R, and Access Portions PC 4 ress RegWrite r Register r 2 Data File Write r Data 2 Src control ovf zero MemWrite MemtoReg ress Data Data Sign 6 Extend 32 Mem CPE232 Basic MIPS Architecture 4

ing the Control Selecting the operations to perform (, Register File and read/write) Controlling the flow of data (multiplexor inputs) 3 25 2 5 5 R-type: op rs rt rd shamt funct 3 25 2 5 Observations I-Type: op rs rt address offset op field always 3 25 in bits 3-26 J-type: op target address address of registers to be read are always specified by the rs field (bits 25-2) 2) and rt field (bits 2-6); for lw and sw rs is the base register addr. of register to be written is in one of two places in rt (bits 2-6) for lw; in rd (bits 5-) for R-type instructions offset for beq, lw, and sw always in bits 5- CPE232 Basic MIPS Architecture 5

Single Cycle Datapath with Control Unit 4 Shift left 2 Op Branch Instr[3-26] Control Unit Src PCSrc Mem MemtoReg MemWrite PC ress Instr[3-] RegDst Instr[25-2] Instr[2-6] Instr[5 -] RegWrite r Register r 2 Data File Write r Data 2 ovf zero ress Data Data Instr[5-] Sign 6 Extend 32 control Instr[5-] CPE232 Basic MIPS Architecture 6

Signal Single NameCycle Effect when Datapath deassereted with () Control Effect when Unit asserted () RegDst The destination register is from rt The destination register is from rd field field RegWrite None Enable writing to the register selected by the Write register port Src The second operand comes The second operand is the sign from the second register file extended offset output PCSrc PC value is PC+4 PC is the branch address Mem None Contents of memory address are put on data output MemWrite None Data on the Write data input is placed in the specified address MemtoReg The data fed to the register file The data fed to the register file Write Write data input comes from data input comes from memory Op Used with the function field of the instruction to generate the Op signal that t specify the operation CPE232 Basic MIPS Architecture 7

R-type Data/Control Flow 4 Shift left 2 Op Branch Instr[3-26] Control Unit Src PCSrc Mem MemtoReg MemWrite PC ress Instr[3-] RegDst Instr[25-2] Instr[2-6] Instr[5 -] RegWrite r Register r 2 Data File Write r Data 2 ovf zero ress Data Data Instr[5-] Sign 6 Extend 32 control Instr[5-] CPE232 Basic MIPS Architecture 8

Load Word Data/Control Flow 4 Shift left 2 Op Branch Instr[3-26] Control Unit Src PCSrc Mem MemtoReg MemWrite PC ress Instr[3-] RegDst Instr[25-2] Instr[2-6] Instr[5 -] RegWrite r Register r 2 Data File Write r Data 2 ovf zero ress Data Data Instr[5-] Sign 6 Extend 32 control Instr[5-] CPE232 Basic MIPS Architecture 9

Branch Data/Control Flow 4 Shift left 2 Op Branch Instr[3-26] Control Unit Src PCSrc Mem MemtoReg MemWrite PC ress Instr[3-] RegDst Instr[25-2] Instr[2-6] Instr[5 -] RegWrite r Register r 2 Data File Write r Data 2 ovf zero ress Data Data Instr[5-] Sign 6 Extend 32 control Instr[5-] CPE232 Basic MIPS Architecture 2

ing the Jump Operation 4 Instr[25-] 26 Op Instr[3-26] Shift left 2 Control Unit 28 32 PC+4[3-28] Branch Jump Src Shift left 2 PCSrc Mem MemtoReg MemWrite PC Instr[3-] ress RegDst Instr[25-2] Instr[2-6] Instr[5 -] RegWrite r Register r 2 Data File Write r Data 2 ovf zero ress Data Data Instr[5-] Sign 6 Extend 32 control Instr[5-] CPE232 Basic MIPS Architecture 2

Control Unit The input is the Op field (6 bits) from the instruction register The output is 9 control signals CPE232 Basic MIPS Architecture 22

Control Unit - Implementation Implementation using PLA CPE232 Basic MIPS Architecture 23

Control The control has two inputs:. Op (2 bits) from the control unit 2. Funct field (6 bits) from the instruction register The control has a 3-bit output Function Bnegate Operation and or add sub slt CPE232 Basic MIPS Architecture 24

Control Inst Op Funct Bnegate Operation<> Operation<> and or add sub slt lw n/a sw n/a beq n/a CPE232 Basic MIPS Architecture 25

Single Cycle Disadvantages & Advantages Uses the clock cycle inefficiently the clock cycle must be timed to accommodate the slowest instruction especially problematic for more complex instructions like floating point multiply Clk Cycle Cycle 2 lw sw Waste May be wasteful of area since some functional units (e.g., adders) must be duplicated since they can not be shared during a clock cycle but Is simple and easy to understand CPE232 Basic MIPS Architecture 26

Single Cycle Machine Performance Example: consider the following two implementations single cycle machine: A : all instructions execute in one cycle of fixed length. B : clock cycle adapts to instruction type Compare the performance of the two implementations assuming operation times for the functional units and the instruction mix given below. Unit Time (ps) 2 and adders Register File 5 Percentage % type 45 Load 25 Store Branch 5 Jump 5 CPE232 Basic MIPS Architecture 27

Single Cycle Machine Performance CPU Execution Time = IC x CPI x Clock cycle time CPI A = CPI B = and IC A = IC B The only difference is in clock cycle time Type Functional Units Used R-type Register Register Load Register Register Store Register Branch Register Jump Type Inst. Register Data Register Write Total R-type 2 5 5 4 Load 2 5 2 5 6 Store 2 5 2 55 Branch 2 5 35 Jump 2 2 CPE232 Basic MIPS Architecture 28

Single Cycle Machine Performance The clock cycle time for implementation A is 6 ps The average clock cycle time for implementation B is 6 x.25 + 55 x. + 4 x.45 + 35 x.5 + 2 x.5 = 447.5 ps Performanc B / Performance A = 6 / 447.5 =.34 So, adaptive clock cycle is faster; however it is hard to implement! Solution : use shorter clock cycle that does less work and then use different number of cycles for different instructions CPE232 Basic MIPS Architecture 29