Forwarding and Hazards MemberRole William ElliottTeam Leader Jessica Tyler ShulerWiki Specialist Tyler KimseyLead Engineer Cameron CarrollEngineer Danielle.

Slides:



Advertisements
Similar presentations
Morgan Kaufmann Publishers The Processor
Advertisements

COMP381 by M. Hamdi 1 (Recap) Pipeline Hazards. COMP381 by M. Hamdi 2 I n s t r. O r d e r add r1,r2,r3 sub r4,r1,r3 and r6,r1,r7 or r8,r1,r9 xor r10,r1,r11.
1 Pipelining Part 2 CS Data Hazards Data hazards occur when the pipeline changes the order of read/write accesses to operands that differs from.
Advanced Computer Architectures Laboratory on DLX Pipelining Vittorio Zaccaria.
COMP25212 Further Pipeline Issues. Cray 1 COMP25212 Designed in 1976 Cost $8,800,000 8MB Main Memory Max performance 160 MFLOPS Weight 5.5 Tons Power.
Data Dependencies Describes the normal situation that the data that instructions use depend upon the data created by other instructions, or data is stored.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Pipelining - Hazards.
Instruction-Level Parallelism (ILP)
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.
1 IF IDEX MEM L.D F4,0(R2) MUL.D F0, F4, F6 ADD.D F2, F0, F8 L.D F2, 0(R2) WB IF IDM1 MEM WBM2M3M4M5M6M7 stall.
COMP381 by M. Hamdi 1 Pipeline Hazards. COMP381 by M. Hamdi 2 Pipeline Hazards Hazards are situations in pipelining where one instruction cannot immediately.
Computer Architecture 2011 – Out-Of-Order Execution 1 Computer Architecture Out-Of-Order Execution Lihu Rappoport and Adi Yoaz.
Part 2 - Data Hazards and Forwarding 3/24/04++
Review: MIPS Pipeline Data and Control Paths
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Pipelining III Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Six Enhancing Performance with Pipelining
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
DLX Instruction Format
ENGS 116 Lecture 51 Pipelining and Hazards Vincent H. Berk September 30, 2005 Reading for today: Chapter A.1 – A.3, article: Patterson&Ditzel Reading for.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
Pipeline Data Hazards: Detection and Circumvention Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly.
Pipelined Datapath and Control
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
Chapter 4 The Processor. Chapter 4 — The Processor — 2 Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined.
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2012 Revised from original slides provided by MKP.
CMPE 421 Parallel Computer Architecture
Pipeline Data Hazards Warning, warning, warning! Read 4.8 Peer Instruction Lecture Materials for Computer Architecture by Dr. Leo Porter is licensed under.
EECE 476: Computer Architecture Slide Set #5: Implementing Pipelining Tor Aamodt Slide background: Die photo of the MIPS R2000 (first commercial MIPS microprocessor)
CMPE 421 Parallel Computer Architecture Part 2: Hardware Solution: Forwarding.
CS 1104 Help Session IV Five Issues in Pipelining Colin Tan, S
LECTURE 7 Pipelining. DATAPATH AND CONTROL We started with the single-cycle implementation, in which a single instruction is executed over a single cycle.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
ECE/CS 552: Pipeline Hazards © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim.
Pipelining: Implementation CPSC 252 Computer Organization Ellen Walker, Hiram College.
CSE 340 Computer Architecture Spring 2016 Overcoming Data Hazards.
CDA3101 Recitation Section 8
Pipelining Chapter 6.
William Stallings Computer Organization and Architecture 8th Edition
CSCI206 - Computer Organization & Programming
Single Clock Datapath With Control
Data Hazards and Stalls
Data Hazards and Stalls
Chapter 4 The Processor Part 3
Review: MIPS Pipeline Data and Control Paths
Csci 136 Computer Architecture II – Data Hazard, Forwarding, Stall
Lecture 6: Advanced Pipelines
Pipelining review.
Pipelining Chapter 6.
Computer Organization CS224
Pipelining in more detail
CSCI206 - Computer Organization & Programming
CSC 4250 Computer Architectures
CSCI206 - Computer Organization & Programming
Data Hazards Data Hazard
The Processor Lecture 3.6: Control Hazards
The Processor Lecture 3.5: Data Hazards
Instruction Execution Cycle
Pipelining: Basic Concepts
Pipeline Control unit (highly abstracted)
Control unit extension for data hazards
RTL for the SRC pipeline registers
Introduction to Computer Organization and Architecture
Control unit extension for data hazards
Systems Architecture II
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,
Presentation transcript:

