Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

Microprocessor Design Multi-cycle Datapath Nia S. Bradley Vijay.
1 Chapter Five The Processor: Datapath and Control.
The Processor: Datapath & Control
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.
CSE378 Multicycle impl,.1 Drawbacks of single cycle implementation All instructions take the same time although –some instructions are longer than others;
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.
331 W9.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 9 Building a Single-Cycle Datapath [Adapted from Dave Patterson’s.
331 Lec18.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Lecture 18 Introduction to Pipelined Datapath [Adapted from Dave.
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.
Spring W :332:331 Computer Architecture and Assembly Language Spring 2005 Week 11 Introduction to Pipelined 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.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
CSE331 W10&11.1Irwin Fall 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 10 & 11 Section 1: Mary Jane Irwin (
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
Computer Organization CS224 Chapter 4 Part b The Processor Spring 2010 With thanks to M.J. Irwin, T. Fountain, D. Patterson, and J. Hennessy for some lecture.
EE204 L12-Single Cycle DP PerformanceHina Anwar Khan EE204 Computer Architecture Single Cycle Data path Performance.
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.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
IT 251 Computer Organization and Architecture Multi Cycle CPU Datapath Chia-Chi Teng.
CSE331 W10.1Irwin&Li Fall 2006 PSU CSE 331 Computer Organization and Design Fall 2006 Week 10 Section 1: Mary Jane Irwin (
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 ( )
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.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
EI209 Chapter 4B.1Haojin Zhu, SJTU 2015 EI 209 Computer Organization Fall 2015 Chapter 4B: The Processor, Control and Multi-cycle Datapath [Adapted from.
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.
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.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Design a MIPS Processor (II)
CSE 331 Computer Organization and Design Fall 2007 Week 10 & 11
CS Computer Architecture Week 10: Single Cycle Implementation
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
CS161 – Design and Architecture of Computer Systems
IT 251 Computer Organization and Architecture
Systems Architecture I
Multi-Cycle 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
Multicycle Approach Break up the instructions into steps
Chapter Five The Processor: Datapath and Control
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
Control Unit for Multiple Cycle Implementation
5.5 A Multicycle Implementation
Systems Architecture I
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
The Processor: Datapath & Control.
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data

Single Cycle Implementation Cycle Time  Unfortunately, though simple, the single cycle approach is not used because it is inefficient  Clock cycle must have the same length for every instruction  What is the longest path (slowest instruction)?  Calculate cycle time assuming negligible delays (for muxes, control unit, sign extend, PC access, shift left 2, wires) except:  Instruction and Data Memory (2ns)  ALU and adders (2ns)  Register File access (reads or writes) (1ns)  floating point operations even longer

Instruction Critical Paths Instr.I MemReg RdALU OpD MemReg WrTotal delay (ns) R-type load store beq jump

 A floating point add.d = Instr. Fetch (2 ns)+ Reg. Read (1 ns)+ ALU add(8 ns)+ Reg. Write (1 ns)= 12 ns  Floating point load l.s =2+1+2(ALUop)+2(data mem)+1 (Reg.) = 8 ns  Floating point store s.s =2+1+2(ALU)+2(data mem) = 7 ns.  The longest instruction is floating point multiply mul = Inst. Fetch (2 ns)+Reg. Read (1 ns)+ALU multiply (16 ns)+ Reg. Write (1 ns) = 20 ns  Floating point branch = 5 ns, floating point jump=2 (fetch)  If clock period is variable in length, then we need to look at instruction frequency. For example Loads (31%), stores (21%), R- type (27%), beq(5%), j (2%), add.d, sub.d (7%), mult.d, div.d(7%).  Combining to compute the clock cycle=8x31%+7x21%+6x27%+5x5%+2x2%+20x7%+12x7%= 7 ns What about floating point operations?

 Instead of a fixed cycle time, we allow cycle time to depend on instruction class.  We can then compare performance, considering that CPI will still be 1, and Instruction count does not change. Perf. CPU variable cycle time = CPU exec. time fixed cycle time Perf. CPU fixed cycle time CPU exec. time var. cycle time = Clock period fixed Clock period variable  because performance= _____________1______________ ) Instr. Count x CPI x Clock Period  Performance improvement = 20 ns (fixed cycle clock period) = 2.86 faster 7 ns (variable cycle clock period) What about variable cycle length?

 Single cycle/instr. datapath is wasteful of area since some functional units must be duplicated since they can not be “shared” during an instruction execution  e.g., need separate adders to do PC update and branch target address calculations, as well as an ALU to do R- type arithmetic/logic operations and data memory address calculations Where We are Headed  Single cycle/instr. uses the clock cycle inefficiently – the clock cycle must be timed to accommodate the slowest instruction – we cannot make common case fast.  especially problematic for more complex instructions like floating point multiplications

 Another approach  use a “smaller” cycle time  have different instructions take different number of cycles  a “multi-cycle” datapath Where We are Headed Address Read Data (Instr. or Data) Memory PC Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU Write Data IR MDR A B ALUout

Multicycle Implementation Overview  Each step in the execution of an instruction takes 1 clock cycle  An instruction takes more than 1 clock cycle to complete  Not every instruction takes the same number of clock cycles to complete  Multi-cycle implementations allow functional units to be used more than once per instruction as long as they are used on different clock cycles, as a result  we need only one memory  we need only one ALU/adder  We can have faster clock rates

The Multicycle Datapath – A High Level View PC Address Read Data (Instr. or Data) Memory Write Data A B ALU ALUout IR MDR Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 u Registers have to be added after every major functional unit to hold the intermediate output value until that intermediate result is used in a subsequent clock cycle

The Multicycle Datapath – A High Level View u All internal registers hold the intermediate output value until it is used in a subsequent clock cycle of that instruction, thus do not need a dedicated control signal.  The only exception is the Instruction Register (IR), which needs to hold the instruction bits for several cycles, until the instruction finishes its execution.  Thus it needs a control signal which allows it to be written into - IRWrite u Data used by subsequent instructions are stored in programmer visible elements (like Register File, PC or memory)

u Break up the instructions into steps where each step takes a cycle while trying to –balance the amount of work to be done in each step –restrict each cycle to use only one major functional unit u Thus each cycle can at most do one of the following operations – a memory access or – a register file access (two reads or one write), or – an ALU operation Multicycle Approach

Clocking the Multicycle Datapath Address Read Data (Instr. or Data) Memory PC Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU Write Data IR MDR A B ALUout System Clock MemWriteRegWrite clock cycle IRWrite simplified

u Reading/writing to any of the internal registers (except IR) or to the PC occurs (quickly) at the end of a clock cycle u reading/writing to the register file takes ~50% of a clock cycle since it has additional control and access overhead (reading can be done in parallel with instruction decode) u All operations occurring in one step occur in parallel within the same clock cycle u This limits us to one ALU operation, one memory access, and one register file access per step (per clock cycle) Multicycle Approach, continued

PC Address Read Data (Instr. or Data) Memory Write Data A B ALU ALUout IR MDR Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 The Multicycle Datapath – A High Level View u Need more multiplexors to direct the datapath to fewer logical units

Multiplexors used in multicycle datapath IorD  The first multiplexor determines whether memory address input comes from the PC (for instruction fetching) or from the ALU (for lw, sw instructions) 1 0 PC Address Read Data (Instr. or Data) Memory ALUOut u The second multiplexor determines whether input to the ALU first port is from internal register A (during R-type operations for example), or from the PC (to compute the next PC value). ALUSrcA ALU ALUout zero 1 0 PC A

Multiplexors used in multicycle datapath u The third multiplexor determines whether input to the ALU second port comes from Internal register B (for R-type instructions), a constant 4 (to increment the PC), the sign-extended Instruction [15-0] bits (for immediate operations), or those bits shifted left by 2 (for branch operations) ALUSrcB ALU zero Sign Extend Instr[15-0] 32 Shift left 2 B 4 2

u The fourth multiplexor determines the address of the destination register in the Register File, whether input comes from Instr[20-16] bits or from Instr[15-11] bits (this is the same with the single- cycle/instruction datapath. u Another multiplexer determines whether data to be written in the Register File comes from the Memory Data Register or from ALUout.  Finally, there is a four-way multiplexor to determine what is written into the PC. Its control signal is PCSource Multiplexors used in multicycle datapath PC PCWrite (PC+4)ALU result ALUout Shift left 2 Instr[25-0] PC[31-28] 28 PCWriteCond ALU zero output PCSouorce 2

The Complete Multicycle Data with Control Address Read Data (Instr. or Data) Memory IR MDR Read Addr 2 Read Addr 1 Register File Shift left 2 Read Data 1 Read Data 2 A B Write Data ALU control IRWrite MemtoReg MemWrite MemRead IorD PCWrite RegDst RegWrite ALUSrcA ALUSrcB ALUOp ALU ALUout zero PCSource 1 0 Write Data 1 0 Write Addr Instr[5-0] Control Instr[31-26] 1 0 PC Sign Extend Instr[15-0] 32 Shift left 2 Instr[25-0] PC[31-28] 28 PCWriteCond