Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.

Slides:



Advertisements
Similar presentations
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
Advertisements

1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Microprocessor Design Multi-cycle Datapath Nia S. Bradley Vijay.
CSE 308 – Computer Architecture Prof. Muhamed Mudawar Computer Engineering Department King Fahd University of Petroleum and Minerals Multicycle Implementation.
1 Chapter Five The Processor: Datapath and Control.
The Processor: Datapath & Control
The Processor Data Path & Control Chapter 5 Part 2 - Multi-Clock Cycle Design N. Guydosh 2/29/04.
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
EECE476 Lecture 9: Multi-cycle CPU Datapath Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
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.
CS 161Computer Architecture Chapter 5 Lecture 12
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
©UCB CS 161Computer Architecture Chapter 5 Lecture 11 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
1. 2 Multicycle Datapath  As an added bonus, we can eliminate some of the extra hardware from the single-cycle datapath. —We will restrict ourselves.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
CMPE 421 Advanced Computer Architecture Supplementary material for Pipelining PART1.
EECS 322 Sample Test 2 Solutions Wednesday March 21, 2001 Problem 1 (50%): A group of EECS students have decided to compete with Intel Corporation in the.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
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.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
Chapter 5 Instructor: Mozafar Bag-Mohammadi Spring 2010 Ilam University.
IT 251 Computer Organization and Architecture Multi Cycle CPU Datapath Chia-Chi Teng.
LECTURE 6 Multi-Cycle Datapath and Control. SINGLE-CYCLE IMPLEMENTATION As we’ve seen, single-cycle implementation, although easy to implement, could.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Fall 2015, Sep ELEC / Lecture 5 1 ELEC / Computer Architecture and Design Fall 2015 Datapath and Control (Chapter.
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.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 10: Control Design
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 7: Multicycle CPU Instructor: Francis G. Wolff Case Western Reserve University.
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.
1 The final datapath. 2 Control  The control unit is responsible for setting all the control signals so that each instruction is executed properly. —The.
EECS 322 Test 3 SolutionsWednesday March 22, 2000 Problem 1 (50%): A group of EECS students have decided to compete with Intel Corporation in the microcontroller.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Design a MIPS Processor (II)
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
Computer Architecture
IT 251 Computer Organization and Architecture
ECE/CS 552: Multicycle Data Path
Systems Architecture I
Multi-Cycle CPU.
Extensions to the Multicycle CPU
Single Cycle Processor
D.4 Finite State Diagram for the Multi-cycle processor
Multi-Cycle CPU.
MIPS processor continued
Multicycle Approach Break up the instructions into steps
The Multicycle Implementation
Processor: Datapath and Control (part 2)
Chapter Five The Processor: Datapath and Control
The Multicycle Implementation
Systems Architecture I
Vishwani D. Agrawal James J. Danaher Professor
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Chapter Four The Processor: Datapath and Control
5.5 A Multicycle Implementation
MIPS processor continued
Systems Architecture I
FloorPlan for Multicycle MIPS
The Processor: Datapath & Control.
Presentation transcript:

Datapath and Control: MultiCycle Implementation

Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and adders : 100 ps Register File (read or write): 50 ps Mux, control unit, PC access, sign extension unit, wires : 0 ps Instr. ClassFunctional units used Total time R-type Instr. Fetch (200 ps) Reg access (50 ps) ALU (100 ps) Reg access (50 ps) 400ps Load word Instr. Fetch (200 ps) Reg access (50 ps) ALU (100 ps) Mem. Access (200 ps) Register access (50 ps) 600 ps Store Word Instr. Fetch (200 ps) Reg access (50 ps) ALU (100 ps) Mem. Access (200 ps) 550 ps Branch Instr. Fetch (200 ps) Reg access (50 ps) ALU (100 ps) 350 ps Jump Instr. Fetch (200 ps) 200 ps Clock cycle must cover longest instruction  cycle period = 600ps (inefficient!)

Clocking: single-cycle vs. multicycle Single-cycle Implementation add $t0,$t1,$t2 beq $t0,$t1,L waste clock

Multicycle Implementation °Instruction execution divided into steps °Each step will take one clock cycle (not each instruction) [CPI > 1]  shorter clock cycle: cycle time constrained by longest step, not longest instruction °simpler instructions take fewer cycles  higher overall performance

Clocking: single-cycle vs. multicycle add $t0,$t1,$t2 beq $t0,$t1,L Single-cycle Implementation Multicycle Implementation add $t0,$t1,$t2 beq $t0,$t1,L Multicycle Implementation: less waste=higher performance waste clock

How fast can we run the clock? °Depends on how much we want done per clock cycle Can do: several “inexpensive” datapath operations per clock -simple gates (AND, OR, …) -single datapath registers (PC) -sign extender, left shifter, multiplexor PLUS: exactly one “expensive” datapath operation per clock -ALU operation -Register File access (2 reads, or 1 write) -Memory access (read or write)

Multicycle Instruction Execution 1: fetch instruction, PC=PC+4 2: decode, fetch registers, branch target 3: execute/compute data address/branch 4: access memory/complete R-type 5: store memory content to register

Recall: Single Cycle Datapath and Control

Steps CycleR-format Load Word (lw) Store Word (sw) beq 1 Fetch instr, PC = PC+4 Fetch instr. PC = PC+4 Fetch instr, PC = PC+4 Fetch instr, PC = PC+4 2 Read registers, calculate branch target address Read registers, calc branch target address 3Do computation Calc data address Compare reg values, set PC 4 Write result to register Read data memory Write to data memory 5Write data to register

Multicycle Datapath (overview) Registers Read Reg1 ALUALU Read Reg2 Write Reg Data PCPC Address Instruction or Data Memory MIPS-lite Multicycle Version A B ALU- Out Instruction Register Data Memory Data Register Read data 1 Read data 2 One ALU (no extra adders) One Memory (no separate Imem, Dmem) New Temporary Registers

Multicycle Implementation °Datapath changes one memory: both instructions and data (because can access on separate steps) one ALU (eliminate extra adders) extra “invisible” registers to capture intermediate (per-step) datapath results

Multicycle Datapath: Add Multiplexors ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 zero 15:11 Note inputs to multiplexors

Multicycle Datapath: Add Multiplexors ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 zero 15:11 Note inputs to multiplexors

Datapath + Control Points ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD MemRead MemWrite IRWrite RegDst RegWrite ALUSrcA ALUSrcB MemtoReg ALU Control ALUOp (funct) 5:0 MuxMux PCSrc PCWrite PCWrite- Cond

Cycle 1 Datapath: IR=Mem[PC]; PC=PC+4 ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 ALU Control 2 4 (funct) 5:0 MuxMux IR=Mem[PC]; PC=PC+4 IorD=0 MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=0 ALUSrcB=01 MemtoReg=x ALUOp=00 2 PCSrc=0 PCWrite PCWrite- Cond

Cycle 2: A=Reg[IR25:21]; B=Reg[IR20:16]; ALUOut= PC + sgn-ext(IR15:0) << 2 ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 ALU Control (funct) 5:0 MuxMux A=Reg[IR 25:21 ]; B=Reg[IR 20:16 ]; ALUOut= PC + sgn-ext(IR 15:0 ) << 2 IorD=x MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=0 ALUSrcB=11 MemtoReg=x ALUOp=00 2 PCSrc=x PCWrite PCWrite- Cond

Cycle 3: R-format: ALUOut = A op B ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 ALU Control 2 4 (funct) 5:0 MuxMux ALUOut=A op B IorD=x MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=1 ALUSrcB=00 MemtoReg=x ALUOp=10 2 PCSrc=x PCWrite PCWrite- Cond

Cycle 4 R-format: Reg[IR15:11] = ALUOut ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 ALU Control 2 4 (funct) 5:0 MuxMux Reg[IR 15:11 ] = ALUOut IorD=x MemRead MemWrite IRWrite RegDst=1 RegWrite ALUSrcA=x ALUSrcB=x MemtoReg=0 ALUOp=x 2 PCSrc=x PCWrite PCWrite- Cond

Cycle 3 beq: if (A==B) PC =ALUOut ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 ALU Control 2 4 (funct) 5:0 MuxMux if (A==B) PC =ALUOut IorD=x MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=1 ALUSrcB=00 MemtoReg=x ALUOp=01 2 PCSrc=01 PCWrite PCWrite- Cond

Cycle 3 lw/sw: ALUOut = A + sgn-ext(IR15:0) ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD=x MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=1 ALUSrcB=10 MemtoReg=x ALU Control ALUOp= (funct) 5:0 MuxMux PCSrc=x PCWrite PCWrite- Cond ALUOut = A + sgn-ext(IR 15:0 )

Cycle 4 lw : MDR = Mem[ALUout] ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD=1 MemRead MemWrite IRWrite RegDst=x RegWrite ALUSrcA=x ALUSrcB=x MemtoReg=x ALU Control ALUOp=x (funct) 5:0 MuxMux PCSrc=x PCWrite PCWrite- Cond MDR = Mem[ALUout]

Cycle 5 lw: Reg[IR15:11] = MDR ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD=x MemRead MemWrite IRWrite RegDst=0 RegWrite ALUSrcA=x ALUSrcB=x MemtoReg=1 ALU Control ALUOp=x (funct) 5:0 MuxMux PCSrc=x PCWrite PCWrite- Cond Reg[IR 15:11 ] = MDR

Cycle 4 ( sw ): Mem[ALUOut] = B ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD=1 MemRead MemWrite IRWrite RegDst RegWrite ALUSrcA ALUSrc MemtoReg ALU Control ALUOp (funct) 5:0 MuxMux PCSrc PCWrite PCWrite- Cond Mem[ALUOut] = B

Datapath + Control Points ALUALU Regs Read Reg1 Read data1 Read data2 Read Reg2 Write Reg Write Data Sgn Ext- end PCPC << 2 A B ALU- Out Address Read Data Mem Write Data MDRMDR MuxMux 25:21 20:16 15:0 0 1M2 u 3 x MuxMux MuxMux MuxMux IR 4 z 15:11 IorD MemRead MemWrite IRWrite RegDst RegWrite ALUSrcA ALUSrcB MemtoReg ALU Control ALUOp (funct) 5:0 MuxMux PCSrc PCWrite PCWrite- Cond

Complete datapath

Fig Summary of steps taken

All write control signals not asserted explicitly are deasserted All Multiplexer controls not specified explicitly are don’t care asserted if name only otherwise exact value 1 FSM for Main Control Unit 0

Main Control Unit