Superscalar Processors Ch 13. Superscalar Processing (5) Computer Organization II 10/10/2001. New dependency for superscalar case? (8) Name dependency

Similar documents
Superscalar Processing (5) Superscalar Processors Ch 14. New dependency for superscalar case? (8) Output Dependency?

Superscalar Processors Ch 14

TECH. CH14 Instruction Level Parallelism and Superscalar Processors. What is Superscalar? Why Superscalar? General Superscalar Organization

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 14 Instruction Level Parallelism and Superscalar Processors

Organisasi Sistem Komputer

RISC & Superscalar. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 12. Instruction Pipeline no hazard.

Computer Systems Architecture I. CSE 560M Lecture 10 Prof. Patrick Crowley

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

SUPERSCALAR AND VLIW PROCESSORS

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

SISTEMI EMBEDDED. Computer Organization Pipelining. Federico Baronti Last version:

Superscalar Machines. Characteristics of superscalar processors

What is Superscalar? CSCI 4717 Computer Architecture. Why the drive toward Superscalar? What is Superscalar? (continued) In class exercise

Lecture 9: Superscalar processing

5008: Computer Architecture

Superscalar Processors

Hardware-based Speculation

Hardware-Based Speculation

EN164: Design of Computing Systems Topic 06.b: Superscalar Processor Design

Getting CPI under 1: Outline

Superscalar Processors

Lecture 19: Instruction Level Parallelism

Branch Prediction & Speculative Execution. Branch Penalties in Modern Pipelines

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

The Processor: Instruction-Level Parallelism

A superscalar machine is one in which multiple instruction streams allow completion of more than one instruction per cycle.

Advanced d Instruction Level Parallelism. Computer Systems Laboratory Sungkyunkwan University

Lecture: Out-of-order Processors. Topics: out-of-order implementations with issue queue, register renaming, and reorder buffer, timing, LSQ

Copyright 2012, Elsevier Inc. All rights reserved.

Handout 2 ILP: Part B

Reorder Buffer Implementation (Pentium Pro) Reorder Buffer Implementation (Pentium Pro)

COMPUTER ORGANIZATION AND DESI

Processor (IV) - advanced ILP. Hwansoo Han

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

CS 152 Computer Architecture and Engineering. Lecture 12 - Advanced Out-of-Order Superscalars

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard

Static vs. Dynamic Scheduling

Case Study IBM PowerPC 620

Parallelism. Execution Cycle. Dual Bus Simple CPU. Pipelining COMP375 1

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

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

EE382A Lecture 7: Dynamic Scheduling. Department of Electrical Engineering Stanford University

EN164: Design of Computing Systems Lecture 24: Processor / ILP 5

Real Processors. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

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

CS6303 Computer Architecture Regulation 2013 BE-Computer Science and Engineering III semester 2 MARKS

November 7, 2014 Prediction

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

CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25

Architectural Performance. Superscalar Processing. 740 October 31, i486 Pipeline. Pipeline Stage Details. Page 1

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation

UG4 Honours project selection: Talk to Vijay or Boris if interested in computer architecture projects

Orange Coast College. Business Division. Computer Science Department. CS 116- Computer Architecture. Pipelining

Lecture 5: Instruction Pipelining. Pipeline hazards. Sequential execution of an N-stage task: N Task 2

Instruction Level Parallelism

EECC551 Exam Review 4 questions out of 6 questions

E0-243: Computer Architecture

Multithreaded Processors. Department of Electrical Engineering Stanford University

Instruction Level Parallelism

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

ECE473 Computer Architecture and Organization. Pipeline: Control Hazard

PowerPC 620 Case Study

Pipelining and Vector Processing

Dynamic Scheduling. CSE471 Susan Eggers 1

Hardware Speculation Support

Micro-programmed Control Ch 17

Simultaneous Multithreading Processor

Hyperthreading 3/25/2008. Hyperthreading. ftp://download.intel.com/technology/itj/2002/volume06issue01/art01_hyper/vol6iss1_art01.

Micro-programmed Control Ch 15

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

Micro-programmed Control Ch 15

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

1 Hazards COMP2611 Fall 2015 Pipelined Processor

INSTRUCTION LEVEL PARALLELISM

CS152 Computer Architecture and Engineering. Complex Pipelines

Superscalar Processor Design

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

CS311 Lecture: Pipelining, Superscalar, and VLIW Architectures revised 10/18/07

CS377P Programming for Performance Single Thread Performance Out-of-order Superscalar Pipelines

MIPS Pipelining. Computer Organization Architectures for Embedded Computing. Wednesday 8 October 14

CS425 Computer Systems Architecture

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

DYNAMIC AND SPECULATIVE INSTRUCTION SCHEDULING

