Pipeline Exceptions & ControlCSCE430/830 Pipelining in MIPS MIPS architecture was designed to be pipelined –Simple instruction format (makes IF, ID easy)

Slides:



Advertisements
Similar presentations
ILP: IntroductionCSCE430/830 Instruction-level parallelism: Introduction CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
Advertisements

Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
1 A few words about the quiz Closed book, but you may bring in a page of handwritten notes. –You need to know what the “core” MIPS instructions do. –I.
Pipelined Processor II (cont’d) CPSC 321
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Pipelined Processor.
Computer Organization
The Processor: Datapath & Control
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 18 - Pipelined.
Pipelining III Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Six Enhancing Performance with Pipelining
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
EECC550 - Shaaban #1 Selected Chapter 5 For More Practice Exercises Winter The MIPS jump and link instruction, jal is used to support procedure.
Computer Architecture - A Pipelined Datapath A Pipelined Datapath  Resisters are used to save data between stages. 1/14.
Supplementary notes for pipelining LW ____,____ SUB ____,____,____ BEQ ____,____,____ ; assume that, condition for branch is not satisfied OR ____,____,____.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
Pipelined Datapath and Control
Electrical and Computer Engineering University of Cyprus LAB3: IMPROVING MIPS PERFORMANCE WITH PIPELINING.
CMPE 421 Parallel Computer Architecture Part 2: Hardware Solution: Forwarding.
1/24/ :00 PM 1 of 86 Pipelining Chapter 6. 1/24/ :00 PM 2 of 86 Overview of Pipelining Pipelining is an implementation technique in which.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
Introduction to Computer Organization Pipelining.
MIPS processor continued
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Pipelining: Implementation CPSC 252 Computer Organization Ellen Walker, Hiram College.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
MIPS Microarchitecture Single-Cycle Processor Control
Note how everything goes left to right, except …
CDA 3101 Spring 2016 Introduction to Computer Organization
Computer Architecture
CSCI206 - Computer Organization & Programming
Basic Pipeline Datapath
Test 2 review Lectures 5-10.
Single Clock Datapath With Control
Single Cycle Processor
ECS 154B Computer Architecture II Spring 2009
CDA 3101 Spring 2016 Introduction to Computer Organization
\course\cpeg323-08F\Topic6b-323
Discussion Session Week 10
MIPS processor continued
Test 2 review Lectures 5-10.
Forwarding Now, we’ll introduce some problems that data hazards can cause for our pipelined processor, and show how to handle them with forwarding.
Morgan Kaufmann Publishers The Processor
SOLUTIONS CHAPTER 4.
Single-cycle datapath, slightly rearranged
A pipeline diagram Clock cycle lw $t0, 4($sp) IF ID
CSCI206 - Computer Organization & Programming
Systems Architecture II
CSCI206 - Computer Organization & Programming
\course\cpeg323-05F\Topic6b-323
CSE378 Midterm Review Moore’s Law -- What are the two versions?
Composing the Elements
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Pipelining: Basic Concepts
MIPS processor continued
Introduction to Computer Organization and Architecture
Pipelining Chapter 6.
Control Unit (single cycle implementation)
Pipelining - 1.
A relevant question Assuming you’ve got: One washer (takes 30 minutes)
The Processor: Datapath & Control.
Problem ??: (?? marks) Consider executing the following code on the MIPS pipelined datapath: add $t5, $t6, $t8 add $t9, $t5, $t4 lw $t3, 100($t9) sub $t2,
©2003 Craig Zilles (derived from slides by Howard Huang)
Pipelined datapath and control
ELEC / Computer Architecture and Design Spring 2015 Pipeline Control and Performance (Chapter 6) Vishwani D. Agrawal James J. Danaher.
Presentation transcript:

