The MIPS Processor Datapath

Similar documents
Processor (I) - datapath & control. Hwansoo Han

Chapter 4. The Processor

Chapter 4. The Processor

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

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

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

Systems Architecture

Chapter 4. The Processor Designing the datapath

ECE260: Fundamentals of Computer Engineering

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

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

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

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

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

Introduction. Datapath Basics

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

LECTURE 5. Single-Cycle Datapath and Control

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

Chapter 4. The Processor

CPE 335 Computer Organization. Basic MIPS Architecture Part I

ECE232: Hardware Organization and Design

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

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

Inf2C - Computer Systems Lecture Processor Design Single Cycle

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

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

Single Cycle Datapath

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

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

Laboratory 5 Processor Datapath

Chapter 4. The Processor

Single Cycle CPU Design. Mehran Rezaei

CENG 3420 Lecture 06: Datapath

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

Single Cycle Datapath

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

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

COMPUTER ORGANIZATION AND DESIGN

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

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

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

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

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

The Processor: Datapath & Control

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

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

CSEN 601: Computer System Architecture Summer 2014

Chapter 5: The Processor: Datapath and Control

CPU Organization (Design)

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

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

Systems Architecture I

CS Computer Architecture Spring Week 10: Chapter

Computer Hardware Engineering

Review: Abstract Implementation View

CS222: Processor Design

Fundamentals of Computer Systems

Lecture 10: Simple Data Path

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

CC 311- Computer Architecture. The Processor - Control

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

Computer Hardware Engineering

Data paths for MIPS instructions

COMPUTER ORGANIZATION AND DESIGN

RISC Processor Design

Single Cycle Data Path

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

CS61C : Machine Structures

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

The Processor: Datapath & Control

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

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

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

UC Berkeley CS61C : Machine Structures

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

Ch 5: Designing a Single Cycle Datapath

Working on the Pipeline


Lecture #17: CPU Design II Control

The overall datapath for RT, lw,sw beq instrucution

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

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

ECE369. Chapter 5 ECE369

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

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

UC Berkeley CS61C : Machine Structures

CSE 378 Midterm 2/12/10 Sample Solution

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

Design of the MIPS Processor

Topic #6. Processor Design

UC Berkeley CS61C : Machine Structures

MIPS-Lite Single-Cycle Control

Major CPU Design Steps

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

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

CS3350B Computer Architecture Winter 2015

COMP303 Computer Architecture Lecture 9. Single Cycle Control

Transcription:

The MIPS Processor Datapath

Module Outline MIPS datapath implementation Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational control Assignment: Datapath design and Control Unit design using SystemC.

Logic Design Fundamentals Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses

Logic Design Fundamentals Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses Combinational element State (sequential) elements

Logic Design Fundamentals Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses Combinational element Operate on data Output is a function of input State (sequential) elements

Logic Design Fundamentals Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses Combinational element Operate on data Output is a function of input State (sequential) elements Store information

Combinational Elements AND-gate Adder A Y = A & B Y = A + B B + Y A B Y Multiplexer Y = S? I1 : I0 Arithmetic/Logic Unit Y = F(A, B) A I0 I1 M u x Y B ALU Y S F

Sequential Elements Register: stores data in a circuit Uses a clock signal to determine when to update the stored value Edge-triggered: update when Clk changes from 0 to 1

Sequential Elements Register: stores data in a circuit Uses a clock signal to determine when to update the stored value Edge-triggered: update when Clk changes from 0 to 1 D Clk Q Clk D Q

Sequential Elements Register with write control Only updates on clock edge when write control input is 1 Used when stored value is required later

Sequential Elements Register with write control Only updates on clock edge when write control input is 1 Used when stored value is required later Clk D Write Clk Q Write D Q

Clocking Methodology Combinational logic transforms data during clock cycles

Clocking Methodology Combinational logic transforms data during clock cycles Between clock edges Input from state elements, output to state element