Website for Students VTU NOTES QUESTION PAPERS NEWS RESULTS

Midterm Exam 1 Wednesday, March 12, 2008

ECE260: Fundamentals of Computer Engineering

Limitations of Scalar Pipelines

Portland State University ECE 587/687. The Microarchitecture of Superscalar Processors

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

Advanced Computer Architecture

Out of Order Processing

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

Adapted from David Patterson s slides on graduate computer architecture

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

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

DYNAMIC SPECULATIVE EXECUTION

Chapter 9 Pipelining. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Instruction-Level Parallelism and Its Exploitation

Transcription:

Superscalar Processors Ch 13 Limitations, Hazards Instruction Issue Policy Register Renaming Branch Prediction 1 New dependency for superscalar case? (8) Name dependency (nimiriippuvuus) two use the same data item register or in memory no value passed from one instruction to another have all their correct data available each individual result is the one intended overall result is not the one intended two cases: Output Dependency & Antidependency (kirjoitusriippuvuus?) (antiriippuvuus) examples on next 2 slides what if there are aliases? E.g., two virtual addresses, same physical address 4 Superscalar Processing (5) Basic idea: more than one instruction completion per cycle Aimed at speeding up scalar processing use many pipelines and not just more pipeline phases Fig. 13.2 Many in execution phase simultaneously need parallelism also in earlier & later phases may not execute (completely) in given order Fig. 13.1 Multiple pipelines question: when can instruction be executed? Fetch many at the same time memory access must not be bottleneck 2 Output Dependency? (1) Some earlier instruction has not yet finished writing from the same location that we want to write to execution time semantics determined by the original order of machine read r1, sum add r2, r1, r3 add r1, r4, r5 Need to preserve order Want to have sum of r4 and r5 in r1 after all these three were executed 5 Why couldn t we execute this instruction right now? (4) (True) Data Dependency (datariippuvuus) Procedural or Control Dependency even more costlier than with normal pipeline now may waste more than one instruction! Resource Conflict there is no available circuit right now memory buffer, FP adder, register file port Usual solution: circuits to detect problem and stall pipeline when needed load mul Fig. 13.3 r4, salary(r6) r2, r4, r10 (kontrolliriippuvuus) (resurssikonflikti) 3 Antidependency (1) Some earlier instruction has not yet finished reading from the same location that we want to write to Need to preserve order mv add Want to have original value of r1 in r2 r2, r1 r1, r4, r5 6 Ch 13, Superscalar Processors 1

Machine Parallelism (2) Instruction-level parallelism How much parallelism is there Theoretical maximum Machine parallelism How much parallelism is achieved by any specific machine or architecture? At most as much as instruction-level parallelism dependencies? physical resources? not optimized (stupid) design? Window of Execution Bigger is better easier to find a good candidate that can be issued right now more work to figure out all dependencies too small value will limit machine parallelism significantly E.g., 6 th instruction could be issued, but only 4 next ones are even considered 7 10 Superscalar Processor (4) Instruction dispatch get next available executable instruction from instruction stream Window of execution all that are considered to be issued Instruction issue allow instruction to start execution execution and completion phase should continue now with no stalls if any stalls needed, do them before issue Instruction reorder and commit (retiring) hopefully all system state changes here! last chance to change order or abandon results 8 Instruction Issue (3) Select next instruction(s) for execution Check first everything so that execution can proceed with no stalls (stopping) to the end resource conflicts data dependencies control dependencies output dependencies antidependencies Simpler instruction execution pipelines no need to check for dependencies 11 Instruction Dispatch (7) Whenever there are both available slots in window of execution ready from prefetch or branch prediction buffer that do not need to stall at all during execution all dependencies do not need to be solved yet must know that all dependencies are solved by the time a stall would occur data in R4 is not yet there, but it will be there in three cycles when it is needed by this instruction Instruction Issue Policies (3) Instruction fetch policy constraints on how many are considered to be dispatched at a time E.g., 2 fetched and decoded at a time both must be dispatched before next 2 fetched Instruction execution policy constraints on which order dispatched may start execution Completion policy constraints the order of completions 9 12 Ch 13, Superscalar Processors 2

