Data Dependence Types and Associated Pipeline Hazards Chapter 4 — The Processor — 1 Sections 4.7.

Slides:



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

Instruction-Level Parallel Processors {Objective: executing two or more instructions in parallel} 4.1 Evolution and overview of ILP-processors 4.2 Dependencies.
Chapter3 Limitations on Instruction-Level Parallelism Bernard Chen Ph.D. University of Central Arkansas.
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.
Data Dependencies Describes the normal situation that the data that instructions use depend upon the data created by other instructions, or data is stored.
1 Lecture: Out-of-order Processors Topics: out-of-order implementations with issue queue, register renaming, and reorder buffer, timing, LSQ.
EECC551 - Shaaban #1 Fall 2003 lec# Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining increases performance by overlapping.
COMP25212 Advanced Pipelining Out of Order Processors.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
CS252/Patterson Lec 1.1 1/17/01 Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer.
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.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
ECE 445 – Computer Organization
Chapter 3 Instruction-Level Parallelism and Its Dynamic Exploitation – Concepts 吳俊興 高雄大學資訊工程學系 October 2004 EEF011 Computer Architecture 計算機結構.
EECC551 - Shaaban #1 Winter 2002 lec# Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining increases performance by overlapping.
EECC551 - Shaaban #1 Spring 2006 lec# Pipelining and Instruction-Level Parallelism. Definition of basic instruction block Increasing Instruction-Level.
EECC551 - Shaaban #1 Fall 2005 lec# Pipelining and Instruction-Level Parallelism. Definition of basic instruction block Increasing Instruction-Level.
1 Stalling  The easiest solution is to stall the pipeline  We could delay the AND instruction by introducing a one-cycle delay into the pipeline, sometimes.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Review of CS 203A Laxmi Narayan Bhuyan Lecture2.
Computer ArchitectureFall 2007 © October 22nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
EENG449b/Savvides Lec 4.1 1/22/04 January 22, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
EECC551 - Shaaban #1 Winter 2011 lec# Pipelining and Instruction-Level Parallelism (ILP). Definition of basic instruction block Increasing Instruction-Level.
EECC551 - Shaaban #1 Spring 2004 lec# Definition of basic instruction blocks Increasing Instruction-Level Parallelism & Size of Basic Blocks.
Pipelining - II Adapted from CS 152C (UC Berkeley) lectures notes of Spring 2002.
Data Dependencies A dependency type that can cause a stall.
Pipelining and Exploiting Instruction-Level Parallelism (ILP)
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.
CSC 4250 Computer Architectures October 13, 2006 Chapter 3.Instruction-Level Parallelism & Its Dynamic Exploitation.
CS3350B Computer Architecture Winter 2015 Lecture 6.2: Instructional Level Parallelism: Hazards and Resolutions Marc Moreno Maza
Pipelining. 10/19/ Outline 5 stage pipelining Structural and Data Hazards Forwarding Branch Schemes Exceptions and Interrupts Conclusion.
CPE 731 Advanced Computer Architecture Pipelining Review Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of California,
CPE432 Chapter 4B.1Dr. W. Abu-Sufah, UJ Chapter 4B: The Processor, Part B-2 Read Section 4.7 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
Computer Organization CS224 Fall 2012 Lesson 28. Pipelining Analogy  Pipelined laundry: overlapping execution l Parallelism improves performance §4.5.
Pipelining (I). Pipelining Example  Laundry Example  Four students have one load of clothes each to wash, dry, fold, and put away  Washer takes 30.
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
CMPE 421 Parallel Computer Architecture
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Recap Multicycle Operations –MIPS Floating Point Putting It All Together: the MIPS R4000 Pipeline.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
CS252/Patterson Lec 1.1 1/17/01 معماري کامپيوتر - درس نهم pipeline برگرفته از درس : Prof. David A. Patterson.
CSE431 L06 Basic MIPS Pipelining.1Irwin, PSU, 2005 MIPS Pipeline Datapath Modifications  What do we need to add/modify in our MIPS datapath? l State registers.
UNIT III -PIPELINE.
CPE432 Chapter 4B.1Dr. W. Abu-Sufah, UJ Chapter 4B: The Processor, Part B-1 Read Sections 4.7 Adapted from Slides by Prof. Mary Jane Irwin, Penn State.
Chapter Six.
Pipelining: Hazards Ver. Jan 14, 2014
William Stallings Computer Organization and Architecture 8th Edition
5 Steps of MIPS Datapath Figure A.2, Page A-8
Single Clock Datapath With Control
\course\cpeg323-08F\Topic6b-323
Appendix A - Pipelining
Lecture 6: Advanced Pipelines
Out of Order Processors
Lecture 18: Pipelining Today’s topics:
CSC 4250 Computer Architectures
\course\cpeg323-05F\Topic6b-323
Chapter Six.
Chapter Six.
Adapted from the slides of Prof
Daxia Ge Friday February 9th, 2007
November 5 No exam results today. 9 Classes to go!
Data Hazard Example (stall).
CS203 – Advanced Computer Architecture
pipelining: data hazards Prof. Eric Rotenberg
RTL for the SRC pipeline registers
Appendix C Practice Problem Set 1
Lecture 9: Dynamic ILP Topics: out-of-order processors
Conceptual execution on a processor which exploits ILP
Presentation transcript:

