Conceptual execution on a processor which exploits ILP

Slides:



Advertisements
Similar presentations
Hardware-Based Speculation. Exploiting More ILP Branch prediction reduces stalls but may not be sufficient to generate the desired amount of ILP One way.
Advertisements

A scheme to overcome data hazards
Dynamic ILP: Scoreboard Professor Alvin R. Lebeck Computer Science 220 / ECE 252 Fall 2008.
1 Lecture: Out-of-order Processors Topics: out-of-order implementations with issue queue, register renaming, and reorder buffer, timing, LSQ.
Dyn. Sched. CSE 471 Autumn 0219 Tomasulo’s algorithm “Weaknesses” in scoreboard: –Centralized control –No forwarding (more RAW than needed) Tomasulo’s.
Computer Organization and Architecture (AT70.01) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: Based.
COMP25212 Advanced Pipelining Out of Order Processors.
Microprocessor Microarchitecture Dependency and OOO Execution Lynn Choi Dept. Of Computer and Electronics Engineering.
Spring 2003CSE P5481 Reorder Buffer Implementation (Pentium Pro) Hardware data structures retirement register file (RRF) (~ IBM 360/91 physical registers)
CPE 731 Advanced Computer Architecture ILP: Part IV – Speculative Execution Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University.
1 Zvika Guz Slides modified from Prof. Dave Patterson, Prof. John Kubiatowicz, and Prof. Nancy Warter-Perez Out Of Order Execution.
1 Lecture 7: Out-of-Order Processors Today: out-of-order pipeline, memory disambiguation, basic branch prediction (Sections 3.4, 3.5, 3.7)
Review of CS 203A Laxmi Narayan Bhuyan Lecture2.
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.
1 Lecture 9: Dynamic ILP Topics: out-of-order processors (Sections )
Expl. ILP & Dyn.Sched CSE 4711 How to improve (decrease) CPI Recall: CPI = Ideal CPI + CPI contributed by stalls Ideal CPI =1 for single issue machine.
Ch2. Instruction-Level Parallelism & Its Exploitation 2. Dynamic Scheduling ECE562/468 Advanced Computer Architecture Prof. Honggang Wang ECE Department.
Nov. 9, Lecture 6: Dynamic Scheduling with Scoreboarding and Tomasulo Algorithm (Section 2.4)
1 Sixth Lecture: Chapter 3: CISC Processors (Tomasulo Scheduling and IBM System 360/91) Please recall:  Multicycle instructions lead to the requirement.
1 Lecture 6 Tomasulo Algorithm CprE 581 Computer Systems Architecture, Fall 2009 Zhao Zhang Reading:Textbook 2.4, 2.5.
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.
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;
1 Lecture: Out-of-order Processors Topics: a basic out-of-order processor with issue queue, register renaming, and reorder buffer.
Reg. ren & Mult. Issue CSE 4711 Reorder Buffer: register renaming and in- order completion Use of a reorder buffer –Reorder buffer = circular queue with.
CS203 – Advanced Computer Architecture ILP and Speculation.
Instruction-Level Parallelism and Its Dynamic Exploitation
IBM System 360. Common architecture for a set of machines
Lecture: Out-of-order Processors
Dynamic Scheduling Why go out of style?
/ Computer Architecture and Design
Out of Order Processors
Step by step for Tomasulo Scheme
CS203 – Advanced Computer Architecture
Lecture: Out-of-order Processors
Microprocessor Microarchitecture Dynamic Pipeline
Advantages of Dynamic Scheduling
High-level view Out-of-order pipeline
CMSC 611: Advanced Computer Architecture
Lecture 6: Advanced Pipelines
A Dynamic Algorithm: Tomasulo’s
Out of Order Processors
Lecture 10: Out-of-order Processors
Lecture 11: Out-of-order Processors
Lecture: Out-of-order Processors
Lecture 8: ILP and Speculation Contd. Chapter 2, Sections 2. 6, 2
ECE 2162 Reorder Buffer.
Lecture: Out-of-order Processors
Lecture 8: Dynamic ILP Topics: out-of-order processors
Adapted from the slides of Prof
Checking for issue/dispatch
Lecture 7: Dynamic Scheduling with Tomasulo Algorithm (Section 2.4)
How to improve (decrease) CPI
Pipeline control unit (highly abstracted)
Static vs. dynamic scheduling
Advanced Computer Architecture
Static vs. dynamic scheduling
Instruction Level Parallelism (ILP)
Tomasulo Organization
Reduction of Data Hazards Stalls with Dynamic Scheduling
Instruction Execution Cycle
Adapted from the slides of Prof
Pipeline control unit (highly abstracted)
September 20, 2000 Prof. John Kubiatowicz
Pipeline Control unit (highly abstracted)
CSL718 : Superscalar Processors
High-level view Out-of-order pipeline
Lecture 7 Dynamic Scheduling
CSE 586 Computer Architecture Lecture 3
Lecture 9: Dynamic ILP Topics: out-of-order processors
Presentation transcript:

Conceptual execution on a processor which exploits ILP Instruction fetch and branch prediction Corresponds to IF in simple pipeline Complicated by multiple issue and the potential need to fetch more than one basic block at a time (see later) Instruction decode, dependence check, dispatch, issue Corresponds (many variations) to ID Although instructions are issued (i.e., assigned to functional units), they might not execute right away (cf. reservation stations) Instruction execution Corresponds to EX and/or MEM (with various latencies) Instruction commit Corresponds to WB (see later) but more complex because of speculation and out-of-order completion 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Register renaming - Generalities Use a physical register file (or other storage form, e.g., reservation station or reorder buffer) larger than the ISA logical one When instruction is decoded Give a new name to result register from free list. The register is renamed Give source operands their physical names (from mapping table) 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Register renaming -- Requirements Keep a mapping table logical - physical correspondence Because of branch prediction, need to save the mapping table when predicting branch Keep a free list of empty physical registers Note that several physical registers can be mapped to the same logical register (corresponding to instructions at different times; avoids WAW hazards) 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Register renaming – Scheme 1: File of physical registers Extra set of registers At decode: Rename the result register (get from free list; update mapping table). If none available, we have a structural hazard When a physical register has been read for the last time, return it to the free list Have a counter associated with each physical register (+ when a source logical register is renamed to physical register; - when instruction uses physical register as operand; release when counter is 0) Simpler to wait till logical register has been assigned a new name by a later instruction and that later instruction has been committed 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Scheme 1: Example Before: add r3,r3,4 after add r37,r3,4 add r4,r7,r3 add r38,r7,r37 add r3, r2, r7 add r39,r2,r7 Free list r37,r38,r39 …. At this point r3 is r2, r3, r4, r7 not renamed yet remapped from r37 to r39 When r39 commits, r37 will be returned to the free list 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Register renaming – Scheme 2; Reorder buffer Use of a reorder buffer Reorder buffer = circular queue with head and tail pointers At issue (renaming time), an instruction is assigned an entry at the tail of the reorder buffer which becomes the name of (or a pointer to) the result register At end of functional-unit computation, value is put in the instruction reorder buffer’s position When the instruction reaches the head of the buffer, its value is stored in the logical or physical (other reorder buffer entry) register. Still need of a mapping table 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Scheme 2: Example Before: add r3,r3,4 after add rob6,r3,4 add r4,r7,r3 add rob7,r7,rob6 add r3, r2, r7 add rob8,r2,r7 Assume reorder buffer is initially at position 6 and has more than 8 slots 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Data dependencies with register renaming Register renaming does not get rid of RAW dependencies Still need for forwarding or for indicating whether a register has received its value Register renaming gets rid of WAW and WAR dependencies The reorder buffer, as its name implies, can be used for in-order completion 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 More on reorder buffer Tomasulo’s scheme can be extended with the possibility of completing instructions in order Reorder buffer entry contains (this is not the only possible solution) Type of instruction (branch, store, ALU, or load) Destination (none, memory address, register) Value and its presence/absence Replaces load/store buffers Reservation station tags and “true” register tags are now ids of entries in the reorder buffer 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Example machine revisited Reorder buffer From memory & CDB From I-unit To memory Fp registers Reservation stations To CDB (CDB not shown) F-p units 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Need for 4 stages In Tomasulo’s solution 3 stages: issue, execute, write Now 4 stages: issue, execute, write, commit Dispatch and Issue Check for structural hazards (reservation stations busy, reorder buffer full). If one exists, stall the instruction and those following If dispatch possible, send values to reservation station if the values are available in either the registers or the reorder buffer. Otherwise send tag. Allocate an entry in the reorder buffer and send its number to the reservation station When both operands are ready, issue to functional unit 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Need for 4 stages (c’ed) Execute Write Broadcast on common data bus the value and the tag (reorder buffer number). Reservation stations, if any match the tag, and reorder buffer (always) grab the value. Commit When instr. at head of the reorder buffer has its result in the buffer it stores it in the real register (for ALU) or memory (for store). The reorder buffer entry (and/or physical register) is freed. 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes 3 Mul F0, F2, F4 yes 4 Sub F8, F6, F2 yes 5 Div F10, F0, F6 yes 6 Add F6,F8,F2 yes Reservation Stations Initial Name Busy Fm Vj Vk Qj Qk Add 1 yes Sub (#1) (#2) Add2 yes Add (#4) (#2) Add3 no Mul1 yes Mul (F4) (#2) Mul2 yes Div (#1) (#3) Register status F0 (#3) F2 (#2) F4 ( ) F6(#6 ) F8 (#4) F10 (#5) F12... 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes 4 Sub F8, F6, F2 yes yes Cycle after 2nd load has committed 5 Div F10, F0, F6 yes 6 Add F6,F8,F2 yes Reservation Stations Name Busy Fm Vj Vk Qj Qk Add 1 no Add2 yes Add (#2) (#4) Add3 no Mul1 yes Mul (#2) (F4) Mul2 yes Div (#1) (#3) Register status F0 (#3) F2( ) F4 ( ) F6(#6 ) F8 (#4) F10 (#5) F12... 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes 4 Sub F8, F6, F2 yes yes yes 5 Div F10, F0, F6 yes Cycle after sub has written its result in reorder buffer but can’t commit yet 6 Add F6,F8,F2 yes yes Reservation Stations Name Busy Fm Vj Vk Qj Qk Add 1 no Add2 yes Add (#2) (#4) Add3 no Mul1 yes Mul (#2) (F4) Mul2 yes Div (#1) (#3) Still waiting for #3 to commit Register status F0 (#3) F2( ) F4 ( ) F6(#6 ) F8 (#4) F10 (#5) F12... 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes 4 Sub F8, F6, F2 yes yes yes 5 Div F10, F0, F6 yes 6 Add F6,F8,F2 yes yes yes Reservation Stations Cycle after add has written its result in reorder buffer but cannot commit Name Busy Fm Vj Vk Qj Qk Add 1 no Add2 no Add3 no Mul1 yes Mul (#2) (F4) Mul2 yes Div (#1) (#3) Still waiting for #3 to commit Register status F0 (#3) F2( ) F4 ( ) F6(#6 ) F8 (#4) F10 (#5) F12... Still waiting for #3,#4, #5 to commit 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes yes yes 4 Sub F8, F6, F2 yes yes yes 5 Div F10, F0, F6 yes yes 6 Add F6,F8,F2 yes yes yes Reservation Stations Name Busy Fm Vj Vk Qj Qk Cycle after mul has written its result and committed Add 1 no Add2 no Add3 no Mul1 no Mul2 yes Div (#3) (#1) Still waiting for #3 to commit Register status F0 () F2( ) F4 ( ) F6(#6 ) F8 (#4) F10 (#5) F12... Still waiting for #3,#4, #5 to commit 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes yes yes 4 Sub F8, F6, F2 yes yes yes yes 5 Div F10, F0, F6 yes yes 6 Add F6,F8,F2 yes yes yes Reservation Stations Name Busy Fm Vj Vk Qj Qk Now #3 can commit Add 1 no Add2 no Add3 no Mul1 no Mul2 yes Div (#3) (#1) Register status F0 () F2( ) F4 ( ) F6(#6 ) F8 () F10 (#5) F12... Still waiting for #4, #5 to commit 7/21/2019 Reg. Renaming CSE 471 Autumn 01

Reg. Renaming CSE 471 Autumn 01 Reorder buffer Entry # Instruction Issue Execute Write result Commit 1 Load F6, 34(r2) yes yes yes yes 2 Load F2, 45(r3) yes yes yes yes 3 Mul F0, F2, F4 yes yes yes yes 4 Sub F8, F6, F2 yes yes yes yes 5 Div F10, F0, F6 yes yes 6 Add F6,F8,F2 yes yes yes Reservation Stations Name Busy Fm Vj Vk Qj Qk The next “interesting event is completion of div; then commit of #5, then commit of #6 Add 1 no Add2 no Add3 no Mul1 no Mul2 yes Div (#3) (#1) Register status F0 () F2( ) F4 ( ) F6(#6 ) F8 () F10 (#5) F12... Still waiting for #4, #5 to commit 7/21/2019 Reg. Renaming CSE 471 Autumn 01