Forwarding and Hazards MemberRole William ElliottTeam Leader Jessica Tyler ShulerWiki Specialist Tyler KimseyLead Engineer Cameron CarrollEngineer Danielle TurnerPowerPoint Leader* Chris SmithPresentation Leader* Saeed AlshahraniPowerPoint Team* Matt WoodPowerPoint Team* *Roles change with Phase

Overview What are Hazards?  Hazards are problems that occur within the instruction pipeline of the central processing unit (CPU) microarchitecture that can potentially result in an incorrect computation.  There are several types of hazards  Structural Hazards  Data Hazards  Control Hazards

Block Diagram

Structural Hazards  When the current instruction cannot execute in the proper clock cycle because the hardware does not support the combination of instructions that are set to execute  These are not a problem in the MIPS architecture, as there is sufficient hardware to implement everything we need  The only solution, would they occur, would be to add more hardware

Data Hazards  When the current instruction cannot execute in the proper clock cycle because data that is needed to execute instruction is not available.  Load-use data hazard: a specific form of data hazard in which the data being loaded by a load instruction has not yet become available when it is needed by another instruction

Read-after-Read (RAR)  This is a false dependency  Reading won’t alter the contents of the register file, and the registers are read at different times MIPSPseudo-code add $t0, $t1, $t2 sub $t4, $t1, $t5 c = a + b d = a + e

 This is not a hazard to be concerned with  The output of the second operation in no way relies on the output of the first  Output is stored again in the next pipeline stage, overwriting the value from the first instruction MIPSPseudo-code add $t1, $t2, $t3 add $t1, $t4, $t5 c = a + b c = d + e Write-after-Write (WAW)

 This is also not a hazard  The “sub” instruction reads in the value of $t3 five stages before it’s written into the register file MIPSPseudo-code sub $t1, $t2, $t3 add $t3, $t4, $t5 c = a + b b = d + e Write-after-Read (WAR)

 This refers to a situation where a previous instruction has not finished writing a value to memory before it needs to be used  This can occur because of the pipelined nature of our processor. Data is written back to the register file two stages after the subsequent instruction needs this information.  This is known as a true-data dependency MIPSPseudo-code add $t1, $t2, $t3 add $t4, $t1, $t5 c = a + b d = c + e Read-after-Write (RAW)

Data Hazards True-Data Dependencies  Stalling – inserts a bubble, or a nop (no operation) into the pipeline  Forwarding – Copies data from inside the pipeline before it is written back to the register.

Forwarding Example add $t1, $t2, $t3 add $t4, $t1, $t5

Forwarding Logic

Selector MUXs Mux ControlSourceExplanation ForwardA = 00ID/EXThe first ALU operand comes from the register file ForwardA = 10EX/MEMThe first ALU operand is forwarded from the prior ALU result ForwardA = 01MEM/WBThe first ALU operand is forwarded from data memory or an earlier ALU result ForwardB = 00ID/EXThe second ALU operand comes from the register file ForwardB = 10EX/MEMThe second ALU operand is forwarded from the prior ALU result ForwardB = 01MEM/WBThe second ALU operand is forwarded from data memory or an earlier ALU result

Data Hazards Load-Use Hazard  There is a case where forwarding will not solve our problems, as the load will not resolve until the last clock cycle in the pipeline, while the subsequent instruction needs the information in the previous cycle.  Therefore, we must stall the pipeline in order to let the load instruction to “catch up”

Load-Use Example

Hazard Detection Unit

Bubble Control Flow Chart

Handling the Bubble

Inserting the Bubble

Control Hazards  Branch (beq)  Two paths that can be taken, uses a statement that checks which branch will be taken.  (Think of an “if” statement in Java, or C.)  Jump (j)  Always “jumps” to a different location in the code.

Control Hazards Flush Logic  Because there are two options in a branch, we assume the branch will not be taken. If the branch is taken we must remove the instructions that have entered the pipeline.  We do this with a “flush” where we turn all values in the pipeline into nop.

Flush Logic

Questions?