Detailed Scoreboard Pipeline Control. Three Parts of the Scoreboard. Scoreboard Example Cycle 1. Scoreboard Example. Scoreboard Example Cycle 3

Similar documents
Pipelining: Issue instructions in every cycle (CPI 1) Compiler scheduling (static scheduling) reduces impact of dependences

Advantages of Dynamic Scheduling

Review: Evaluating Branch Alternatives. Lecture 3: Introduction to Advanced Pipelining. Review: Evaluating Branch Prediction

Lecture 4: Introduction to Advanced Pipelining

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation

CPE 631 Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation

What is ILP? Instruction Level Parallelism. Where do we find ILP? How do we expose ILP?

Scoreboard information (3 tables) Four stages of scoreboard control

Compiler Optimizations. Lecture 7 Overview of Superscalar Techniques. Memory Allocation by Compilers. Compiler Structure. Register allocation

Instruction Level Parallelism

Instruction-Level Parallelism and Its Exploitation

Graduate Computer Architecture. Chapter 3. Instruction Level Parallelism and Its Dynamic Exploitation

Latencies of FP operations used in chapter 4.

COSC4201 Instruction Level Parallelism Dynamic Scheduling

Reduction of Data Hazards Stalls with Dynamic Scheduling So far we have dealt with data hazards in instruction pipelines by:

COSC 6385 Computer Architecture - Pipelining (II)

DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD

Processor: Superscalars Dynamic Scheduling

University of Southern California Department of Electrical Engineering EE557 Fall 2001 Instructor: Michel Dubois Homework #3.

CISC 662 Graduate Computer Architecture. Lecture 10 - ILP 3

Review: Compiler techniques for parallelism Loop unrolling Ÿ Multiple iterations of loop in software:

Metodologie di Progettazione Hardware-Software

Review, # = Levels of the Memory Hierarchy. Staging Xfer Unit. Registers. prog./compiler 1-8 bytes. Instr. Operands.

Good luck and have fun!

ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 8 Instruction-Level Parallelism Part 1

Instruction Level Parallelism (ILP)

Hardware-based speculation (2.6) Multiple-issue plus static scheduling = VLIW (2.7) Multiple-issue, dynamic scheduling, and speculation (2.

CS252 Graduate Computer Architecture Lecture 6. Recall: Software Pipelining Example

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1)

吳俊興高雄大學資訊工程學系. October Example to eleminate WAR and WAW by register renaming. Tomasulo Algorithm. A Dynamic Algorithm: Tomasulo s Algorithm

CS252 Graduate Computer Architecture Lecture 8. Review: Scoreboard (CDC 6600) Explicit Renaming Precise Interrupts February 13 th, 2010

ILP concepts (2.1) Basic compiler techniques (2.2) Reducing branch costs with prediction (2.3) Dynamic scheduling (2.4 and 2.5)

Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Complex Pipelining. Motivation

CPE 631 Lecture 11: Instruction Level Parallelism and Its Dynamic Exploitation

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation

Page 1. Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

Tomasulo s Algorithm

Hardware-based Speculation

Chapter 3: Instruction Level Parallelism (ILP) and its exploitation. Types of dependences

Instruction Frequency CPI. Load-store 55% 5. Arithmetic 30% 4. Branch 15% 4

Adapted from David Patterson s slides on graduate computer architecture

Static vs. Dynamic Scheduling

CS433 Homework 3 (Chapter 3)

ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST *

The basic structure of a MIPS floating-point unit

ELEC 5200/6200 Computer Architecture and Design Fall 2016 Lecture 9: Instruction Level Parallelism

Dynamic Scheduling. Better than static scheduling Scoreboarding: Tomasulo algorithm:

Preventing Stalls: 1

CS 152 Computer Architecture and Engineering. Lecture 13 - Out-of-Order Issue and Register Renaming

Complications with long instructions. CMSC 411 Computer Systems Architecture Lecture 6 Basic Pipelining 3. How slow is slow?

Website for Students VTU NOTES QUESTION PAPERS NEWS RESULTS

Page 1. Recall from Pipelining Review. Lecture 15: Instruction Level Parallelism and Dynamic Execution

EITF20: Computer Architecture Part3.2.1: Pipeline - 3

Load1 no Load2 no Add1 Y Sub Reg[F2] Reg[F6] Add2 Y Add Reg[F2] Add1 Add3 no Mult1 Y Mul Reg[F2] Reg[F4] Mult2 Y Div Reg[F6] Mult1

