Prof. Sirer CS 316 Cornell University

Slides:



Advertisements
Similar presentations
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.
Advertisements

CMSC 611: Advanced Computer Architecture Scoreboard Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Forwarding and Hazards MemberRole William ElliottTeam Leader Jessica Tyler ShulerWiki Specialist Tyler KimseyLead Engineer Cameron CarrollEngineer Danielle.
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 Lecture 17: Basic Pipelining Today’s topics:  5-stage pipeline  Hazards and instruction scheduling Mid-term exam stats:  Highest: 90, Mean: 58.
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Computer ArchitectureFall 2007 © October 22nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
Lec 9: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
7/2/ _23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering.
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.
CMPE 421 Parallel Computer Architecture
Spring 2003CSE P5481 Precise Interrupts Precise interrupts preserve the model that instructions execute in program-generated order, one at a time If an.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
CMPE 421 REVIEW: MIDTERM 1. A MODIFIED FIVE-Stage Pipeline PC A Y R MD1 addr inst Inst Memory Imm Ext add rd1 GPRs rs1 rs2 ws wd rd2 we wdata addr wdata.
L17 – Pipeline Issues 1 Comp 411 – Fall /23/09 CPU Pipelining Issues Read Chapter This pipe stuff makes my head hurt! What have you been.
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.
1 Lecture: Pipelining Extensions Topics: control hazards, multi-cycle instructions, pipelining equations.
Data Hazards Dependent instructions add %g1, %g2, %g3 sub %l1, %g3, %o0 Forwarding helps, but not all hazards can be avoided.
Real-World Pipelines Idea Divide process into independent stages
Chapter Six.
Speed up on cycle time Stalls – Optimizing compilers for pipelining
CDA3101 Recitation Section 8
Computer Architecture
Pipelining: Hazards Ver. Jan 14, 2014
Simultaneous Multithreading
Lecture 07: Pipelining Multicycle, MIPS R4000, and More
Lecture 17: Pipelining Today’s topics: 5-stage pipeline Hazards
5 Steps of MIPS Datapath Figure A.2, Page A-8
Lecture: Pipelining Extensions
CS203 – Advanced Computer Architecture
Chapter 14 Instruction Level Parallelism and Superscalar Processors
Pipeline Implementation (4.6)
CDA 3101 Spring 2016 Introduction to Computer Organization
Instructional Parallelism
Processor Pipelining Yasser Mohammad.
Lecture 6: Advanced Pipelines
Computer Architecture Lecture 3 – Part 1 11th May, 2006
Out of Order Processors
Pipelining Multicycle, MIPS R4000, and More
Computer Architecture Lecture 3
Instruction Level Parallelism and Superscalar Processors
Lecture 5: Pipelining Basics
Pipelining in more detail
CS 704 Advanced Computer Architecture
Lecture 7: Dynamic Scheduling with Tomasulo Algorithm (Section 2.4)
How to improve (decrease) CPI
Chapter Six.
Chapter Six.
Lecture: Pipelining Extensions
Lecture: Pipelining Extensions
Instruction Level Parallelism (ILP)
November 5 No exam results today. 9 Classes to go!
Instruction Execution Cycle
Chapter 8. Pipelining.
Extending simple pipeline to multiple pipes
Lecture 4: Advanced Pipelines
Reducing pipeline hazards – three techniques
Pipelining.
CSC3050 – Computer Architecture
Created by Vivi Sahfitri
How to improve (decrease) CPI
Systems Architecture II
Lecture 9: Dynamic ILP Topics: out-of-order processors
Conceptual execution on a processor which exploits ILP
Pipelining Hazards.
Presentation transcript:

Prof. Sirer CS 316 Cornell University Pipelining Hazards Prof. Sirer CS 316 Cornell University

Pipelining Recap Powerful technique for masking latencies Logically, instructions execute one at a time Physically, instructions execute in parallel Decouples the processor model from the implementation Interface vs. implementation Dependencies between instructions complicate the implementation

Hazards Data hazards Control hazards Structural hazards A required operand is not ready Usually because a previous instruction in the pipeline has not committed it to the register file yet Control hazards The next instruction to fetch cannot be determined Usually because a jump or branch instruction has not determined the next PC yet Structural hazards Two instructions in the pipeline try to simultaneously access the same resource

Data Hazards Stall Data Forwarding Keep track of all instructions in the pipeline, and all registers they may affect Detect that there will be a conflict Inject NOPs (“bubbles”) into the pipeline until the hazard is gone Data Forwarding Add additional circuitry and wires to route data from a later stage back to an earlier stage

Control Hazards Stall Delay Slots Speculative Execution Inject NOPs into the pipeline when the next instruction is not known Pros: simple, clean; Cons: slow Delay Slots Tell the programmer that the N instructions after a jump will always be executed, no matter what the outcome of the branch Pros: The compiler may be able to fill the slots with useful instructions; Cons: breaks abstraction boundary Speculative Execution Insert instructions into the pipeline Replace instructions with NOPs if the branch comes out opposite of what the processor expected Pros: Clean model, fast; Cons: complex

Types of Hazards RAW – Read After Write WAR – Write After Read WAW – Write After Write RAW indicates data dependence WAW and WAR hazards stem from register reuse Exercised by out-of-order execution Register renaming can eliminate them