Clocking Methodology Combinational logic transforms data during clock cycles Between clock edges Input from state elements, output to state element

Clocking Methodology Combinational logic transforms data during clock cycles Between clock edges Input from state elements, output to state element Longest delay determines clock period

Building a Datapath Datapath

Building a Datapath Datapath Elements that process data and addresses in the CPU

Building a Datapath Datapath Elements that process data and addresses in the CPU Registers, ALUs, muxes, memories,

Building a Datapath Datapath Elements that process data and addresses in the CPU Registers, ALUs, muxes, memories, We will build a MIPS datapath incrementally

A Basic MIPS Implementation Memory-reference instructions Load Word (lw) and Store Word (sw) ALU instructions add, sub, AND, OR and slt Branch on equal (beq)

Instruction Execution Steps

Instruction Execution Steps Instruction Fetch

Instruction Execution Steps Instruction Fetch Instruction Decode/Register Fetch

Instruction Execution Steps Instruction Fetch Instruction Decode/Register Fetch Execute ALU Effective Address Calculation

Instruction Execution Steps Instruction Fetch Instruction Decode/Register Fetch Execute ALU Effective Address Calculation Memory Access

Instruction Execution Steps Instruction Fetch Instruction Decode/Register Fetch Execute ALU Effective Address Calculation Memory Access Write back (Update RF)

Instruction Fetch Actions

Instruction Fetch Actions Read Program Counter

Instruction Fetch Actions Read Program Counter Fetch instruction from Instruction memory pointed to by the PC

Instruction Fetch Actions Read Program Counter Fetch instruction from Instruction memory pointed to by the PC Increment PC

Instruction Fetch Elements

Instruction Fetch Elements

Instruction Fetch

ADD R1, R2, R3 ALU Instructions Operations

ALU Instructions Operations Read R2 and R3 from Register file Send 2 and 3 to RF RF reads contents of R2 and R3 ADD R1, R2, R3

ALU Instructions Operations Read R2 and R3 from Register file Send 2 and 3 to RF RF reads contents of R2 and R3 Add contents of R2 and R3 in the ALU ADD R1, R2, R3

ALU Instructions Operations Read R2 and R3 from Register file Send 2 and 3 to RF RF reads contents of R2 and R3 Add contents of R2 and R3 in the ALU Feed the sum output to the RF; Ask it to write into R1 ADD R1, R2, R3

ADD R1, R2, R3 ALU Operations Elements

ALU Operations Elements Addr Data REGISTER FILE Data Write ADD R1, R2, R3

ADD R1, R2, R3 ALU Operations Elements

ADD R1, R2, R3 ALU Operations Elements

ADD R1, R2, R3 ALU Operations Datapath

ALU Operations Datapath How will the design change for ADDI? ADDI R1, R2, -13

ADDI R1, R2, -13 ALU Operations Datapath

LW R1, -8(R2) Loads and Stores Actions

Loads and Stores Actions Calculate full address Sum of -8 (offset) and contents of R2 (base) Size of offset? Size of contents of R2? LW R1, -8(R2)

Loads and Stores Actions Calculate full address Sum of -8 (offset) and contents of R2 (base) Size of offset? Size of contents of R2? Send the address to Data memory LW R1, -8(R2)

Loads and Stores Actions Calculate full address Sum of -8 (offset) and contents of R2 (base) Size of offset? Size of contents of R2? Send the address to Data memory DM reads out the contents of Mem[R2+(-8)] LW R1, -8(R2)

Loads and Stores Actions Calculate full address Sum of -8 (offset) and contents of R2 (base) Size of offset? Size of contents of R2? Send the address to Data memory DM reads out the contents of Mem[R2+(-8)] Feed the value from memory to the RF; Ask it to write the value into R1 LW R1, -8(R2)

LW R1, -8(R2) Loads and Stores Elements

Memory and R-type Instructions

LW R1, -8(R2) Memory Instruction Load

