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

Slides:



Advertisements
Similar presentations
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Advertisements

Multicycle Datapath & Control Andreas Klappenecker CPSC321 Computer Architecture.
1 Chapter Five The Processor: Datapath and Control.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
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)
1  1998 Morgan Kaufmann Publishers & Ing-Jer Huang Chapter Five last upate: 6/24/2015.
10/18/2005Comp 120 Fall October Questions? Instruction Execution.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Advanced Computer Architecture 5MD00 / 5Z033 MIPS Design data path and control Henk Corporaal TUEindhoven 2007.
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
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.
Class 9.1 Computer Architecture - HUJI Computer Architecture Class 9 Microprogramming.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
1  1998 Morgan Kaufmann Publishers CH5 Datapath review.
The Multicycle Processor CPSC 321 Andreas Klappenecker.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Computing Systems The Processor: Datapath and Control.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
The Processor: Datapath and Control. Outline Goals in processor implementation Brief review of sequential logic design Pieces of the processor implementation.
Processor: Datapath and Control
Computer Architecture Chapter 5 Fall 2005 Department of Computer Science Kent State University.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
Chapter 5 Processor Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides We're ready to look at an implementation of the MIPS Simplified.
EECS 322: Computer Architecture
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
1  2004 Morgan Kaufmann Publishers Chapter Five.
Multicycle Implementation
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
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.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1. 2 MIPS Hardware Implementation Full die photograph of the MIPS R2000 RISC Microprocessor. The 1986 MIPS R2000 with five pipeline stages and 450,000.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
CS161 – Design and Architecture of Computer Systems
/ Computer Architecture and Design
Systems Architecture I
Extensions to the Multicycle CPU
Five Execution Steps Instruction Fetch
MIPS Instructions.
MIPS Processor.
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
CS/COE0447 Computer Organization & Assembly Language
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
Computer Architecture
Datapath & Control MIPS
Chapter Five The Processor: Datapath and Control
Multicycle Approach We will be reusing functional units
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Multicycle Design.
Basic MIPS Implementation
Review Fig 4.15 page 320 / Fig page 322
Chapter Four The Processor: Datapath and Control
5.5 A Multicycle Implementation
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

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

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

CSCE Datapath

CSCE Instruction Fetch Datapaths PC <= PC + 4 Read_address <= PC

CSCE Register File and ALU

CSCE BEQ Datapath Read_register_1 <= rs Read_register_2 <= rt ALU_in_1 <= (rs) ALU_in_2 <= (rt) Branch_control <= (rs)==(rt)? Branch_target <= PC+4+SE(imm)*4

CSCE Memory and R-type Datapath LW Read_address <= (rs)+SE(imm) ALU_in_1 <= (rs) ALU_in_2 <= SE(imm) Read_register_1 <= rs RegFile(rt) <= Mem((rs)+SE(imm)) Write_register <= rt Reg_write_data <= Read_data SW Read_address <= (rs)+SE(imm) ALU_in_1 <= (rs) ALU_in_2 <= SE(imm) Read_register_1 <= rs Mem((rs)+SE(imm)) <= (rt) Mem_write_data <= (rt) Read_register_2 <= rt R-type RegFile(rd) <= ALU_result ALU_in_1 <= (rs) ALU_in_2 <= (rt) Write_register <= rd Reg_write_data <= ALU_result

CSCE Simple MIPS Datapaths Includes: –PC+4 –LW/SW –BEQ –R-type (add, sub, and, or, slt)

CSCE 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 opcodeALUOpInstructionFunct fieldDesired ALU action ALU control input LW00add0010 SW00add0010 BEQ01subtract0110 R-type10add100000add0010 R-type10sub100010subract0110 R-type10and100100and0000 R-type10or100101or0001 R-type10slt101010set on less than0111

CSCE MIPS Datapath

CSCE MIPS Datapath with Control

CSCE MIPS Datapath with Jump

CSCE 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 readALU Memory access Register write R-typeXXXX LWXXXXX SWXXXX BEQXXX JX

CSCE 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

CSCE Multicycle MIPS Implementation

CSCE 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 –Performed for all instructions –RTL: A <= Reg[IR[25:21]]; B <= Reg[IR[20:16]]; ALUOut <= PC + (sign-extend(IR[15:0]) << 2);

CSCE 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”};

CSCE 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;

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

CSCE Multicycle Control

CSCE 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)

CSCE 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

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

CSCE Example Implementation

CSCE Example Implementation