ECE/CS 552: Multicycle Data Path

Slides:



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

Microprocessor Design Multi-cycle Datapath Nia S. Bradley Vijay.
1 Chapter Five The Processor: Datapath and Control.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 14 - Multi-Cycle.
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.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicI: Building a Multicycle Data Path and a Control Path for a Microprocessor.
331 Lec18.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Lecture 18 Introduction to Pipelined Datapath [Adapted from Dave.
©UCB CS 161Computer Architecture Chapter 5 Lecture 11 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
EECE476 Lectures 10: Multi-cycle CPU Control Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
Preparation for Midterm Binary Data Storage (integer, char, float pt) and Operations, Logic, Flip Flops, Switch Debouncing, Timing, Synchronous / Asynchronous.
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.
Spring W :332:331 Computer Architecture and Assembly Language Spring 2005 Week 11 Introduction to Pipelined Datapath [Adapted from Dave Patterson’s.
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.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
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.
Multicycle Implementation
Chapter 5 Instructor: Mozafar Bag-Mohammadi Spring 2010 Ilam University.
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.
ECE/CS 552: Data Path and Control Instructor:Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes based on set created by Mark Hill.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
RegDst 1: RegFile destination No. for the WR Reg. comes from rd field. 0: RegFile destination No. for the WR Reg. comes from rt field.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 10: Control Design
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Design a MIPS Processor (II)
ECE/CS 552: Single Cycle Control Path
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
IT 251 Computer Organization and Architecture
/ Computer Architecture and Design
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.
Basic MIPS Architecture
Multiple Cycle Implementation of MIPS-Lite CPU
Chapter Five The Processor: Datapath and Control
Multicycle Approach Break up the instructions into steps
The Multicycle Implementation
Vishwani D. Agrawal James J. Danaher Professor
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
Instructor: Mozafar Bag-Mohammadi Spring 2006 University of Ilam
Processor: Multi-Cycle Datapath & Control
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Chapter Four The Processor: Datapath and Control
Finite State Machine for Control
Control Unit for Multiple Cycle Implementation
5.5 A Multicycle Implementation
Processor Design Datapath and Design.
Systems Architecture I
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
Alternative datapath (book): Multiple Cycle Datapath
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

ECE/CS 552: Multicycle Data Path © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim Smith

Multi-cycle Implementation Clock period tcycle = max(i-mem, reg-read+reg-write, ALU, d-mem) Reuse combinational logic on different cycles One memory One ALU without other adders But Control is more complex Need new registers to save values (e.g. IR) Used again on later cycles Logic that computes signals is reused

High-level Multi-cycle Datapath Note: Instruction register, memory data register One memory with address bus One ALU with ALUOut register

Comment on busses Share wires to reduce #signals Distributed multiplexor Multiple sources driving one bus Ensure only one is active!

Multi-cycle Ctrl Signals

Multi-cycle Steps Step Description Sample Actions IF Fetch ID Decode IR=MEM[PC] PC=PC+4 ID Decode A=RF(IR[25:21]) B=RF(IR[20:16]) Target=PC+SE(IR[15:0] << 2) EX Execute ALUout = A + SE(IR[15:0]) # lw/sw ALUout = A op B # rrr if (A==B) PC = target # beq Mem Memory MEM[ALUout] = B # sw MDR = MEM[ALUout] #lw RF(IR[15:11]) = ALUout # rrr WB Writeback Reg(IR[20:16]) = MDR # lw

Multi-cycle Control Function of Op[5:0] and current step Defined as Finite State Machine (FSM) or Micro-program or microcode outputs Next State State Fn Output Fn Current state Inputs

Finite State Machine (FSM) For each state, define: Control signals for datapath for this cycle Control signals to determine next state All instructions start in same IF state Instructions terminate by making IF next After proper PC update, of course

Multi-cycle Examples Datapath Look at control FSM Will walk and $1, $2, $3 through datapath Look at control FSM Will walk and $1, $2, $3 through FSM Repeat for lw, sw, beq taken, beq n-t, j

Multi-cycle Example (and) PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB

Multi-cycle Example (and)

Nuts and Bolts--More on FSMs You will use FSM control for parts of your processor implementation There are multiple methods for specifying a state machine Moore machine (output is function of state only) Mealy machine (output is function of state/input) There are different methods of assigning states

FSMs--State Assignment State assignment is converting logical states to binary representation Use ECE 352 methods to build real state machine Is state assignment interesting/important? Judicious choice of state representation can make next state fcn/output fcn have fewer gates Optimal solution is hard, but having intuition is helpful (CAD tools can also help in practice)

State Assignment--Example 10 states in multicycle control FSM Each state can have 1 of 16 (2^4) encodings with “dense” state representation Any choice of encoding is fine functionally as long as all states are unique (8008 options) Example: RegWrite signal

State Assignment, RegWrite Signal PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB State 1 State 2 State 6 State 8 State 9 State 8 (1000b) State 4 State 7 State 9 (1001b) State 5 State 3 State 7 (0111b) State 4 (0100b) Original: 2 inverters, 2 and3s, 1 or2 New: No gates--just bit 3!

Multi-cycle Example (lw) PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB

Multi-cycle Example (lw)

Multi-cycle Example (sw) PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB

Multi-cycle Example (sw)

Multi-cycle Example (beq T) PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB

Multi-cycle Example (beq T)

Multi-cycle Example (beq NT)

Multi-cycle Example (j) PCWrite PCSource = 10 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 ALUOp = 10 MemRead IorD = 1 MemWrite RegDst = 1 RegWrite MemtoReg = 0 RegDst = 0 MemtoReg = 1 Start ALUSrcA=0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCSrc = 00 ALUSrcA = 0 ALUSrcB = 11 ALUSrcB = 10 LW | SW RRR BEQ J LW SW IF ID EX MEM WB

Multi-cycle Example (j)

Summary Processor implementation Multicycle implementation Datapath Control Multicycle implementation