LW R1, -8(R2) Memory Instruction Load

LW R1, -8(R2) Memory Instruction Load

LW R1, -8(R2) Memory Instruction Load

Memory Instruction Load ADD LW R1, -8(R2)

Memory Instruction Load ADD LW R1, -8(R2)

Memory Instruction Load ADD LW R1, -8(R2)

Memory Instruction Load Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD; MemRead=1;MemWrite=0; MemToReg=1;

SW R1, -8(R2) Memory Instruction Store

Memory Instruction Store ADD SW R1, -8(R2)

Memory Instruction Store Control Signals:

Memory Instruction Store Control Signals: RegWrite=0; ALUSrc=1; ALUoperation=ADD; MemRead=0;MemWrite=1; MemToReg=X;

ADD R1, R2, R3 R Type Instruction ADD

ADD R1, R2, R3 R Type Instruction ADD

Control Signals: R Type Instruction ADD

R Type Instruction ADD Control Signals: RegWrite=1; ALUSrc=0; ALUoperation=ADD; MemRead=X;MemWrite=X; MemToReg=0;

ADDI R1, R2, 13 I Type Instruction ADDI

ADDI R1, R2, 13 I Type Instruction ADDI

I Type Instruction ADDI Control Signals:

I Type Instruction ADDI Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD; MemRead=X;MemWrite=X; MemToReg=0;

BEQ R1, R2, -16 BEQ Actions

BEQ Actions Read R1 and R2 from Register file Send 1 and 2 to RF RF reads contents of R1 and R2 BEQ R1, R2, -16

BEQ Actions Read R1 and R2 from Register file Send 1 and 2 to RF RF reads contents of R1 and R2 Send to ALU; Ask it to Subtract BEQ R1, R2, -16

BEQ Actions Read R1 and R2 from Register file Send 1 and 2 to RF RF reads contents of R1 and R2 Send to ALU; Ask it to Subtract Read out Zero flag from ALU BEQ R1, R2, -16

BEQ Actions Read R1 and R2 from Register file Send 1 and 2 to RF RF reads contents of R1 and R2 Send to ALU; Ask it to Subtract Read out Zero flag from ALU If Z flag == 0; then PC = (PC + 4) 16 BEQ R1, R2, -16

BEQ Actions Read R1 and R2 from Register file Send 1 and 2 to RF RF reads contents of R1 and R2 Send to ALU; Ask it to Subtract Read out Zero flag from ALU If Z flag == 0; then PC = (PC + 4) 16 Else if Z flag == 1; then PC = PC + 4 BEQ R1, R2, -16

Branches Elements BEQ R1, R2, LABEL BEQ R1, R2, -16

Branches Elements BEQ R1, R2, LABEL BEQ R1, R2, -16

The MIPS Datapath

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

BEQ R1, R2, -16 The MIPS Datapath BEQ

The MIPS Datapath BEQ Control BEQ R1, R2, -16 Signals ::

The MIPS Datapath BEQ BEQ R1, R2, -16 Control Signals :: RegWrite=0; ALUSrc=0; ALUoperation=SUB; MemRead=X;MemWrite=X; MemToReg=X; PCSrc=Condition

MIPS Datapath and Control Lines

Module Outline MIPS datapath implementation Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational control Assignment: Datapath design and Control Unit design using SystemC.

Backup

ALU Instructions ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ) R-type op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits OP rd, rs, rt op: Opcode (class of instruction). Eg. ALU funct: Which subunit of the ALU to activate? I-type op rs rt immediate 6 bits 5 bits 5 bits 16 bits OP rt, rs, IMM

ALU Instructions ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ) Identified by Opcode fields and Funct fields

ALU Instructions ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ) R-type op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits OP rd, rs, rt op: Opcode (class of instruction). Eg. ALU funct: Which subunit of the ALU to activate? I-type op rs rt immediate 6 bits 5 bits 5 bits 16 bits OP rt, rs, IMM