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

Similar documents
CISC 662 Graduate Computer Architecture. Lecture 10 - ILP 3

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

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

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

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

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

Processor: Superscalars Dynamic Scheduling

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

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

Metodologie di Progettazione Hardware-Software

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

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

Superscalar Architectures: Part 2

COSC4201 Instruction Level Parallelism Dynamic Scheduling

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

Static vs. Dynamic Scheduling

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

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

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

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

Adapted from David Patterson s slides on graduate computer architecture

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

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

EECC551 Exam Review 4 questions out of 6 questions

Four Steps of Speculative Tomasulo cycle 0

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

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

Topics. Digital Systems Architecture EECE EECE Predication, Prediction, and Speculation

Handout 2 ILP: Part B

Instruction-Level Parallelism and Its Exploitation

Instruction Level Parallelism (ILP)

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

Website for Students VTU NOTES QUESTION PAPERS NEWS RESULTS

Instruction Level Parallelism

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

Scoreboard information (3 tables) Four stages of scoreboard control

Instruction Level Parallelism. Taken from

EITF20: Computer Architecture Part3.2.1: Pipeline - 3

Outline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar, VLIW. CPE 631 Session 19 Exploiting ILP with SW Approaches

Functional Units. Registers. The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Input Control Memory

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

NOW Handout Page 1. Review from Last Time #1. CSE 820 Graduate Computer Architecture. Lec 8 Instruction Level Parallelism. Outline

Super Scalar. Kalyan Basu March 21,

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

5008: Computer Architecture

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation

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

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

Hardware-based Speculation

Instruction Level Parallelism

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

High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Hardware-Based Speculation

The basic structure of a MIPS floating-point unit

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

332 Advanced Computer Architecture Chapter 3. Dynamic scheduling, out-of-order execution, register renaming and speculative execution

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

Lecture 4: Introduction to Advanced Pipelining

ESE 545 Computer Architecture Instruction-Level Parallelism (ILP) and Static & Dynamic Instruction Scheduling Instruction level parallelism

CS252 Graduate Computer Architecture Lecture 5. Interrupt Controller CPU. Interrupts, Software Scheduling around Hazards February 1 st, 2012

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

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

EEC 581 Computer Architecture. Instruction Level Parallelism (3.6 Hardware-based Speculation and 3.7 Static Scheduling/VLIW)

EEC 581 Computer Architecture. Lec 7 Instruction Level Parallelism (2.6 Hardware-based Speculation and 2.7 Static Scheduling/VLIW)

CSE 502 Graduate Computer Architecture. Lec 8-10 Instruction Level Parallelism

EECC551 Review. Dynamic Hardware-Based Speculation

NOW Handout Page 1. Review from Last Time. CSE 820 Graduate Computer Architecture. Lec 7 Instruction Level Parallelism. Recall from Pipelining Review

NOW Handout Page 1. Outline. Csci 211 Computer System Architecture. Lec 4 Instruction Level Parallelism. Instruction Level Parallelism

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

Multi-cycle Instructions in the Pipeline (Floating Point)

DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD

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

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

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

CS425 Computer Systems Architecture

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Lecture 18: Instruction Level Parallelism -- Dynamic Superscalar, Advanced Techniques,

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 3. Instruction-Level Parallelism and Its Exploitation

Advanced Computer Architecture CMSC 611 Homework 3. Due in class Oct 17 th, 2012

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

CS425 Computer Systems Architecture

Advanced issues in pipelining

Announcements. ECE4750/CS4420 Computer Architecture L11: Speculative Execution I. Edward Suh Computer Systems Laboratory

Copyright 2012, Elsevier Inc. All rights reserved.

ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST *

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

Advanced Computer Architecture

ECSE 425 Lecture 15: More Dynamic Scheduling

ESE 545 Computer Architecture Instruction-Level Parallelism (ILP): Speculation, Reorder Buffer, Exceptions, Superscalar Processors, VLIW

Recall from Pipelining Review. Instruction Level Parallelism and Dynamic Execution

Hardware-based Speculation

Lecture 9: Case Study MIPS R4000 and Introduction to Advanced Pipelining Professor Randy H. Katz Computer Science 252 Spring 1996

Tomasulo s Algorithm

Advantages of Dynamic Scheduling

Good luck and have fun!

Lecture 8 Dynamic Branch Prediction, Superscalar and VLIW. Computer Architectures S

CS 614 COMPUTER ARCHITECTURE II FALL 2004

Outline EEL 5764 Graduate Computer Architecture. Chapter 2 - Instruction Level Parallelism. Recall from Pipelining Review

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

Transcription:

CS252 Graduate Computer Architecture Lecture 6 Tomasulo, Implicit Register Renaming, Loop-Level Parallelism Extraction Explicit Register Renaming John Kubiatowicz Electrical Engineering and Computer Sciences University of California, Berkeley http://www.eecs.berkeley.edu/~kubitron/cs252 Recall: Software Pipelining Example Before: Unrolled 3 times 1 LD F0,0(R1) 2 ADDD F4,F0,F2 3 SD 0(R1),F4 4 LD F6,-8(R1) 5 ADDD F8,F6,F2 6 SD -8(R1),F8 7 LD F10,-16(R1) 8 ADDD F12,F10,F2 9 SD -16(R1),F12 10 SUBI R1,R1,#24 11 BNEZ R1,LOOP Symbolic Loop Unrolling Maximize result-use distance Less code space than unrolling Fill & drain pipe only once per loop After: Software Pipelined 1 SD 0(R1),F4 ; Stores M[i] 2 ADDD F4,F0,F2 ; Adds to M[i-1] 3 LD F0,-16(R1); Loads M[i-2] 4 SUBI R1,R1,#8 5 BNEZ R1,LOOP SW Pipeline Time Loop Unrolled Time vs. once per each unrolled iteration in loop unrolling 5 cycles per iteration 2/9/2009 CS252-S09, Lecture 6 2 overlapped ops Registers Review: Scoreboard (CDC 6600) SCOREBOARD FP FP Mult Mult FP FP Mult Mult FP FP Divide Divide FP FP Add Add Integer Functional Units Memory 2/9/2009 CS252-S09, Lecture 6 3 Review: Scoreboard Implications Scoreboard keeps track of dependencies between instructions that have already issued. Scoreboard replaces ID, EX, WB with 4 stages Out-of-order completion => WAR, WAW hazards? Solutions for WAR: Stall writeback until registers have been read Read registers only during Read Operands stage Greatly limits overlap of independent computations Solution for WAW: Detect hazard and stall issue of new instruction until other instruction completes Prevents overlapping of loop iterations! register renaming! We will fix this today Need to have multiple instructions in execution phase => multiple execution units or pipelined execution units 2/9/2009 CS252-S09, Lecture 6 4

Review: Scoreboard Example: Cycle 62 Read LD F2 45+ R3 5 6 7 8 MULTD F0 F2 F4 6 9 19 20 SUBD F8 F6 F2 7 9 11 12 DIVD F10 F0 F6 8 21 61 62 13 14 16 22 Integer Mult1 Mult2 Add Divide 62 FU In-order issue; out-of-order execute & commit 2/9/2009 CS252-S09, Lecture 6 5 Another Dynamic Algorithm: Tomasulo Algorithm For IBM 360/91 about 3 years after CDC 6600 (1966) Goal: High Performance without special compilers Differences between IBM 360 & CDC 6600 ISA IBM has only 2 register specifiers/instr vs. 3 in CDC 6600 IBM has 4 FP registers vs. 8 in CDC 6600 IBM has memory-register ops Why Study? lead to Alpha 21264, HP 8000, MIPS 10000, Pentium II, PowerPC 604, 2/9/2009 CS252-S09, Lecture 6 6 Tomasulo Organization From Mem FP Op Queue Load Buffers Load1 Load2 Load3 Load4 Load5 Load6 Add1 Add2 Add3 FP FP adders adders Mult1 Mult2 Reservation Stations FP Registers FP FP multipliers Store Buffers To Mem Common Data Bus (CDB) 2/9/2009 CS252-S09, Lecture 6 7 Tomasulo Algorithm vs. Scoreboard Control & buffers distributed with Function Units (FU) vs. centralized in scoreboard; FU buffers called reservation stations ; have pending operands Registers in instructions replaced by values or pointers to reservation stations(rs); called register renaming ; avoids WAR, WAW hazards More reservation stations than registers, so can do optimizations compilers can t Results to FU from RS, not through registers, over Common Data Bus that broadcasts results to all FUs Load and Stores treated as FUs with RSs as well Integer instructions can go past branches, allowing FP ops beyond basic block in FP queue 2/9/2009 CS252-S09, Lecture 6 8