Superscalar Architectures: Part 2

Four Steps of Speculative Tomasulo cycle 0

EECC551 Exam Review 4 questions out of 6 questions

Lecture-13 (ROB and Multi-threading) CS422-Spring

CS 252 Graduate Computer Architecture. Lecture 4: Instruction-Level Parallelism

CMCS Mohamed Younis CMCS 611, Advanced Computer Architecture 1

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

CMSC 411 Computer Systems Architecture Lecture 6 Basic Pipelining 3. Complications With Long Instructions

Multi-cycle Instructions in the Pipeline (Floating Point)

Slide Set 8. for ENCM 501 in Winter Steve Norman, PhD, PEng

Administrivia. CMSC 411 Computer Systems Architecture Lecture 6. When do MIPS exceptions occur? Review: Exceptions. Answers to HW #1 posted

CS 152 Computer Architecture and Engineering. Lecture 10 - Complex Pipelines, Out-of-Order Issue, Register Renaming

Chapter 4 The Processor 1. Chapter 4D. The Processor

Branch prediction ( 3.3) Dynamic Branch Prediction

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 9 Instruction-Level Parallelism Part 2

Advanced issues in pipelining

09-1 Multicycle Pipeline Operations

Instruction Level Parallelism

CISC 662 Graduate Computer Architecture Lecture 11 - Hardware Speculation Branch Predictions

C 1. Last time. CSE 490/590 Computer Architecture. Complex Pipelining I. Complex Pipelining: Motivation. Floating-Point Unit (FPU) Floating-Point ISA

Computer Architectures. Chapter 4. Tien-Fu Chen. National Chung Cheng Univ.

Chapter 3 (CONT II) Instructor: Josep Torrellas CS433. Copyright J. Torrellas 1999,2001,2002,2007,

COSC 6385 Computer Architecture - Instruction Level Parallelism (II)

CS152 Computer Architecture and Engineering Lecture 15

CSE 820 Graduate Computer Architecture. week 6 Instruction Level Parallelism. Review from Last Time #1

5008: Computer Architecture

DYNAMIC SPECULATIVE EXECUTION

Complex Pipelining: Out-of-order Execution & Register Renaming. Multiple Function Units

Page 1. CISC 662 Graduate Computer Architecture. Lecture 8 - ILP 1. Pipeline CPI. Pipeline CPI (I) Pipeline CPI (II) Michela Taufer

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

Chapter 3 & Appendix C Part B: ILP and Its Exploitation

Page # CISC 662 Graduate Computer Architecture. Lecture 8 - ILP 1. Pipeline CPI. Pipeline CPI (I) Michela Taufer

CS 423 Computer Architecture Spring Lecture 04: A Superscalar Pipeline

COSC4201. Prof. Mokhtar Aboelaze York University

Course on Advanced Computer Architectures

Complex Pipelining COE 501. Computer Architecture Prof. Muhamed Mudawar

Exploiting ILP with SW Approaches. Aleksandar Milenković, Electrical and Computer Engineering University of Alabama in Huntsville

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles

Multicycle ALU Operations 2/28/2011. Diversified Pipelines The Path Toward Superscalar Processors. Limitations of Our Simple 5 stage Pipeline

What is instruction level parallelism?

Updated Exercises by Diana Franklin

Predict Not Taken. Revisiting Branch Hazard Solutions. Filling the delay slot (e.g., in the compiler) Delayed Branch

EECC551 Review. Dynamic Hardware-Based Speculation

Lecture 9. Thread Divergence Scheduling Instruction Level Parallelism

Transcription:

1 From MIPS pipeline to Scoreboard Lecture 5 Scoreboarding: Enforce Register Data Dependence Scoreboard design, big example Out-of-order execution divides ID stage: 1.Issue decode instructions, check for structural hazards 2.Read operands wait until no data hazards, then read operands Scoreboards allow instruction to execute whenever 1 & 2 hold, not waiting for prior instructions CDC 6600: In order issue, out of order execution, out of order completion Revised from D. Patterson s1998 1 Revised from D. Patterson s1998 2 Scoreboard Implications Out-of-order completion => WAR, WAW hazards? Solutions for WAR Queue both the operation and copies of its operands Read registers only during Read Operands stage For WAW, must detect hazard: stall until other completes Need to have multiple instructions in execution phase => multiple execution units or pipelined execution units Scoreboard keeps track of dependencies, state or operations Scoreboard replaces ID, EX, WB with 4 stages Four Stages of Scoreboard Control 1. Issue decode instructions & check for structural hazards Wait conditions: (1) the required FU is free; (2) no other instruction writes to the same register destination (to avoid WAW) Actions: (1) the instruction is assigned to the FU; (2) scoreboard updates its internal data structure If an instruction is stalled at this stage, no other instructions can proceed 2. Read operands wait until no data hazards, then read operands Wait conditions: all source operands are available Actions: the function unit reads register operands and start execution the next cycle Revised from D. Patterson s1998 3 Revised from D. Patterson s1998 4 Four Stages of Scoreboard Control 3.Execution operate on operands (EX) Actions: The functional unit begins execution upon receiving operands. When the result is ready, it notifies the scoreboard that it has completed execution. 4.Write result finish execution (WB) Wait condition: no other instruction/fu is going to read the register destination of the instruction Actions: Write the register and update the scoreboard WAR Example: DIVD F0,F2,F4 ADDD F10,F0,F8 SUBD F8,F8,F14 CDC 6600 scoreboard would stall SUBD until ADDD reads operands Revised from D. Patterson s1998 5 Scoreboard Connections Registers Control/ status Scoreboard FP mult FP mult FP div FP add INT unit Control/ status Revised from D. Patterson s1998 6

2 Three Parts of the Scoreboard 1. Instruction status which of 4 steps the instruction is in 2. Functional unit status Indicates the state of the functional unit (FU). 9 fields for each functional unit Busy Indicates whether the unit is busy or not Op Operation to perform in the unit (e.g., + or ) Fi Destination register Fj, Fk Source-register numbers Qj, Qk Functional units producing source registers Fj, Fk Rj, Rk Flags indicating when Fj, Fk are ready 3. Indicates which functional unit will write each register, if one exists. Blank when no pending instructions will write that register Detailed Scoreboard Pipeline Control Instruction status Issue Read operands Execution complete Write result Wait until Not busy (FU) and not result(d) Rj and Rk Functional unit done f((fj( f ) Fi(FU) or Rj( f )=No) & (Fk( f ) Fi(FU) or Rk( f )=No)) Bookkeeping Busy(FU) yes; Op(FU) op; Fi(FU) `D ; Fj(FU) `S1 ; Fk(FU) `S2 ; Qj Result( S1 ); Qk Result(`S2 ); Rj not Qj; Rk not Qk; Result( D ) FU; Rj No; Rk No f(if Qj(f)=FU then Rj(f) Yes); f(if Qk(f)=FU then Rj(f) Yes); Result(Fi(FU)) 0; Busy(FU) No Revised from D. Patterson s1998 7 Revised from D. Patterson s1998 8 Scoreboard Example Instruction j k Issue operandcomplet Result LD F6 34+ R2 FU Scoreboard Example Cycle 1 LD F6 34+ R2 1 1 FU Integer Revised from D. Patterson s1998 9 Revised from D. Patterson s1998 10 Scoreboard Example Cycle 2 LD F6 34+ R2 1 2 2 FU Integer Issue 2nd LD? Scoreboard Example Cycle 3 LD F6 34+ R2 1 2 3 3 FU Integer Issue MULT? Revised from D. Patterson s1998 11 Revised from D. Patterson s1998 12

3 Scoreboard Example Cycle 4 4 FU Integer Scoreboard Example Cycle 5 5 5 FU Integer Revised from D. Patterson s1998 13 Revised from D. Patterson s1998 14 Scoreboard Example Cycle 6 Scoreboard Example Cycle 7 5 6 6 Mult1 Yes Mult F0 F2 F4 Yes 6 FU Mult1 Integer Revised from D. Patterson s1998 15 5 6 7 6 7 Mult1 Yes Mult F0 F2 F4 Yes Add Yes Sub F8 F6 F2 Integer Yes No 7 FU Mult1 Integer Add Read multiply operands? Revised from D. Patterson s1998 16 Scoreboard Example Cycle 8a Scoreboard Example Cycle 8b 5 6 7 6 7 Mult1 Yes Mult F0 F2 F4 Yes Add Yes Sub F8 F6 F2 Integer Yes No 8 FU Mult1 Integer Add Divide 6 7 Mult1 Yes Mult F0 F2 F4 Yes Yes Add Yes Sub F8 F6 F2 Yes Yes 8 FU Mult1 Add Divide Revised from D. Patterson s1998 17 Revised from D. Patterson s1998 18