Data Dependence Types and Associated Pipeline Hazards Chapter 4 — The Processor — 1 Sections 4.7

Type #1: Data Flow Dependence (True Dependence) InstrK reads operand written by InstrM Instr K is data dependent (aka true dependence) on Instr M – Data must flow from instruction M to instruction K If two instructions are data dependent, they cannot execute simultaneously or be completely overlapped Data dependence in an instruction sequence implies data dependence in source code If data dependence caused a hazard in pipeline, it would be a RAW (Read After Write) hazard CPE 4322 M: add $s0, $t0, $t1 K: sub $t2, $s0, $t3

Chapter 4 — The Processor — 3 RAW Data Hazards add$s0, $t0, $t1 sub$t2, $s0, $t3

Type #2: Name Dependence (Anti-dependence) Name dependence is when 2 instructions (e.g. N and M) use the same register or memory location (called a name), but there is no flow of data between the instructions associated with that name Instr M writes an operand that Instr N reads – Called an “anti-dependence” by compiler writers (we say that instruction N is data anti-dependant on instruction M) This results from the reuse of the name “r1” If anti-dependence caused a hazard in the pipeline, it would be a Write After Read (WAR) hazard CPE 4324 N: sub r4,r1,r3 M: add r1,r2,r3 K: mul r6,r1,r7

CPE432 Chapter 4B.5Dr. W. Abu-Sufah, UJ Anti-dependence does NOT cause WAR Data Hazard in this pipeline ALU IM Reg DMReg sub$s0,$t0,$t1 ALU IM Reg DMReg CC0CC1CC2CC3CC4 CC5 CC6CC7CC8 add$t0,$t2,$t3

Type #3: Name Dependence (Output dependence) Instr M writes operand that Instr N writes. Called an “output dependence” by compiler writers This also results from the reuse of name “r1” If output dependance caused a hazard in the pipeline, it would be a Write After Write (WAW) hazard CPE 4326 N: sub r1,r4,r3 M: add r1,r2,r3 K: mul r6,r1,r7

Chapter 4 — The Processor — 7 Code Scheduling to Avoid Stalls Reorder code to avoid use of load result in the next instruction C code for A = B + E; C = B + F; lw$t1, 0($t0) lw$t2, 4($t0) add$t3, $t1, $t2 sw$t3, 12($t0) lw$t4, 8($t0) add$t5, $t1, $t4 sw$t5, 16($t0) stall 13 cycles Code Order 1#

Chapter 4 — The Processor — 8 2 Stalls: 13 Cycles

Chapter 4 — The Processor — 9 Code Scheduling to Avoid Stalls Reorder code to avoid use of load result in the next instruction C code for A = B + E; C = B + F; lw$t1, 0($t0) lw$t2, 4($t0) lw$t4, 8($t0) add$t3, $t1, $t2 sw$t3, 12($t0) add$t5, $t1, $t4 sw$t5, 16($t0) 11 cycles Code Order #2

Chapter 4 — The Processor — 10 Reodering of Code; No Hazards: 11 Cycles lw $t2, 4($t0) add $t3,$t1,$t2 lw $t4, 8($t0) add$t5, $t1,$t4