Reservation Station Components Op: Operation to perform in the unit (e.g., + or ) Vj, Vk: Value of Source operands Store buffers has V field, result to be stored Qj, Qk: Reservation stations producing source registers (value to be written) te: ready flags as in Scoreboard; Qj,Qk=0 => ready Store buffers only have Qi for RS producing result Busy: Indicates reservation station or FU is busy Indicates which functional unit will write each register, if one exists. Blank when no pending instructions that will write that register. Three Stages of Tomasulo Algorithm 1. Issue get instruction from FP Op Queue If reservation station free (no structural hazard), control issues instr & sends operands (renames registers). 2. Execution operate on operands (EX) When both operands ready then execute; if not ready, watch Common Data Bus for result 3. Write result finish execution (WB) Write on Common Data Bus to all awaiting units; mark reservation station available rmal data bus: data + destination ( go to bus) Common data bus: data + source ( come from bus) 64 bits of data + 4 bits of Functional Unit source address Write if matches expected Functional Unit (produces result) Does the broadcast 2/9/2009 CS252-S09, Lecture 6 9 2/9/2009 CS252-S09, Lecture 6 10 Tomasulo Example LD F6 34+ R2 Load1 LD F2 45+ R3 Load2 MULTD F0 F2 F4 Load3 SUBD F8 F6 F2 DIVD F10 F0 F6 RS Add1 Add2 Add3 Mult1 Mult2 0 FU Tomasulo Example Cycle 1 LD F6 34+ R2 1 Load1 Yes 34+R2 LD F2 45+ R3 Load2 MULTD F0 F2 F4 Load3 SUBD F8 F6 F2 DIVD F10 F0 F6 RS Add1 Add2 Add3 Mult1 Mult2 1 FU Load1 2/9/2009 CS252-S09, Lecture 6 11 2/9/2009 CS252-S09, Lecture 6 12

Tomasulo Example Cycle 2 LD F6 34+ R2 1 Load1 Yes 34+R2 LD F2 45+ R3 2 Load2 Yes 45+R3 MULTD F0 F2 F4 Load3 SUBD F8 F6 F2 DIVD F10 F0 F6 RS Add1 Add2 Add3 Mult1 Mult2 2 FU Load2 Load1 te: Unlike 6600, can have multiple loads outstanding 2/9/2009 CS252-S09, Lecture 6 13 Tomasulo Example Cycle 3 LD F6 34+ R2 1 3 Load1 Yes 34+R2 LD F2 45+ R3 2 Load2 Yes 45+R3 MULTD F0 F2 F4 3 Load3 SUBD F8 F6 F2 DIVD F10 F0 F6 RS Add1 Add2 Add3 Mult1 Yes MULTD R(F4) Load2 Mult2 3 FU Mult1 Load2 Load1 te: registers names are removed ( renamed ) in Reservation Stations; MULT issued vs. scoreboard Load1 completing; what is waiting for Load1? 2/9/2009 CS252-S09, Lecture 6 14 Tomasulo Example Cycle 4 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 Load2 Yes 45+R3 MULTD F0 F2 F4 3 Load3 SUBD F8 F6 F2 4 DIVD F10 F0 F6 RS Add1 Yes SUBD M(A1) Load2 Add2 Add3 Mult1 Yes MULTD R(F4) Load2 Mult2 4 FU Mult1 Load2 M(A1) Add1 Tomasulo Example Cycle 5 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 SUBD F8 F6 F2 4 RS 2 Add1 Yes SUBD M(A1) M(A2) Add2 Add3 10 Mult1 Yes MULTD M(A2) R(F4) 5 FU Mult1 M(A2) M(A1) Add1 Mult2 Load2 completing; what is waiting for Load2? 2/9/2009 CS252-S09, Lecture 6 15 2/9/2009 CS252-S09, Lecture 6 16

Tomasulo Example Cycle 6 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 SUBD F8 F6 F2 4 6 RS 1 Add1 Yes SUBD M(A1) M(A2) Add2 Yes ADDD M(A2) Add1 Add3 9Mult1 Yes MULTD M(A2) R(F4) 6 FU Mult1 M(A2) Add2 Add1 Mult2 Tomasulo Example Cycle 7 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 SUBD F8 F6 F2 4 7 6 RS 0 Add1 Yes SUBD M(A1) M(A2) Add2 Yes ADDD M(A2) Add1 Add3 8Mult1 Yes MULTD M(A2) R(F4) 7 FU Mult1 M(A2) Add2 Add1 Mult2 Issue ADDD here vs. scoreboard? 2/9/2009 CS252-S09, Lecture 6 17 Add1 completing; what is waiting for it? 2/9/2009 CS252-S09, Lecture 6 18 Tomasulo Example Cycle 8 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 RS Add1 2 Add2 Yes ADDD (M-M) M(A2) Add3 7Mult1 Yes MULTD M(A2) R(F4) 8 FU Mult1 M(A2) Add2 (M-M) Mult2 Tomasulo Example Cycle 9 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 RS Add1 1 Add2 Yes ADDD (M-M) M(A2) Add3 6Mult1 Yes MULTD M(A2) R(F4) 9 FU Mult1 M(A2) Add2 (M-M) Mult2 2/9/2009 CS252-S09, Lecture 6 19 2/9/2009 CS252-S09, Lecture 6 20