Pipeline Exceptions & ControlCSCE430/830 Pipelining in MIPS MIPS architecture was designed to be pipelined –Simple instruction format (makes IF, ID easy) »Single-word instructions »Small number of instruction formats »Common fields in same place (e.g., rs, rt) in different formats –Memory operations only in lw, sw instructions (simplifies EX) –Memory operands aligned in memory (simplifies MEM) –Single value for Write-Back (limits forwarding) Pipelining is harder in CISC architectures

Pipeline Exceptions & ControlCSCE430/830 Pipelined Datapath with Control Signals

Pipeline Exceptions & ControlCSCE430/830 Next Step: Adding Control Basic approach: build on single-cycle control –Place control unit in ID stage –Pass control signals to following stages Later: extra features to deal with: –Data forwarding –Stalls –Exceptions

Pipeline Exceptions & ControlCSCE430/830 Control for Pipelined Datapath RegDst ALUOp[1:0] ALUSrc MemRead MemWrite Branch RegWrite MemtoReg

Pipeline Exceptions & ControlCSCE430/830 Control for Pipelined Datapath

Pipeline Exceptions & ControlCSCE430/830 Datapath and Control Unit

Pipeline Exceptions & ControlCSCE430/830 Tracking Control Signals - Cycle 1 LW

Pipeline Exceptions & ControlCSCE430/830 Tracking Control Signals - Cycle 2 SWLW

Pipeline Exceptions & ControlCSCE430/830 Tracking Control Signals - Cycle 3 ADDSWLW

Pipeline Exceptions & ControlCSCE430/830 Tracking Control Signals - Cycle 4 SUBADD SW LW 1 0 0

Pipeline Exceptions & ControlCSCE430/ ADD Tracking Control Signals - Cycle 5 SUB SW LW

Pipeline Exceptions & ControlCSCE430/830 Class Exercise Consider the following code segment 1. LW R1, 0(R4) 2. LW R2, 0(R5) 3. ADD R3, R1, R2 4. BNZ R3, L 5. LW R4, 100(R1) 6. LW R5, 100(R2) 7. SUB R3, R4, R5 8.L: SW R3, 50(R1) Assuming that there is no forwarding, zero testing is being resolved during ID, and registers can be written in the first half of the WB cycle and also be read in the send half of the same WB cycle, Question: identify the resources of various hazards in the above code sequence.

Pipeline Exceptions & ControlCSCE430/830 Class Exercise Consider the following code segment 1. LW R1, 0(R4) 2. LW R2, 0(R5) 3. ADD R3, R1, R2 4. BNZ R3, L 5. LW R4, 100(R1) 6. LW R5, 100(R2) 7. SUB R3, R4, R5 8.L: SW R3, 50(R1) Assuming that there is no forwarding, zero testing is being resolved during ID, and registers can be written in the first of the WB cycle and also be read in the send half of the same WB cycle, Question: identify the resources of various hazards in the above code sequence.

Pipeline Exceptions & ControlCSCE430/830 Class Exercise Consider the following code segment 1. LW R1, 0(R4) 2. LW R2, 0(R5) 3. ADD R3, R1, R2 4. BNZ R3, L 5. LW R4, 100(R1) 6. LW R5, 100(R2) 7. SUB R3, R4, R5 8.L: SW R3, 50(R1) Use compiler techniques to reshuffle/rewrite the code (without changing the meaning of the program) as to minimize data hazards as far as possible. Assume that no other general purpose registers other than those used in the code, are available.

Pipeline Exceptions & ControlCSCE430/830 Class Exercise Consider the following code segment 1. LW R1, 0(R4) 2. LW R2, 0(R5) 3. ADD R3, R1, R2 4. BNZ R3, L 5. LW R4, 100(R1) 6. LW R5, 100(R2) 7. SUB R3, R4, R5 8.L: SW R3, 50(R1) 1. LW R1, 0(R4) 2. LW R2, 0(R5) 3. LW R4, 100(R1) 4. LW R5, 100(R2) 5. ADD R3, R1, R2 6. BNZ R3, L 7. SUB R3, R4, R5 8.L: SW R3, 50(R1)