Lecture 5 Scoreboarding: Enforce Register Data Dependence

Slides:



Advertisements
Similar presentations
CMSC 611: Advanced Computer Architecture Tomasulo Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Advertisements

Scoreboarding & Tomasulos Approach Bazat pe slide-urile lui Vincent H. Berk.
Instruction-level Parallelism Compiler Perspectives on Code Movement dependencies are a property of code, whether or not it is a HW hazard depends on.
Lec18.1 Step by step for Dynamic Scheduling by reorder buffer Copyright by John Kubiatowicz (http.cs.berkeley.edu/~kubitron)
A scheme to overcome data hazards
Dynamic ILP: Scoreboard Professor Alvin R. Lebeck Computer Science 220 / ECE 252 Fall 2008.
Lecture 6: ILP HW Case Study— CDC 6600 Scoreboard & Tomasulo’s Algorithm Professor Alvin R. Lebeck Computer Science 220 Fall 2001.
COMP25212 Advanced Pipelining Out of Order Processors.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 7: Dynamic Scheduling and Branch Prediction * Jeremy R. Johnson Wed. Nov. 8, 2000.
CMSC 611: Advanced Computer Architecture Scoreboard Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
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.
Data Hazards RAW Hazard ADD.D F3, F1, F2 SUB.D F5, F6, F3 No Solution, normal property of programs WAW Hazard DIV.D F3, F1, F2 SUB.D F3, F6, F5 This instruction.
1 Lecture 5 Branch Prediction (2.3) and Scoreboarding (A.7)
1 IBM System 360. Common architecture for a set of machines. Robert Tomasulo worked on a high-end machine, the Model 91 (1967), on which they implemented.
COMP381 by M. Hamdi 1 Pipelining (Dynamic Scheduling Through Hardware Schemes)
1 Recap (Scoreboarding). 2 Dynamic Scheduling Dynamic Scheduling by Hardware – – Allow Out-of-order execution, Out-of-order completion – – Even though.
ENGS 116 Lecture 71 Scoreboarding Vincent H. Berk October 8, 2008 Reading for today: A.5 – A.6, article: Smith&Pleszkun FRIDAY: NO CLASS Reading for Monday:
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Oct 5, 2005 Topic: Instruction-Level Parallelism (Dynamic Scheduling: Scoreboarding)
Nov. 9, Lecture 6: Dynamic Scheduling with Scoreboarding and Tomasulo Algorithm (Section 2.4)
Out-of-order execution: Scoreboarding and Tomasulo Week 2
1 Lecture 6 Tomasulo Algorithm CprE 581 Computer Systems Architecture, Fall 2009 Zhao Zhang Reading:Textbook 2.4, 2.5.
CET 520/ Gannod1 Section A.8 Dynamic Scheduling using a Scoreboard.
Professor Nigel Topham Director, Institute for Computing Systems Architecture School of Informatics Edinburgh University Informatics 3 Computer Architecture.
2/24; 3/1,3/11 (quiz was 2/22, QuizAns 3/8) CSE502-S11, Lec ILP 1 Tomasulo Organization FP adders Add1 Add2 Add3 FP multipliers Mult1 Mult2 From.
1 Images from Patterson-Hennessy Book Machines that introduced pipelining and instruction-level parallelism. Clockwise from top: IBM Stretch, IBM 360/91,
CSC 4250 Computer Architectures September 29, 2006 Appendix A. Pipelining.
04/03/2016 slide 1 Dynamic instruction scheduling Key idea: allow subsequent independent instructions to proceed DIVDF0,F2,F4; takes long time ADDDF10,F0,F8;
CIS 662 – Computer Architecture – Fall Class 11 – 10/12/04 1 Scoreboarding  The following four steps replace ID, EX and WB steps  ID: Issue –
COMP25212 Advanced Pipelining Out of Order Processors.
Instruction-Level Parallelism and Its Dynamic Exploitation
IBM System 360. Common architecture for a set of machines
Images from Patterson-Hennessy Book
HY425 – Αρχιτεκτονική Υπολογιστών Διάλεξη 05
Out of Order Processors
Step by step for Tomasulo Scheme
CS203 – Advanced Computer Architecture
CSE 520 Computer Architecture Lec Chapter 2 - DS-Tomasulo
Lecture 6 Score Board And Tomasulo’s Algorithm
9/18/2018 CPE 631 Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenković, Electrical and Computer.
Lecture 3: Introduction to Advanced Pipelining
Advantages of Dynamic Scheduling
High-level view Out-of-order pipeline
11/14/2018 CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenković, Electrical and Computer.
CMSC 611: Advanced Computer Architecture
A Dynamic Algorithm: Tomasulo’s
COMP s1 Seminar 3: Dynamic Scheduling
Out of Order Processors
Last Week Talks Any feedback from the talks? What did you like?
CS252 Graduate Computer Architecture Lecture 6 Scoreboard, Tomasulo, Register Renaming February 7th, 2011 John Kubiatowicz Electrical Engineering and.
September 15, 2000 Prof. John Kubiatowicz
John Kubiatowicz (http.cs.berkeley.edu/~kubitron)
John Kubiatowicz (http.cs.berkeley.edu/~kubitron)
CS 704 Advanced Computer Architecture
Lecture 7: Dynamic Scheduling with Tomasulo Algorithm (Section 2.4)
Static vs. dynamic scheduling
CSCE430/830 Computer Architecture
Static vs. dynamic scheduling
September 20, 2000 Prof. John Kubiatowicz
1/2/2019 CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenković, Electrical and Computer.
Tomasulo Organization
Reduction of Data Hazards Stalls with Dynamic Scheduling
CS152 Computer Architecture and Engineering Lecture 16 Compiler Optimizations (Cont) Dynamic Scheduling with Scoreboards.
CS252 Graduate Computer Architecture Lecture 6 Tomasulo, Implicit Register Renaming, Loop-Level Parallelism Extraction Explicit Register Renaming February.
Scoreboarding ENGS 116 Lecture 7 Vincent H. Berk October 5, 2005
/ Computer Architecture and Design
John Kubiatowicz (http.cs.berkeley.edu/~kubitron)
September 20, 2000 Prof. John Kubiatowicz
CS252 Graduate Computer Architecture Lecture 6 Introduction to Advanced Pipelining: Out-Of-Order Execution John Kubiatowicz Electrical Engineering and.
High-level view Out-of-order pipeline
Lecture 7 Dynamic Scheduling
Presentation transcript:

Lecture 5 Scoreboarding: Enforce Register Data Dependence Scoreboard design, big example This lecture will cover sections 1.1-1.4: introduction, application, technology trends, cost and price. Revised from D. Patterson s1998

From MIPS pipeline to Scoreboard 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

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 Revised from D. Patterson s1998

Four Stages of Scoreboard Control 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 proceeds to the FU; (2) scoreboard updates its internal data structure If an instruction is stalled at this stage, no other instructions can proceed 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

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

Scoreboard Connections Registers FP mult FP mult … FP div FP add INT unit Scoreboard Control/ status Control/ status Revised from D. Patterson s1998

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. Register result status—Indicates which functional unit will write each register, if one exists. Blank when no pending instructions will write that register What you might have thought 1. 4 stages of instruction executino 2.Status of FU: Normal things to keep track of (RAW & structura for busyl): Fi from instruction format of the mahine (Fi is dest) Add unit can Add or Sub Rj, Rk - status of registers (Yes means ready) Qj,Qk - If a no in Rj, Rk, means waiting for a FU to write result; Qj, Qk means wihch FU waiting for it 3.Status of register result (WAW &WAR)s: which FU is going to write into registers Scoreboard on 6600 = size of FU 6.7, 6.8, 6.9, 6.12, 6.13, 6.16, 6.17 FU latencies: Add 2, Mult 10, Div 40 clocks Revised from D. Patterson s1998

Detailed Scoreboard Pipeline Control Read operands Execution complete Instruction status Write result Issue Rj and Rk Functional unit done Wait until f((Fj( f )≠Fi(FU) or Rj( f )=No) & (Fk( f ) ≠Fi(FU) or Rk( f )=No)) Not busy (FU) and not result(D) Bookkeeping 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 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; 1.Issue - if no structural haards AND non wAW (no Funtional Unit is going to write this destination register; 1 per clock cycle 2. Read -(RAW) if no instructions is going to write a source register of this instruction (alternatively, no write signal this clock cycle) +> gein exection of the instruction; many read ports, so can read many times 3. Execution Complete; multiple during clock cyle 4. Write result - (WAR) If no instructiion is watiing to read the destination register; assume multiple wriite ports; wait for clock cycle to write and tehn read the results; assume can oerlap issue & write show clock cyclesneed 20 or so Latency: minimum is 4 through 4 stages Revised from D. Patterson s1998

Revised from D. Patterson s1998 Scoreboard Example Revised from D. Patterson s1998

Scoreboard Example Cycle 1 Revised from D. Patterson s1998

Scoreboard Example Cycle 2 Issue 2nd LD? Revised from D. Patterson s1998

Scoreboard Example Cycle 3 Issue MULT? Revised from D. Patterson s1998

Scoreboard Example Cycle 4 Revised from D. Patterson s1998

Scoreboard Example Cycle 5 Revised from D. Patterson s1998

Scoreboard Example Cycle 6 Revised from D. Patterson s1998

Scoreboard Example Cycle 7 Read multiply operands? Revised from D. Patterson s1998

Scoreboard Example Cycle 8a Revised from D. Patterson s1998

Scoreboard Example Cycle 8b Revised from D. Patterson s1998

Scoreboard Example Cycle 9 Read operands for MULT & SUBD? Issue ADDD? Revised from D. Patterson s1998

Scoreboard Example Cycle 11 Revised from D. Patterson s1998

Scoreboard Example Cycle 12 Read operands for DIVD? Revised from D. Patterson s1998

Scoreboard Example Cycle 13 Revised from D. Patterson s1998

Scoreboard Example Cycle 14 Revised from D. Patterson s1998

Scoreboard Example Cycle 15 Revised from D. Patterson s1998

Scoreboard Example Cycle 16 Revised from D. Patterson s1998

Scoreboard Example Cycle 17 Write result of ADDD? Revised from D. Patterson s1998

Scoreboard Example Cycle 18 Revised from D. Patterson s1998

Scoreboard Example Cycle 19 Revised from D. Patterson s1998

Scoreboard Example Cycle 20 Revised from D. Patterson s1998

Scoreboard Example Cycle 21 Revised from D. Patterson s1998

Scoreboard Example Cycle 22 Revised from D. Patterson s1998

Scoreboard Example Cycle 61 Revised from D. Patterson s1998

Scoreboard Example Cycle 62 Revised from D. Patterson s1998

Scoreboard Scheduling Inst Issue Read operands Execution complete Write Result LD 1 2 3 4 5 6 7 8 MULT 9 19 20 SUBD 11 12 DIVD 21 61 62 ADDD 13 14 16 22 Revised from D. Patterson s1998

Revised from D. Patterson s1998 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) Revised from D. Patterson s1998

Revised from D. Patterson s1998 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