Tomasulo Example Cycle 10 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 10 RS Add1 0 Add2 Yes ADDD (M-M) M(A2) Add3 5Mult1 Yes MULTD M(A2) R(F4) 10 FU Mult1 M(A2) Add2 (M-M) Mult2 Add2 completing; what is waiting for it? 2/9/2009 CS252-S09, Lecture 6 21 Tomasulo Example Cycle 11 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 10 11 RS Add1 Add2 Add3 4Mult1 Yes MULTD M(A2) R(F4) 11 FU Mult1 M(A2) (M-M+M(M-M) Mult2 Write result of ADDD here vs. scoreboard? All quick instructions complete in this cycle! 2/9/2009 CS252-S09, Lecture 6 22 Tomasulo Example Cycle 12 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 10 11 RS Add1 Add2 Add3 3Mult1 Yes MULTD M(A2) R(F4) 12 FU Mult1 M(A2) (M-M+M(M-M) Mult2 Tomasulo Example Cycle 13 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 10 11 RS Add1 Add2 Add3 2Mult1 Yes MULTD M(A2) R(F4) 13 FU Mult1 M(A2) (M-M+M(M-M) Mult2 2/9/2009 CS252-S09, Lecture 6 23 2/9/2009 CS252-S09, Lecture 6 24

Tomasulo Example Cycle 14 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 Load3 6 10 11 RS Add1 Add2 Add3 1Mult1 Yes MULTD M(A2) R(F4) 14 FU Mult1 M(A2) (M-M+M(M-M) Mult2 Tomasulo Example Cycle 15 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 15 Load3 6 10 11 RS Add1 Add2 Add3 0Mult1 Yes MULTD M(A2) R(F4) 15 FU Mult1 M(A2) (M-M+M(M-M) Mult2 2/9/2009 CS252-S09, Lecture 6 25 2/9/2009 CS252-S09, Lecture 6 26 Tomasulo Example Cycle 16 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 15 16 Load3 6 10 11 RS Add1 Add2 Add3 Mult1 40 Mult2 Yes DIVD M*F4 M(A1) 16 FU M*F4 M(A2) (M-M+M(M-M) Mult2 Faster than light computation (skip a couple of cycles) 2/9/2009 CS252-S09, Lecture 6 27 2/9/2009 CS252-S09, Lecture 6 28

Tomasulo Example Cycle 55 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 15 16 Load3 6 10 11 RS Add1 Add2 Add3 Mult1 1Mult2 Yes DIVD M*F4 M(A1) 55 FU M*F4 M(A2) (M-M+M(M-M) Mult2 Tomasulo Example Cycle 56 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 15 16 Load3 56 6 10 11 RS Add1 Add2 Add3 Mult1 0Mult2 Yes DIVD M*F4 M(A1) 56 FU M*F4 M(A2) (M-M+M(M-M) Mult2 2/9/2009 CS252-S09, Lecture 6 29 Mult2 is completing; what is waiting for it? 2/9/2009 CS252-S09, Lecture 6 30 Tomasulo Example Cycle 57 LD F6 34+ R2 1 3 4 Load1 LD F2 45+ R3 2 4 5 Load2 MULTD F0 F2 F4 3 15 16 Load3 56 57 6 10 11 RS Add1 Add2 Add3 Mult1 Mult2 Yes DIVD M*F4 M(A1) 56 FU M*F4 M(A2) (M-M+M(M-M) Result Compare to Scoreboard Cycle 62 Read Issue Comp Result 1 3 4 LD F2 45+ R3 5 6 7 8 2 4 5 MULTD F0 F2 F4 6 9 19 20 3 15 16 SUBD F8 F6 F2 7 9 11 12 4 7 8 DIVD F10 F0 F6 8 21 61 62 5 56 57 13 14 16 22 6 10 11 Why take longer on scoreboard/6600? Structural Hazards Lack of forwarding Once again: In-order issue, out-of-order execution and completion. 2/9/2009 CS252-S09, Lecture 6 32 2/9/2009 CS252-S09, Lecture 6 31

Tomasulo v. Scoreboard (IBM 360/91 v. CDC 6600) CS 252 Administrivia Pipelined Functional Units Multiple Functional Units (6 load, 3 store, 3 +, 2 x/ ) (1 load/store, 1 +, 2 x, 1 ) window size: 14 instructions 5 instructions issue on structural hazard same WAR: renaming avoids stall completion WAW: renaming avoids stall issue Broadcast results from FU Write/read registers Control: reservation stations central scoreboard Interesting new Resource: http://bitsavers.org Has digital versions of users manuals for old machines Quite interesting! I ll link in some of them to your reading pages when it is appropriate Very limited bandwidth: use mirrors such as: http://bitsavers.vt100.net Textbook Reading for next few lectures: Computer Architecture: A Quantitative Approach, Chapter 2 Exams: Wednesday March 18 th and Wednesday May 6 th Currently 6:00 9:00pm. It would be here in 310 Soda Still have pizza afterwards 2/9/2009 CS252-S09, Lecture 6 33 2/9/2009 CS252-S09, Lecture 6 34 Paper Discussion (Reading #4) "The CRAY-1 Computer System," Richard Russel. Communications of the ACM, 21(1) 63-72, January 1978 Very successful Vector Machine Highly tuned physical implementation Virtual Memory: segmented protection + relocatable code "Parallel Operation in the CDC 6600," James E. Thorton. AFIPS Proc. FJCC, pt. 2 vol. 03, pp. 33-40, 1964 Pushed the Load-Store architecture that became staple of RISC Scoreboard for OOO execution (last lecture) Separation of I/O processors from main processor» Memory-mapped communication between them» Very modern ideas Tomasulo Loop Example Loop: LD F0 0 R1 MULTD F4 F0 F2 SD F4 0 R1 SUBI R1 R1 #8 BNEZ R1 Loop Assume Multiply takes 4 clocks Assume first load takes 8 clocks (cache miss), second load takes 1 clock (hit) To be clear, will show clocks for SUBI, BNEZ Reality: integer instructions ahead 2/9/2009 CS252-S09, Lecture 6 35 2/9/2009 CS252-S09, Lecture 6 36

Loop Example ITER Instruction j k Issue CompResult Busy Addr Fu 1 LD F0 0 R1 Load1 1 MULTD F4 F0 F2 Load2 1 SD F4 0 R1 Load3 2 LD F0 0 R1 Store1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 0 80 Fu Loop Example Cycle 1 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 Load2 1 SD F4 0 R1 Load3 2 LD F0 0 R1 Store1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 1 80 Fu Load1 2/9/2009 CS252-S09, Lecture 6 37 2/9/2009 CS252-S09, Lecture 6 38 Loop Example Cycle 2 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 Load3 2 LD F0 0 R1 Store1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F4) Load1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 2 80 Fu Load1 Mult1 2/9/2009 CS252-S09, Lecture 6 39 Loop Example Cycle 3 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F4) Load1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 3 80 Fu Load1 Mult1 Implicit renaming sets up DataFlow graph 2/9/2009 CS252-S09, Lecture 6 40

Loop Example Cycle 4 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F4) Load1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 4 80 Fu Load1 Mult1 Dispatching SUBI Instruction 2/9/2009 CS252-S09, Lecture 6 41 Loop Example Cycle 5 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F4) Load1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 5 72 Fu Load1 Mult1 And, BNEZ instruction 2/9/2009 CS252-S09, Lecture 6 42 Loop Example Cycle 6 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 Yes 72 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 6 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F4) Load1 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 6 72 Fu Load2 Mult1 tice that F0 never sees Load from location 80 2/9/2009 CS252-S09, Lecture 6 43 Loop Example Cycle 7 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 Yes 72 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 6 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 2 SD F4 0 R1 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load1 SUBI R1 R1 #8 Mult2 Yes Multd R(F2) Load2 BNEZ R1 Loop 7 72 Fu Load2 Mult2 Register file completely detached from computation First and Second iteration completely overlapped 2/9/2009 CS252-S09, Lecture 6 44

Loop Example Cycle 8 1 LD F0 0 R1 1 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 Yes 72 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 6 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load1 SUBI R1 R1 #8 Mult2 Yes Multd R(F2) Load2 BNEZ R1 Loop 8 72 Fu Load2 Mult2 2/9/2009 CS252-S09, Lecture 6 45 Loop Example Cycle 9 1 LD F0 0 R1 1 9 Load1 Yes 80 1 MULTD F4 F0 F2 2 Load2 Yes 72 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 6 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load1 SUBI R1 R1 #8 Mult2 Yes Multd R(F2) Load2 BNEZ R1 Loop 9 72 Fu Load2 Mult2 Load1 completing: who is waiting? te: Dispatching SUBI 2/9/2009 CS252-S09, Lecture 6 46 Loop Example Cycle 10 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 Load2 Yes 72 1 SD F4 0 R1 3 Load3 2 LD F0 0 R1 6 10 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 4 Mult1 Yes Multd M[80] R(F2) SUBI R1 R1 #8 Mult2 Yes Multd R(F2) Load2 BNEZ R1 Loop 10 64 Fu Load2 Mult2 11 64 Fu Load3 Mult2 Load2 completing: who is waiting? te: Dispatching BNEZ Next load in sequence 2/9/2009 CS252-S09, Lecture 6 48 2/9/2009 CS252-S09, Lecture 6 47 Loop Example Cycle 11 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 3 Mult1 Yes Multd M[80] R(F2) SUBI R1 R1 #8 4 Mult2 Yes Multd M[72] R(F2) BNEZ R1 Loop

Loop Example Cycle 12 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 2 Mult1 Yes Multd M[80] R(F2) SUBI R1 R1 #8 3 Mult2 Yes Multd M[72] R(F2) BNEZ R1 Loop 12 64 Fu Load3 Mult2 Why not issue third multiply? 2/9/2009 CS252-S09, Lecture 6 49 Loop Example Cycle 13 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 1 Mult1 Yes Multd M[80] R(F2) SUBI R1 R1 #8 2 Mult2 Yes Multd M[72] R(F2) BNEZ R1 Loop 13 64 Fu Load3 Mult2 2/9/2009 CS252-S09, Lecture 6 50 Loop Example Cycle 14 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 Mult1 2 MULTD F4 F0 F2 7 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 0 Mult1 Yes Multd M[80] R(F2) SUBI R1 R1 #8 1 Mult2 Yes Multd M[72] R(F2) BNEZ R1 Loop 14 64 Fu Load3 Mult2 Mult1 completing. Who is waiting? 2/9/2009 CS252-S09, Lecture 6 51 Loop Example Cycle 15 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 [80]*R2 2 MULTD F4 F0 F2 7 15 Store2 Yes 72 Mult2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 SUBI R1 R1 #8 0 Mult2 Yes Multd M[72] R(F2) BNEZ R1 Loop 15 64 Fu Load3 Mult2 Mult2 completing. Who is waiting? 2/9/2009 CS252-S09, Lecture 6 52

Loop Example Cycle 16 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 [80]*R2 2 MULTD F4 F0 F2 7 15 16 Store2 Yes 72 [72]*R2 2 SD F4 0 R1 8 Store3 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load3 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 16 64 Fu Load3 Mult1 Loop Example Cycle 17 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 [80]*R2 2 MULTD F4 F0 F2 7 15 16 Store2 Yes 72 [72]*R2 2 SD F4 0 R1 8 Store3 Yes 64 Mult1 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load3 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 17 64 Fu Load3 Mult1 2/9/2009 CS252-S09, Lecture 6 53 2/9/2009 CS252-S09, Lecture 6 54 Loop Example Cycle 18 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 18 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 Yes 80 [80]*R2 2 MULTD F4 F0 F2 7 15 16 Store2 Yes 72 [72]*R2 2 SD F4 0 R1 8 Store3 Yes 64 Mult1 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load3 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 18 64 Fu Load3 Mult1 Loop Example Cycle 19 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 18 19 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 2 MULTD F4 F0 F2 7 15 16 Store2 Yes 72 [72]*R2 2 SD F4 0 R1 8 19 Store3 Yes 64 Mult1 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load3 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 19 64 Fu Load3 Mult1 2/9/2009 CS252-S09, Lecture 6 55 2/9/2009 CS252-S09, Lecture 6 56

Loop Example Cycle 20 1 LD F0 0 R1 1 9 10 Load1 1 MULTD F4 F0 F2 2 14 15 Load2 1 SD F4 0 R1 3 18 19 Load3 Yes 64 2 LD F0 0 R1 6 10 11 Store1 2 MULTD F4 F0 F2 7 15 16 Store2 2 SD F4 0 R1 8 19 20 Store3 Yes 64 Mult1 Add1 LD F0 0 R1 Add2 MULTD F4 F0 F2 Add3 SD F4 0 R1 Mult1 Yes Multd R(F2) Load3 SUBI R1 R1 #8 Mult2 BNEZ R1 Loop 20 64 Fu Load3 Mult1 Why can Tomasulo overlap iterations of loops? Register renaming Multiple iterations use different physical destinations for registers (dynamic loop unrolling). Reservation stations Permit instruction issue to advance past integer control flow operations Other idea: Tomasulo building dynamic DataFlow graph from instructions Fits in with readings for Wednesday 2/9/2009 CS252-S09, Lecture 6 57 2/9/2009 CS252-S09, Lecture 6 58 Explicit Register Renaming Tomasulo provides Implicit Register Renaming User registers renamed to reservation station tags Explicit Register Renaming: Use physical register file that is larger than number of registers specified by ISA Keep a translation table: ISA register => physical register mapping When register is written, replace table entry with new register from freelist. Physical register becomes free when not being used by any instructions in progress. Pipeline can be exactly like standard DLX pipeline IF, ID, EX, etc. Advantages: Removes all WAR and WAW hazards Like Tomasulo, good for allowing full out-of-order completion Allows data to be fetched from a single register file Makes speculative execution/precise interrupts easier:» All that needs to be undone for precise break point is to undo the table mappings 2/9/2009 CS252-S09, Lecture 6 59 Question: Can we use explicit register renaming with scoreboard? Registers Rename Table SCOREBOARD FP FP Mult Mult FP FP Mult Mult FP FP Divide Divide FP FP Add Add Integer Functional Units Memory 2/9/2009 CS252-S09, Lecture 6 60

Scoreboard Example Read LD F6 34+ R2 LD F2 45+ R3 MULTD F0 F2 F4 SUBD F8 F6 F2 DIVD F10 F0 F6 Int1 Int2 Mult1 Add Divide FU P0 P2 P4 P6 P8 P10 P12 P30 Initialized Rename Table 2/9/2009 CS252-S09, Lecture 6 61 Renamed Scoreboard 1 Read LD F6 34+ R2 1 LD F2 45+ R3 MULTD F0 F2 F4 SUBD F8 F6 F2 DIVD F10 F0 F6 Int1 Yes Load P32 R2 Yes Int2 Mult1 Add Divide 1 FU P0 P2 P4 P32 P8 P10 P12 P30 Each instruction allocates free register Similar to single-assignment compiler transformation 2/9/2009 CS252-S09, Lecture 6 62 Renamed Scoreboard 2 Read LD F6 34+ R2 1 2 LD F2 45+ R3 2 MULTD F0 F2 F4 SUBD F8 F6 F2 DIVD F10 F0 F6 Int1 Yes Load P32 R2 Yes Int2 Yes Load P34 R3 Yes Mult1 Add Divide 2 FU P0 P34 P4 P32 P8 P10 P12 P30 Renamed Scoreboard 3 Read LD F6 34+ R2 1 2 3 LD F2 45+ R3 2 3 MULTD F0 F2 F4 3 SUBD F8 F6 F2 DIVD F10 F0 F6 Int1 Yes Load P32 R2 Yes Int2 Yes Load P34 R3 Yes Mult1 Yes Multd P36 P34 P4 Int2 Yes Add Divide 3 FU P36 P34 P4 P32 P8 P10 P12 P30 2/9/2009 CS252-S09, Lecture 6 63 2/9/2009 CS252-S09, Lecture 6 64

Renamed Scoreboard 4 Read LD F2 45+ R3 2 3 4 MULTD F0 F2 F4 3 SUBD F8 F6 F2 4 DIVD F10 F0 F6 Int1 Int2 Yes Load P34 R3 Yes Mult1 Yes Multd P36 P34 P4 Int2 Yes Add Yes Sub P38 P32 P34 Int2 Yes Divide 4 FU P36 P34 P4 P32 P38 P10 P12 P30 Renamed Scoreboard 5 Read MULTD F0 F2 F4 3 SUBD F8 F6 F2 4 Int1 Int2 Mult1 Yes Multd P36 P34 P4 Yes Yes Add Yes Sub P38 P32 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 5 FU P36 P34 P4 P32 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 65 2/9/2009 CS252-S09, Lecture 6 66 Renamed Scoreboard 6 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 Int1 Int2 10 Mult1 Yes Multd P36 P34 P4 Yes Yes 2Add Yes Sub P38 P32 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 6 FU P36 P34 P4 P32 P38 P40 P12 P30 Renamed Scoreboard 7 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 Int1 Int2 9Mult1 Yes Multd P36 P34 P4 Yes Yes 1Add Yes Sub P38 P32 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 7 FU P36 P34 P4 P32 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 67 2/9/2009 CS252-S09, Lecture 6 68

Renamed Scoreboard 8 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 Int1 Int2 8Mult1 Yes Multd P36 P34 P4 Yes Yes 0Add Yes Sub P38 P32 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 8 FU P36 P34 P4 P32 P38 P40 P12 P30 Renamed Scoreboard 9 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 Int1 Int2 7Mult1 Yes Multd P36 P34 P4 Yes Yes Add Divide Yes Divd P40 P36 P32 Mult1 Yes 9 FU P36 P34 P4 P32 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 69 2/9/2009 CS252-S09, Lecture 6 70 Renamed Scoreboard 10 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 Renamed Scoreboard 11 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 11 Int1 Int2 WAR Hazard gone! 6Mult1 Yes Multd P36 P34 P4 Yes Yes Add Yes Addd P42 P38 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 10 FU P36 P34 P4 P42 P38 P40 P12 P30 tice that P32 not listed in Rename Table Still live. Must not be reallocated by accident 2/9/2009 CS252-S09, Lecture 6 72 2/9/2009 CS252-S09, Lecture 6 71 Int1 Int2 5Mult1 Yes Multd P36 P34 P4 Yes Yes 2 Add Yes Addd P42 P38 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 11 FU P36 P34 P4 P42 P38 P40 P12 P30

Renamed Scoreboard 12 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 11 Int1 Int2 4Mult1 Yes Multd P36 P34 P4 Yes Yes 1 Add Yes Addd P42 P38 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 12 FU P36 P34 P4 P42 P38 P40 P12 P30 Renamed Scoreboard 13 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 11 13 Int1 Int2 3Mult1 Yes Multd P36 P34 P4 Yes Yes 0 Add Yes Addd P42 P38 P34 Yes Yes Divide Yes Divd P40 P36 P32 Mult1 Yes 13 FU P36 P34 P4 P42 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 73 2/9/2009 CS252-S09, Lecture 6 74 Renamed Scoreboard 14 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 11 13 14 Int1 Int2 2Mult1 Yes Multd P36 P34 P4 Yes Yes Add Divide Yes Divd P40 P36 P32 Mult1 Yes 14 FU P36 P34 P4 P42 P38 P40 P12 P30 Renamed Scoreboard 15 Read MULTD F0 F2 F4 3 6 SUBD F8 F6 F2 4 6 8 9 10 11 13 14 Int1 Int2 1Mult1 Yes Multd P36 P34 P4 Yes Yes Add Divide Yes Divd P40 P36 P32 Mult1 Yes 15 FU P36 P34 P4 P42 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 75 2/9/2009 CS252-S09, Lecture 6 76

Renamed Scoreboard 16 Read MULTD F0 F2 F4 3 6 16 SUBD F8 F6 F2 4 6 8 9 10 11 13 14 Int1 Int2 0Mult1 Yes Multd P36 P34 P4 Yes Yes Add Divide Yes Divd P40 P36 P32 Mult1 Yes 16 FU P36 P34 P4 P42 P38 P40 P12 P30 Renamed Scoreboard 17 Read MULTD F0 F2 F4 3 6 16 17 SUBD F8 F6 F2 4 6 8 9 10 11 13 14 Int1 Int2 Mult1 Add Divide Yes Divd P40 P36 P32 Mult1 Yes Yes 17 FU P36 P34 P4 P42 P38 P40 P12 P30 2/9/2009 CS252-S09, Lecture 6 77 2/9/2009 CS252-S09, Lecture 6 78 Renamed Scoreboard 18 Read MULTD F0 F2 F4 3 6 16 17 SUBD F8 F6 F2 4 6 8 9 18 10 11 13 14 Int1 Int2 Mult1 Add 40 Divide Yes Divd P40 P36 P32 Mult1 Yes Yes 18 FU P36 P34 P4 P42 P38 P40 P12 P30 Explicit Renaming Support Includes: Rapid access to a table of translations A physical register file that has more registers than specified by the ISA Ability to figure out which physical registers are free. free registers stall on issue Thus, register renaming doesn t require reservation stations. However: Many modern architectures use explicit register renaming + Tomasulo-like reservation stations to control execution. 2/9/2009 CS252-S09, Lecture 6 79 2/9/2009 CS252-S09, Lecture 6 80

Summary Reservations stations: renaming to larger set of registers + buffering source operands Prevents registers as bottleneck Avoids WAR, WAW hazards of Scoreboard Allows loop unrolling in HW Dynamic hardware schemes can unroll loops dynamically in hardware Form of limited dataflow Register renaming is essential Helps cache misses as well Lasting Contributions of Tomasulo Algorithm Dynamic scheduling Register renaming Load/store disambiguation 360/91 descendants are Pentium II; PowerPC 604; MIPS R10000; HP-PA 8000; Alpha 21264 2/9/2009 CS252-S09, Lecture 6 81 Summary #2 Explicit Renaming: more physical registers than needed by ISA. Rename table: tracks current association between architectural registers and physical registers Uses a translation table to perform compiler-like transformation on the fly With Explicit Renaming: All registers concentrated in single register file Can utilize bypass network that looks more like 5-stage pipeline Introduces a register-allocation problem» Need to handle branch misprediction and precise exceptions differently, but ultimately makes things simpler For precise exceptions and branch prediction: Clearly need something like reorder buffer/future file (next time) 2/9/2009 CS252-S09, Lecture 6 82