Caltech CS184b Winter2001 -- DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day5:

Slides:



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

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.
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Intro to Computer Org. Pipelining, Part 2 – Data hazards + Stalls.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
Review: Pipelining. Pipelining Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes Dryer.
Instruction-Level Parallelism (ILP)
COMP381 by M. Hamdi 1 Pipeline Hazards. COMP381 by M. Hamdi 2 Pipeline Hazards Hazards are situations in pipelining where one instruction cannot immediately.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
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)
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day6:
EECS 470 Pipeline Hazards Lecture 4 Coverage: Appendix A.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
L17 – Pipeline Issues 1 Comp 411 – Fall /1308 CPU Pipelining Issues Finishing up Chapter 6 This pipe stuff makes my head hurt! What have you been.
EENG449b/Savvides Lec 4.1 1/22/04 January 22, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
DLX Instruction Format
1 Lecture 4: Advanced Pipelines Data hazards, control hazards, multi-cycle in-order pipelines (Appendix A.4-A.10)
Appendix A Pipelining: Basic and Intermediate Concepts
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.1- PIPELINING 2 nd week. -2- Khoa Coâng Ngheä Thoâng Tin – Ñaïi Hoïc Baùch Khoa Tp.HCM PIPELINING 2 nd week References Pipelining concepts The DLX.
Lecture 15: Pipelining and Hazards CS 2011 Fall 2014, Dr. Rozier.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day3:
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
1 Appendix A Pipeline implementation Pipeline hazards, detection and forwarding Multiple-cycle operations MIPS R4000 CDA5155 Spring, 2007, Peir / University.
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2012 Revised from original slides provided by MKP.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CMPE 421 Parallel Computer Architecture
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
HazardsCS510 Computer Architectures Lecture Lecture 7 Pipeline Hazards.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
HazardsCS510 Computer Architectures Lecture Lecture 7 Pipeline Hazards.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day8:
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day7:
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.
Caltech CS184 Spring DeHon 1 CS184b: Computer Architecture (Abstractions and Optimizations) Day 3: April 4, 2003 Pipelined ISA.
1 Lecture: Pipelining Extensions Topics: control hazards, multi-cycle instructions, pipelining equations.
CS203 – Advanced Computer Architecture Pipelining Review.
Speed up on cycle time Stalls – Optimizing compilers for pipelining
Pipelining: Hazards Ver. Jan 14, 2014
ARM Organization and Implementation
Lecture 17: Pipelining Today’s topics: 5-stage pipeline Hazards
Single Clock Datapath With Control
Pipeline Implementation (4.6)
\course\cpeg323-08F\Topic6b-323
Appendix A - Pipelining
Pipelining review.
Pipelining in more detail
CSC 4250 Computer Architectures
\course\cpeg323-05F\Topic6b-323
Chapter Six.
Lecture: Pipelining Extensions
Instruction Execution Cycle
Overview What are pipeline hazards? Types of hazards
CS203 – Advanced Computer Architecture
Lecture 4: Advanced Pipelines
pipelining: data hazards Prof. Eric Rotenberg
Pipeline Control unit (highly abstracted)
Pipelining.
Morgan Kaufmann Publishers The Processor
Throughput = #instructions per unit time (seconds/cycles etc.)
Guest Lecturer: Justin Hsia
CS184b: Computer Architecture (Abstractions and Optimizations)
Pipelining Hazards.
Presentation transcript:

Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day5: January 17, 2000 Pipelining ISA Processor Execution

Caltech CS184b Winter DeHon 2 Today Pipelined Processor Issue –Hazards structural data control (next time) –accommodating –impact RISC/CISC wrapup (maybe) Admin question: this time good next term?

Caltech CS184b Winter DeHon 3 DLX Datapath DLX unpipelined datapath from H&P (Fig. 3.1)

Caltech CS184b Winter DeHon 4 DLX Model Behavior Read Registers Perform primitive ALU Op Read/Write memory Write register result