4 Scoreboard Example Cycle 9 Scoreboard Example Cycle 11 7 9 10 Mult1 Yes Mult F0 F2 F4 Yes Yes 2 Add Yes Sub F8 F6 F2 Yes Yes 9 FU Mult1 Add Divide Read operands for MULT & SUBD? Issue ADDD? Revised from D. Patterson s1998 19 7 9 11 8 Mult1 Yes Mult F0 F2 F4 Yes Yes 0 Add Yes Sub F8 F6 F2 Yes Yes 11 FU Mult1 Add Divide Revised from D. Patterson s1998 20 Scoreboard Example Cycle 12 Scoreboard Example Cycle 13 7 Mult1 Yes Mult F0 F2 F4 Yes Yes 12 FU Mult1 Divide Read operands for DIVD? 13 6 Mult1 Yes Mult F0 F2 F4 Yes Yes 13 FU Mult1 Add Divide Revised from D. Patterson s1998 21 Revised from D. Patterson s1998 22 Scoreboard Example Cycle 14 Scoreboard Example Cycle 15 13 14 5 Mult1 Yes Mult F0 F2 F4 Yes Yes 2 14 FU Mult1 Add Divide 13 14 4 Mult1 Yes Mult F0 F2 F4 Yes Yes 1 15 FU Mult1 Add Divide Revised from D. Patterson s1998 23 Revised from D. Patterson s1998 24

5 Scoreboard Example Cycle 16 Scoreboard Example Cycle 17 13 14 16 3 Mult1 Yes Mult F0 F2 F4 Yes Yes 0 16 FU Mult1 Add Divide 13 14 16 2 Mult1 Yes Mult F0 F2 F4 Yes Yes 17 FU Mult1 Add Divide Write result of ADDD? Revised from D. Patterson s1998 25 Revised from D. Patterson s1998 26 Scoreboard Example Cycle 18 Scoreboard Example Cycle 19 13 14 16 1 Mult1 Yes Mult F0 F2 F4 Yes Yes 18 FU Mult1 Add Divide 19 13 14 16 0 Mult1 Yes Mult F0 F2 F4 Yes Yes 19 FU Mult1 Add Divide Revised from D. Patterson s1998 27 Revised from D. Patterson s1998 28 Scoreboard Example Cycle 20 19 20 13 14 16 Divide Yes Div F10 F0 F6 Yes Yes 20 FU Add Divide Scoreboard Example Cycle 21 19 20 21 13 14 16 Divide Yes Div F10 F0 F6 Yes Yes 21 FU Add Divide Revised from D. Patterson s1998 29 Revised from D. Patterson s1998 30

6 Scoreboard Example Cycle 22 Scoreboard Example Cycle 61 19 20 21 13 14 16 22 40 Divide Yes Div F10 F0 F6 Yes Yes 22 FU Divide 19 20 21 61 13 14 16 22 0 Divide Yes Div F10 F0 F6 Yes Yes 61 FU Divide Revised from D. Patterson s1998 31 Revised from D. Patterson s1998 32 Scoreboard Example Cycle 62 Scoreboard Scheduling 19 20 21 61 62 13 14 16 22 0 62 FU Inst LD LD MULT SUBD DIVD ADDD Issue 1 5 6 7 8 13 Read operands 2 6 9 9 21 14 Execution complete 3 7 19 11 61 16 Write Result 4 8 20 12 62 22 Revised from D. Patterson s1998 33 Revised from D. Patterson s1998 34 Machine Correctness E(D,P) = E(S,P) if E(D,P) and E(S,P) execute the same set of instructions For any inst i, i receives the outputs in E(D,P) of its parents in E(S,P) In E(D,P) any register or memory word receives the output of inst j, where j is the last instruction writes to the register or memory word in E(S,P) CDC 6600 Scoreboard Speedup 1.7 from compiler; 2.5 by hand BUT slow memory (no cache) limits benefit Limitations of 6600 scoreboard: No forwarding hardware Limited to instructions in basic block (small window) Small number of functional units (structural hazards), especailly integer/load store units Do not issue on structural hazards Wait for WAR hazards Prevent WAW hazards Revised from D. Patterson s1998 35 Revised from D. Patterson s1998 36