Example 1 of Issue Policy (7) In-order issue with in-order completion same as purely sequential execution no instruction window needed Fig. 13.4 (a) instruction issued only in original order completed only in original order many can be completed at the same time check before issue: execution time, so that completions occur in order: wait long enough that earlier will complete first Pentium II: out-of-order middle execution for microops (uops) 13 Get Rid of Name Dependencies (3) Problem: independent data stored in locations with the same name often a storage conflict: same register used for two different purposes results in wait stages (pipeline stalls, bubbles ) Cure: register renaming actual registers may be different than named registers actual registers allocated dynamically to named registers allocate them so that name dependencies are avoided Cost: more registers circuits to allocate and keep track of actual registers 16 Example 2 of Issue Policy (5) In-order issue with out-of-order completion issue in original order Fig. 13.4 (b) no instruction window needed allow executions complete before those of earlier check before issue: output dependencies: wait long enough to solve them 14 Register Renaming (3) Output dependency: I3 can not complete before I1 has completed first: Antidependency: I3 can not complete before I2 has read value from R3: Rename data in register R3 to actual hardware registers R3a, R3b, R3c Rename also other registers: R4b, R5a, R7b No name dependencies now: Drawback: need more registers Pentium II: 40 extra regs + 16 normal regs Why R3a & R3b? R3:=R3 + R5; R4:=R3 + 1; R3:=R5 + 1; R7:=R3 + R4; R3b:=R3a + R5a R4b:=R3b + 1 R3c:=R5a + 1 R7b:=R3c + R4b (I1) (I2) (I3) (I4) (I1) (I2) (I3) (I4) 17 The real superscalar processor Example 3 of Issue Policy (5) Out-of-order issue with out-of-order completion issue in any order Fig. 13.4 (c) instruction window for dynamic instruction scheduling allow executions complete before those of earlier Check before issue: output dependencies: wait for earlier to write their results before we overwrite them antidependencies: wait for earlier issued later to pick up arguments before overwriting them Superscalar Implementation (7) Fetch strategy prefetch, branch prediction Dependency check logic Forwarding circuits (shortcuts) to transfer dependency data directly instead via registers or memory (to get data accessible earlier) Multiple functional units (pipelines) Effective memory hierarchy to service many memory accesses simultaneously Logic to issue multiple instruction simultaneously Logic to commit instruction in correct order 15 18 Ch 13, Superscalar Processors 3

Overall Gain from Superscalar Implementation See the effect of... renaming right graph issue window size color of vertical bar out-of-order issue base machine duplicated data cache access +ld/st ALU ALU both both Max speed-up about 4 Fig. 13.5 PowerPC 601 Pipelines (4) Instruction pipelines Fig. 13.12 all state changes in final Write Back phase up to 3 instruction can be dispatched at the same time, and issued right after that in each pipeline if no dependencies exist dependencies solved by stalls ALU ops place their result in one of 8 condition code field in condition register up to 8 separate conditions active concurrently 19 22 PowerPC 601 Branches (4) Zero cycle branches branch target addresses computed already in lower dispatch buffers before dispatch or issue! Easy: unconditional branches (jumps) or branch on already resolved condition code field otherwise conditional branch backward: guess taken conditional branch forward: guess not taken if speculation ends up wrong, cancel conditional in pipeline before write-back speculate only on one branch at a time 20 23 Example: PowerPC 601 Architecture (2) General RISC organization instruction formats Fig. 10.9 3 execution units Fig. 13.10 Logical view 4 instruction window for issue each execution unit picks up next one for it whenever there is room for new instruction integer issued only when 1st (dispatch buffer 0) in queue Fig. 13.11 PowerPC 601 Example Conditional branch example Original C code Fig. 13.13 (a) Assembly code Fig. 13.13 (b) predict branch not taken Correct branch prediction Fig. 13.14 (a) Incorrect branch prediction Fig. 13.14 (b) 21 24 Ch 13, Superscalar Processors 4

PowerPC 620 Architecture 6 execution units Fig. 4.25 Up to 4 dispatched simultaneously Reservation stations to store dispatched and their arguments [HePa96] Fig. 4.49 kind of rename registers also! 25 28 PowerPC 620 Rename Registers (7) Rename registers to store results not yet committed [HePa96] Fig. 4.49 normal uncompleted and speculative 8 int and 12 FP extra rename registers in same register file as normal registers results copied to normal registers at commit information on what to do at commit is in completion unit in reorder buffers Instruction completes (commits) from completion unit reorder buffer once all previous are committed max 4 can commit at a time Intel Pentium II speculation 512-entry branch target buffer 4-bit prediction state, 4-way set-associative Static prediction used before dynamic will work forward not taken, backward branches taken In-order-completion for 40 uops (microoperations) limits speculation RSB 4 entry Return Stack Buffer 26 29 PowerPC 620 Speculation -- End of Chapter 13: Superscalar -- Speculation on branches 256-entry branch target buffer two-way set-associative 2048-entry branch history table used when branch target buffer misses speculation on max 4 unresolved branches (Fig. 4.49) (Hennessy-Patterson, Computer Architecture, 2nd Ed, 1996) 27 30 Ch 13, Superscalar Processors 5