Caltech CS184b Winter DeHon 5 Pipeline?

Caltech CS184b Winter DeHon 6 Pipeline DLX DLX unpipelined datapath from H&P (Fig. 3.4)

Caltech CS184b Winter DeHon 7 Hazards Structural (resource bound) Data (value timing) Control (knowing where to go next)

Caltech CS184b Winter DeHon 8 Structural Hazards Arise when –Instructions have varying resource requirements –Usage of resources not occur at same time –Not want to provide resources for worst-case typically because it’s not the “common” case performance impact small compared to cost of handling worst case

Caltech CS184b Winter DeHon 9 Structural Hazards Have to consider: –all possible overlaps of instructions –simplified by considering instruction classes (e.g. add R1,R2,R3, sub R3,R4,R5, … all use same resource set…)

Caltech CS184b Winter DeHon 10 Structural Hazard: Identify Identify by: –looking at instruction (class) resource usage in pipeline Register-Register Op: –IF - I-mem port –ID - 2 register read ports –EXU - ALU –MEM –WB - 1 register write port

Caltech CS184b Winter DeHon 11 Structural Hazard: Identify R-R: 1I 2RR 1A -- 1RW L/S: 1I 1RR 1A 1AB,1DB 1RW BR: 1I 1RR 1A Conflicts: –standard DLX –RF has 1R, 1RW port

Caltech CS184b Winter DeHon 12 Structural Hazard: Identify Pipelined Memory access R-R: 1I 2RR 1A RW L: 1I 1RR 1A 1AB 1DB 1RW S: 1I 1RR 1A 1AB,1DB -- 1RW BR: 1I 1RR 1A -- --

Caltech CS184b Winter DeHon 13 Structural Hazards: Deal Datapath cannot handle Always have the option of idling on a cycle –“Bubble” into pipeline –allow downstream continue, stall upstream Options: –detect when occurs and stall one instruction –detect will occur at issue and stall

Caltech CS184b Winter DeHon 14 Pipeline DLX

Caltech CS184b Winter DeHon 15 Data Hazards Pipeline Latency Instruction effects not completed before next operation begins

Caltech CS184b Winter DeHon 16 Data Hazard: Example ADD R1,R2,R3 XOR R4,R1,R5

Caltech CS184b Winter DeHon 17 Data Hazard: Solving Primary problem (DLX) –data not back in RF –read stale data Partially solve with bypassing –when good data exist before use

Caltech CS184b Winter DeHon 18 Data Hazard: Solving [todo: draw DP with bypass muxes]

Caltech CS184b Winter DeHon 19 Data Hazard Note: since ops may stall, interrupt, resume –cannot decide how to set bypass muxes in ID stages –have to determine based on state of pipeline

Caltech CS184b Winter DeHon 20 Data Hazard Not all cases can bypass –if data not available anywhere, yet... –e.g. LW R1,4(R2) ADD R3,R1,R4

Caltech CS184b Winter DeHon 21 Model/Common Case Common/simple case Implementation transparency Could have slowed the initiation interval for all ops OR could have said can’t use value for number of cycles But, only few sequences/cases problematic –let rest run faster

Caltech CS184b Winter DeHon 22 Types of Data Hazards RAW (example seen) WAW –order of writes transposed going to memory –leave wrong value in memory WAR –read gets value computed “after” it should have completed

Caltech CS184b Winter DeHon 23 Compiler Instruction Scheduling can try to avoid –(making some assumptions about implementation) Schedule instructions in delay slot –possible when have parallelism/independent tasks another example where optimize across larger block give tighter results

Caltech CS184b Winter DeHon 24 Big Ideas Preserve the (simple, stable) model While providing high-performance implementation

Caltech CS184b Winter DeHon 25 Big Ideas Ops with different requirements Some cases can run faster than others Fast in simple, common cases Correct in others