1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Lab Assignment 2: MIPS single-cycle implementation
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
The Processor: Datapath & Control
The Processor Data Path & Control Chapter 5 Part 2 - Multi-Clock Cycle Design N. Guydosh 2/29/04.
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
The Multicycle Processor CPSC 321 Andreas Klappenecker.
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.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
COMP541 Multicycle MIPS Montek Singh Apr 8, 2015.
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.
ECE 445 – Computer Organization
COMP541 Datapaths II & Single-Cycle MIPS
CDA 3101 Fall 2013 Introduction to Computer Organization
1 COMP541 Pipelined MIPS Montek Singh Mar 30, 2010.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
W.S Computer System Design Lecture 4 Wannarat Suntiamorntut.
Datapath and Control Unit Design
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
1 COMP541 Datapaths II & Control I Montek Singh Mar 22, 2010.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
1 COMP541 Pipelined MIPS Montek Singh Apr 9, 2012.
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
LECTURE 7 Pipelining. DATAPATH AND CONTROL We started with the single-cycle implementation, in which a single instruction is executed over a single cycle.
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.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
Introduction to Computer Organization Pipelining.
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.
MIPS processor continued. Performance Assume that – Memory access: 200ps – ALU and adders: 100 ps – Register file read: 50ps – Register file write: 10ps.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 10: Control Design
MIPS Processor.
MIPS processor continued. Review Different parts in the processor should be connected appropriately to be able to carry out the functions. Connections.
Lecture 9. MIPS Processor Design – Single-Cycle Processor Design Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
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.
Lecture 5. MIPS Processor Design
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Chapter 7 Digital Design and Computer Architecture, 2 nd Edition Chapter 7 David Money Harris and Sarah L. Harris.
Design of Digital Circuits Lecture 14: Microprogramming
Computer Organization
COMP541 Datapaths I Montek Singh Mar 28, 2012.
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
Design of the Control Unit for Single-Cycle Instruction Execution
CSCI206 - Computer Organization & Programming
Design of the Control Unit for One-cycle Instruction Execution
MIPS Processor.
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.2: Building a Datapath with Control
MIPS Microarchitecture Multicycle Processor
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Review Fig 4.15 page 320 / Fig page 322
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012

Topics  Issue w/ single cycle  Multicycle MIPS State elements State elements  Now add registers between stages How to control How to control Performance Performance 2

Multicycle MIPS Processor  Single-cycle microarchitecture: + simple - cycle time limited by longest instruction ( lw ) - two adders/ALUs and two memories  Multicycle microarchitecture: + higher clock speed + simpler instructions run faster + reuse expensive hardware on multiple cycles - sequencing overhead paid many times  Same design steps: datapath & control

Multicycle State Elements  Replace Instruction and Data memories with a single unified memory More realistic More realistic

Multicycle Datapath: lw instr fetch  First consider executing lw  STEP 1: Fetch instruction

Multicycle Datapath: lw register read

Multicycle Datapath: lw immediate

Multicycle Datapath: lw address

Multicycle Datapath: lw memory read

Multicycle Datapath: lw write register

Multicycle Datapath: increment PC Now using main ALU when it’s not busy (instead of dedicated adder)

Multicycle Datapath: sw  Compared to lw addr generated as for lw addr generated as for lw write data in rt to memory write data in rt to memory

Multicycle Datapath: R-type Instrs.  Read from rs and rt  Write ALUResult to register file  Write to rd (instead of rt )

Multicycle Datapath: beq  2 tasks Determine whether values in rs and rt are equal Determine whether values in rs and rt are equal Calculate branch target address: Calculate branch target address:  BTA = (sign-extended immediate << 2) + (PC+4)  ALU reused!

Complete Multicycle Processor

Control Unit

Main Controller FSM: Fetch

Fetch instruction Also increment PC (because ALU not in use) Note: signals only shown when needed and enables only when asserted.

Main Controller FSM: Decode No signals needed for decode Register values also fetched Perhaps will not be used

Main Controller FSM: Address Calculation Now change states depending on instr

Main Controller FSM: Address Calculation For lw or sw, need to compute addr

Main Controller FSM: lw For lw now need to read from memory Then write to register

Main Controller FSM: sw sw just writes to memory One step shorter

Main Controller FSM: R-Type The r-type instructions have two steps: compute result in ALU and write to reg

Main Controller FSM: beq beq needs to use ALU twice, so consumes two cycles One to compute addr Another to decide on eq Can take advantage of decode when ALU not used to compute BTA (no harm if BTA not used)

Complete Multicycle Controller FSM

Main Controller FSM: addi Similar to r-type Add Write back

Main Controller FSM: addi

Extended Functionality: j

Control FSM: j

Multicycle Performance  Instructions take different number of cycles: 3 cycles: beq, j 3 cycles: beq, j 4 cycles: R-Type, sw, addi 4 cycles: R-Type, sw, addi 5 cycles: lw 5 cycles: lw  CPI is weighted average  SPECINT2000 benchmark: 25% loads 25% loads 10% stores 10% stores 11% branches 11% branches 2% jumps 2% jumps 52% R-type 52% R-type  Average CPI = ( )(3) + ( )(4) + (0.25)(5) = 4.12

Multicycle Performance Multicycle critical path: T c = t pcq + t mux + max(t ALU + t mux, t mem ) + t setup

Multicycle Performance Example T c = t pcq_PC + t mux + max(t ALU + t mux, t mem ) + t setup = t pcq_PC + t mux + t mem + t setup = [ ] ps = 325 ps

Multicycle Performance Example  For a program with 100 billion instructions executing on a multicycle MIPS processor CPI = 4.12 CPI = 4.12 T c = 325 ps T c = 325 ps  Execution Time = (# instructions) × CPI × T c = (100 × 10 9 )(4.12)(325 × ) = (100 × 10 9 )(4.12)(325 × ) = seconds = seconds This is slower than the single-cycle processor (92.5 seconds). Why? This is slower than the single-cycle processor (92.5 seconds). Why?  Not all steps the same length  Sequencing overhead for each step (t pcq + t setup = 50 ps)

Review: Single-Cycle MIPS Processor

Review: Multicycle MIPS Processor

Next Time  Next class: We’ll look at pipelined MIPS We’ll look at pipelined MIPS Improving throughput (and adding complexity!) by trying to use all hardware every cycle Improving throughput (and adding complexity!) by trying to use all hardware every cycle  Next lab (Lab 10) See website See website A full mini MIPS processor A full mini MIPS processor 38