CSCE 212 Chapter 5 The Processor: Datapath and Control

Slides:



Advertisements
Similar presentations
1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Advertisements

CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Multicycle Datapath & Control Andreas Klappenecker CPSC321 Computer Architecture.
1 Chapter Five The Processor: Datapath and Control.
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
CPU Architecture Why not single cycle? Why not single cycle? Hardware complexity Hardware complexity Why not pipelined? Why not pipelined? Time constraints.
1 The Processor: Datapath and Control We will design a microprocessor that includes a subset of the MIPS instruction set: –Memory access: load/store word.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
The Multicycle Processor CPSC 321 Andreas Klappenecker.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
The Processor: Datapath and Control. Outline Goals in processor implementation Brief review of sequential logic design Pieces of the processor implementation.
Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring)
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Multicycle datapath.
MIPS Processor.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Access the Instruction from Memory
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
Chapter 5 The Processor: Datapath and Control
/ Computer Architecture and Design
Systems Architecture I
Extensions to the Multicycle CPU
Five Execution Steps Instruction Fetch
MIPS Instructions.
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
Pipelining: Advanced ILP
CS/COE0447 Computer Organization & Assembly Language
Processor: Finite State Machine & Microprogramming
Computer Architecture
Chapter Five The Processor: Datapath and Control
The Multicycle Implementation
MIPS Processor.
Datapath & Control MIPS
Chapter Five The Processor: Datapath and Control
Rocky K. C. Chang 6 November 2017
The Multicycle Implementation
Systems Architecture I
The Processor Lecture 3.2: Building a Datapath with Control
Vishwani D. Agrawal James J. Danaher Professor
Multicycle Approach We will be reusing functional units
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Multicycle Design.
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Basic MIPS Implementation
CS/COE0447 Computer Organization & Assembly Language
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Review Fig 4.15 page 320 / Fig page 322
Chapter Four The Processor: Datapath and Control
Datapath and Control Exceptions
5.5 A Multicycle Implementation
Drawbacks of single cycle implementation
Data Path Diagrams.
Drawbacks of single cycle implementation
Systems Architecture I
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos

Goal Design a CPU that implements the following instructions: lw, sw add, sub, and, or, slt beq, j

Datapath

Instruction Fetch Datapaths

Register File and ALU

BEQ Datapath

Load, Store, and R-type Datapath

Combined Datapaths

ALU Control ALU performs function based on 4-bit ALU_operation input Add a lookup table that instructs ALU to perform: add (for LW, SW), or subtract (for BEQ), or perform operation as dictated by R-type function code Instruction opcode ALUOp Instruction Funct field Desired ALU action ALU control input LW 00 add 0010 SW BEQ 01 subtract 0110 R-type 10 100000 sub 100010 subract and 100100 0000 or 100101 0001 slt 101010 set on less than 0111

MIPS Datapath

MIPS Datapath with Control

MIPS Datapath with Jump

Single-Cycle This is a single-cycle implementation Each instruction is executed within one clock cycle Must be set for worst-case delay (LW) Instruction class Functional units used Instruction fetch Register read ALU Memory access Register write R-type X LW SW BEQ J

Multicycle Implementation Break instruction execution into a sequence of steps Adjust cycle time to be long enough to perform one basic operation fetch, register read, ALU, memory access, register write Must add registers to carry computed values from one cycle to next Still can perform independent operations in parallel, i.e.: fetch instruction and compute next PC address read registers and compute branch address Allows us to re-use ALU

Multicycle MIPS Implementation

Multicycle Control Instruction fetch Information available: PC Performed for all instructions RTL: IR <= Memory[PC]; PC <= PC + 4; Instruction decode and register fetch Information available: PC, instruction A <= Reg[IR[25:21]]; B <= Reg[IR[20:16]]; ALUOut <= PC + (sign-extend(IR[15:0]) << 2);

Multicycle Control Execution, memory address computation, or branch completion Information available: PC, instruction, (rs), (rt), (ALUOut) Memory reference: ALUOut <= A + sign-extend(IR[15:0]); Arithmetic-logical instruction (R-type): ALUOut <= A op B; Branch: if (A == B) PC <= ALUOut; Jump: PC <= {PC[31:28], IR[25:0], “00”};

Multicycle Control Memory access or R-type completion step Information available: PC, instruction, (rs), (rt), (ALUOut) Load: MDR <= Memory[ALUOut]; Store: Memory[ALUOut] <= B; Arithmetic-logical instruction (R-type): Reg[IR[15:11]] <= ALUOut;

Multicycle Control Memory read completion step Information available: PC, instruction, (rs), (rt), (ALUOut), (MDR) Load: Reg[IR[20:16]] <= MDR;

Multicycle Control

Adding Datapaths and Control How to add these instructions: addi rt, rs, imm bgtz rs, target bgtzal rs, target

Exceptions and Interrupts Events other than branches or jumps that change the normal flow of instruction execution Examples: I/O device request (external, interrupt) System call (internal, exception) Arithmetic overflow (internal, exception) Invalid instruction (internal, exception) Hardware malfunction (internal or external, exception or interrupt)

Interrupts and Exceptions What to do? Execute code in response to event (handler) Save PC (EPC reg,) Record cause (Cause reg.) Set new PC (4) Return from handler Restore PC Enable e/i (shift Status reg.) Determining type of exception Use vectored exceptions Infer type from address Use polled exceptions Use Cause register This is what MIPS does

Example Implementation Use polled approach All exceptions and interrupts jump to single handler at address 8000 0180 The cause is recorded in the cause register The address of affected instruction is stored in EPC

Example Implementation

Example Implementation