Instruction Level Parallelism (ILP)

Size: px
Start display at page:

Download "Instruction Level Parallelism (ILP)"

Transcription

1 Instruction Level Parallelism (ILP) Pipelining supports a limited sense of ILP e.g. overlapped instructions, out of order completion and issue, bypass logic, etc. Remember Pipeline CPI = Ideal Pipeline CPI + Struct. Stalls + RAW Stalls + WAR Stalls + WAW Stalls + Control Stalls Issues involving crossing branches Now turn consideration to methods which reduce all of the terms on the RHS of the equation. solution is of course a combo of HW and SW/Compiler methods Chapter 4 page 1

2 Methods Table 1: Technique Loop Unrolling Basic Pipeline Scheduling (we ve seen some of this already) Dynamic Scheduling with Scoreboarding Dynamic Scheduling with register renaming Dynamic Branch Prediction Issuing multiple instructions per cycle a.k.a (also known as) Superscalar Compiler dependence analysis Software pipelining and trace scheduling Speculation Dynamic memory dependency analysis Reduces Control Stalls RAW stalls RAW stalls RAW stalls Control Stalls Ideal CPI Ideal CPI and data stalls (RAW, WAW, WAR) Ideal CPI and data stalls data and control stalls RAW stalls involving memory Chapter 4 page 2

3 ILP within a Basic Block Basic Block definition straightline code - no branches out single entry point at top ==> real code is a bunch of basic blocks connected by branch statements Notice branch frequency is approx. 15% of total mix implies basic block size between 6 and 7 instructions these 6-7 instructions are likely to depend on one another there s probably little to exploit in ILP Easiest target is the loop exploiting loop-level parallelism, i.e., among iterations of a loop because every iteration can overlap with any other iteration Chapter 4 page 3

4 Loop Level Parallelism Consider adding two 1000 element arrays for (i=1, i<=1000, i=i+1) x[i] = x[i] + y[i]; Sure it s trivial but it illustrates the point there is no dependence between data values produced in any interation j and those needed in j+n for any j and n truly independent - hence could be a 1000-way parallel program independence means no stalls due to hazards problem is that we have to use branch instructions and while prediction is easy - we have to be able to predict accurately Vector Processor model load vectors x and y (up to some machine dependent max) then do result-vec = xvec + yvec in a single instruction Chapter 4 page 4

5 Some Assumptions Isn t this course just full of them - this time they re stated Default DLX pipeline structure Instruction Producing Value Table 1: Instruction Consuming Value Intervening Clock Cycles to Avoid Stalls FP ALU Op FPU ALU Op 3 FP ALU Op Store Double 2 Load Double FP ALU Op 1 Load Double Store Double 0 Integer Load Integer ALU Op 1 Integer ALU Op Integer ALU Op 0 Branch Delay Slots Anything 1 Note: latencies are somewhat smaller than we saw last lecture Reason: make the examples less cumbersome Chapter 4 page 5

6 Loop Unrolling Consider adding a scalar to a vector for (i=1, i<=1000, i++) x[i] = x[i] + s loop: LD ADDD SD SUBI BNEZ FO, 0(R1) F4, F0, F2 0(R1), F4 R1, R1, #8 R1, loop ;R1 array ptr ;F2 = s ;put result ;back ;decr. R1 ;again if not ;done for convenience of exit the array starts at location 0 How does it run with no scheduling 10 cycles per iteration LD, load stall, ADDD, 2 RAW stalls, SD, SUBI, stall, BNEZ branch delay control stall Let s try to fill the delayed branch stall Chapter 4 page 6

7 Note: Scheduling the Loop Non-trivial and many compilers don t try this move SD to branch delay slot but since it will now be after the SUBI we ll need an offset of 8 SUBI doesn t have an RAW hazard with the add so no stall Result will run as: loop: 40% improvement 10 cycles ==> 6 but still a 3-cycle overhead in each loop iteration loop: LD ADDD SD SUBI BNEZ FO, 0(R1) F4, F0, F2 0(R1), F4 R1, R1, #8 R1, loop LD SUBI ADDD stall BNEZ SD FO, 0(R1) R1, R1, #8 F4, F0, F2 R1, loop 8(R1), F4 necessary Chapter 4 page 7

8 Basic Idea Loop Unrolling unroll n loop iterations into 1 basic block adjust the new termination code Let s say n is 4 Then modify the R1 pointer in the example by 4x of what it was before ==> 32 Savings - 4 BNEZ s + 4 SUBI s => just one of each Hence 75% improvement Problem - still have 4 load stalls per loop Next idea don t concatenate the unrolled segments shuffle them instead 4 LD s then 4 ADDD s then 2 SD s, SUBI, SD, BNEZ, then fill the branch delay slot with the final SD No more stalls afterward since LD to dependent ADDD path now has 3 instructions in it. Chapter 4 page 8

9 Loop: Result LD LD LD LD ADDD ADDD ADDD ADDD SD SD SUB1 SD BNEZ SD Result of Unrolling F0, 0(R1) F6, -8(R1) F10, -16(R1) F14, -24(R1) F4, F0, F2 F8, F6, F2 F12, F10, F2 F16, F14, F2 0(R1), F4-8(R1), F8 R1,R1,#32 16(R1) R1, Loop 8(R1), F16 Note: still didn t run out of registers - so we could have improved on this = -24 must compensate for final SD being after the SUBI 14 cycles for 4 loop iterations==> 3.5 cycles per iteration 10 cycles per iteration with no scheduling 6 cycles per iteration with scheduling but no unrolling Chapter 4 page 9

10 Things to Notice We had 8 more unused register pairs hence we could have gone to an 8 block unroll without register conflict problem is that then the 1000 element array would have to be broken cleanly (1000/8 = 125) what if it had not - say with remainder R so what -- just put R blocks in front of or outside of the loop and run you ll notice that you run out of registers but by cycling through the names you can still remove any stalls in this case Still there were many things the compiler had to notice to figure this one out (trickiest was the SD/SUBI swap) Key was the independent nature of each loop body 3 types of dependence: data, name, and control Chapter 4 page 10

11 Data Dependency Analysis i depends on j if: i uses a result produced by j OR i uses a result produced by k and k depends on j dependence indicates a possible RAW hazard whether it is really there is a property of the pipeline (e.g., OK after 3 cycles) and the structure of the forwarding logic But the possibility controls order in which results must be calculated sets a bound on how much parallelism can be exploited and therefore it affects the performance compilers static dataflow analysis uses a directed graph that makes these dependencies explicit Chapter 4 page 11

12 Occurs when Name Dependence 2 instructions use the same register name BUT no flow of data between the two insts. actually exists Two types of name dependences let i precede j in program order i is antidependent on j when j writes a register that i reads essentially the same as a WAR hazard hence the ordering must be preserved to avoid the hazard i is output dependent on j if they both write to the same register yep - a WAW hazard so we have to avoid that too No real data dependence -- just a name conflict so register can be renamed statically by the compiler or dynamically by the hardware to eliminate name dependences Chapter 4 page 12

13 Control Dependence Since branches are conditional a control-dependent inst. should not execute until branch resolved instructions before the branch don t matter Consider the following code: S1; if P then S2 else S3; 2 obvious constraints instructions controlled by the branch cannot be moved before the branch, e.g., cannot move "S2" ot "S3" before "if P". an instruction not controlled by the branch cannot be moved after the branch, e.g., cannot move S1 after "if P". Chapter 4 page 13

14 More on Control Dependence Violating the constraints? put a control-dependent inst before the branch? OK if we can trash the result when the branch goes the wrong way works when the result goes to a register which becomes dead (result never used) if the wrong way is taken However 2 important side-effects affect correctness issues exception behavior remains intact sometimes this is relaxed but it probably shouldn t be branches effectively set up conditional data flow data flow is definitely real so if we do the move then we better make sure it doesn t change the data flow So it can be done but care must be taken Discuss it in Sections 4.5 and 4.6 on speculation execution Chapter 4 page 14

15 Some Examples Start with the old example for (i=1, i<=1000, i++) x[i] = x[i] + s loop: LD ADDD SD SUBI BNEZ FO, 0(R1) F4, F0, F2 0(R1), F4 R1, R1, 8 R1, loop ;R1 array ptr ;F2 = s ;put result ;back ;decr. R1 ;again if not ;done Name, Control, and Data dependencies? (SUBI produces a value needed in the next loop) SUBI-induced data dependencies with insts. in the next loop are removed by code transformation, i.e., removing intermediate SUBIs Name dependencies are resolved by register renaming Control dependencies are minimized by removing intermediate BRs Compiler can do all these Chapter 4 page 15

16 Implication for (i=1; i<=1000; i++) { A[i+1] = A[i] + C[i]; B[i+1] = B[i] + A[i+1];} Now Consider /* S1*/ /* S2*/ S1 uses a value produced by S1 in an earlier iteration S2 also uses a value produced by S2 in an earlier iteration S2 uses a value produced by S1 in the same iteration S1 depends (loop-carried) on S1 hence their order must be preserved Similar for the S2 carried dependence Note if non-loop-carried dependences were the only ones then the order would not matter Chapter 4 page 16

17 One More for (i=1; i<=100; i++) { A[i] = A[i] + B[i]; B[i+1] = C[i] + D[i];} /* S1*/ /* S2*/ S1 uses a value produced by S2 in an earlier iteration However this loop-carried dependence is not circular since neither statement depends on itself no cycle: S1 depends on S2 but S2 does not depend on S1 Implications No cycle in dependencies ==> loop can be parallelized to: A[1] = A[1] + B[1]; No loop-carried dependence so UNROLL for (i=1; i<=99; i++) { B[i+1] = C[i] + D[i]; /* S1*/ A[i+1] = A[i+1] + B[i+1];} /* S2*/ B[101]=C[100] + D[100]; Chapter 4 page 17

18 Dynamic Pipeline Scheduling Compiler does Static Scheduling Hardware rearranges instruction stream to reduce stalls Treats dependencies which are only known at run time - e.g. memory reference Simplifies the compiler Even permits compiled code to run on a different pipeline Minimizes the need for speculative slot filling Unlike DLX which holds instruction issue on stalls Issues and executes instructions that are ready Chapter 4 page 18

19 Dynamic Scheduling a.k.a. dynamic instruction reordering allow out-of-order issue consider DIVD ADDD SUBD F0, F2, F4 F10, F0, F8 F12, F8, F14 DIVD has a long latency ADDD has a data dependence on F0, SUBD does not so swap them - compiler might have done this but so could the hardware Problems with out-of-order issue? precise interrupts -- we will discuss it in Section 4.6 Chapter 4 page 19

20 Scoreboarding Allowing instructions to be issued out-of-order Instructions ID IF Window Scoreboard Note: normal ID stage now split in 2: 1. issue 2. read operands EX CPU Pipeline WB Chapter 4 page 20

21 DLX Scoreboard Example More Interesting Code Fragment DIVF F0, F2, F4 ADDF F10, F0, F8 RAW hazard (data dependence) SUBF F8, F8, F14 WAR hazard (antidependence) Note following ADDF can t start until DIVF completes SUBF doesn t need to wait but can t post result to F8 until ADDF reads F8 Change the DLX pipeline design ID is split into 2 stages: Issue and Read Operands -- Issue: decode and issue if no structural and WAW hazards -- Read Operands: wait until no data hazard; then read operands Execute: just do it - remember multiple EX units available Chapter 4 page 21

22 Scoreboards Introduced with the CDC FPU s 5 MMU s 7 IU s Centralized hazard detection Load/Store architecture Results approx. 60% due to dynamic ordering cost inflates by approx. 20% still fastest machine of it s day a few years ago technique too complex for single chip designs Now both IBM and HP bring it back into the game Chapter 4 page 22

23 DLX with a Scoreboard Registers FP Mult FP Mult FP Divide FP Add Note: this model could support both single or multi-issue more than one multiple insts. will be issued per cycle Integer Unit One set of buses serves a group of FUs SCOREBOARD Chapter 4 page 23

24 New 4 step Pipeline Section RULES Really 6 but ignore IF & Mem to focus on Reg-Reg issues OLD ID EX WB Issue free execution unit AND no destination register conflict ==> issue else stall e.g. check for structural and WAW hazards (one S.Hz might be Opnd and Result busses) nothing out of order yet - if issue stalls then IF stalls when IF/ISSUE buffer fills Read Operands scoreboard monitors source operand availability available if no earlier active is going to write it OR it is being written by an active dynamic RAW resolution ==> insts. can be sent into execution out of order now Execution Starts when operands are received May take multiple cycles so unit notifies the scoreboard when it s done Write Result Scoreboard checks for WAR hazards before permitting this stage to happen Chapter 4 page 24

25 could have picked better names Scoreboard Data Structure Components Instruction Status indicates which step the instruction is in Functional Unit Status Busy - indicates whether the FU is doing something Op - operation being performed by the FU Fi - destination Register Fj, Fk - left and right source register numbers Qj, Qk - FU producing source values (Qj --> Fj, Qk -->Fk) Register Result Status indicates which active FU will provide a value for each register blank means nothing active will post to this register Note overlap with Fj, Fk, Qj, Qk fields Chapter 4 page 25

26 Example - Remember the RULES Table 1: Instruction Issue RD Opnd Ex. Done Wr. Result Inst. Status LD F6, 34(R2) X X X X LD F2,45(R3) X X X MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10,F0,F6 ADDD F6, F8, F2 Where are the potential hazards? Table 2: X X X Rj & Rk = No when both are read Name Busy Op Fi Fj Fk Qj Qk Rj Rk FU Status Integer Yes load F2 R3 No Mult1 Yes Mult F0 F2 F4 Int. No Yes Mult2 No Add Yes Sub F8 F6 F2 Int. Yes No Divide Yes Div F10 F0 F6 Mult1 No Yes Table 3: RREG F0 F2 F4 F6 F8 F10 F12... F30 FU Mult1 Int. Add Divide Chapter 4 page 26

27 Blank Forms - work out each step Table 1: Instruction Issue RD Opnd Ex. Done Wr. Result Inst. Status LD F6, 34(R2) LD F2,45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10,F0,F6 ADDD F6, F8, F2 Table 2: Name Busy Op Fi Fj Fk Qj Qk Rj Rk FU Status Integer Mult1 Mult2 Add Divide RREG FU Table 3: F0 F2 F4 F6 F8 F10 F12... F30 Chapter 4 page 27

28 Blank Forms - work out each step Table 1: Instruction Issue RD Opnd Ex. Done Wr. Result Inst. Status LD F6, 34(R2) LD F2,45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10,F0,F6 ADDD F6, F8, F2 Table 2: Name Busy Op Fi Fj Fk Qj Qk Rj Rk FU Status Integer Mult1 Mult2 Add Divide RREG FU Table 3: F0 F2 F4 F6 F8 F10 F12... F30 Chapter 4 page 28

29 Blank Forms - work out each step Table 1: Instruction Issue RD Opnd Ex. Done Wr. Result Inst. Status LD F6, 34(R2) LD F2,45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10,F0,F6 ADDD F6, F8, F2 Table 2: Name Busy Op Fi Fj Fk Qj Qk Rj Rk FU Status Integer Mult1 Mult2 Add Divide RREG FU Table 3: F0 F2 F4 F6 F8 F10 F12... F30 Chapter 4 page 29

30 Blank Forms - work out each step Table 1: Instruction Issue RD Opnd Ex. Done Wr. Result Inst. Status LD F6, 34(R2) LD F2,45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10,F0,F6 ADDD F6, F8, F2 Table 2: Name Busy Op Fi Fj Fk Qj Qk Rj Rk FU Status Integer Mult1 Mult2 Add Divide RREG FU Table 3: F0 F2 F4 F6 F8 F10 F12... F30 Chapter 4 page 30

31 For the CDC 6600 Scoreboarding Results 70% improvement for Fortran 150% improvement for hand coded assembly language cost was similar to one of the functional units surprisingly low bulk of cost was in the extra busses Still this was in ancient time no caches no main semiconductor memory no software pipelining not so powerful compilers So why is it coming back? dynamic scheduling exploits more ILP via out-of-order issue Chapter 4 page 31

32 Intrinsic Scoreboard Limitations Amount of ILP mainly limited by true dependencies in a basic block compiler can help reduce dependencies - unrolling, scheduling, etc. Number of Scoreboard Entries meaning how far to look ahead called a window size the larger the better how to handle branches? -- use speculation see Section 4.6 Number and Types of Functional Units more means less structural hazards Antidependecies and Output Dependencies WAR and WAW hazards respectively renaming (use virtual registers) and more registers will help Chapter 4 page 32

33 Tomasulo's Scheduling Algorithm used in IBM 360/91 (3 years after CDC 6600) Attempt to deal with long memory and FP latencies IBM 360/91 permits Reg-Mem instructions and several iterative style compare instructions as well 2 main differences from the CDC scoreboard Hazard detection and interlocks are entirely distributed Each functional unit uses "reservation stations" to control execution reservation stations act independently as interlock permits Results passed directly to functional units rather than through the registers (that is, via virtual registers) forwarding is achived by broadcasting results to functional units viacdb (common data bus) achieved by a combination of "register renaming" and "tagging" mechanisms Basically a dataflow engine - hence no WAR or WAW hazards can exist - use rename instead Chapter 4 page 33

34 Reservation Station Duties Know which functional unit is to produce the desired source result Read sources off CDB when they appear When all operands are present enable the associated functional unit to execute Since values aren t really written to registers: No WAx hazards are possible Structural hazards checked at issue time for operations: this means reservation station availability for loads/stores: this means buffer availability Otherwise stall and try to issue other insts. in the window Chapter 4 page 34

35 The Tomasulo DLX From Memory From Instruction Unit Load Buffers FP Op. Queue FP Registers Store Buffers Reservation Stations FP Adders CDB Common Data Bus FP Multipliers Note: piped or 1 issue per cycle replicated FU s is same concept Chapter 4 page 35

36 Issue Instruction Steps get instruction from FP Queue for adds, mults. etc. issue it if there is an empty reservation station if the operands are in registers send them to the reservation station for loads/stores issue it available buffer is available stall otherwise due to the structural hazard; check other insts. in the queue Execute (by each reservation station independently of others) when all operands are available then execute if not then monitor CDB to grab desired operand when it is produced effectively deals with RAW hazards Write Result (also done by each reservation station) when result is available write it to the CDB from CDB it will go to a waiting reservation station and to the registers note renaming model prevents WAW and WAR hazards as a side effect Virtual registers with "Tags" a result broadcast to CDB is associated with a tag the tag identifies a virtual register ID that corresponds to a reservation station or a load buffer Chapter 4 page 36

37 Tomasulo's Data Structures Each Reservation Station: Op - the operation Qj, Qk - tag of reservation station or load buffer that will produce the operand blank ==> value is already available and copied to Vj, Vk Vj, Vk - the value of the operands (a copy) Busy - reservation station and its corresponding functional unit are occupied Register file and store buffers Qi - tag of reservation producing the store value Qi=blank means the value stored is ready and up-to-date Chapter 4 page 37

38 Example - all instructions issued, only 1st Load completed Instruction Status Table 1: Instruction Issue Execute Write Result LD F6, 34(R2) X X X LD F2, 45(R3) X X MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 Hazards? X X X X Reservation Stations Table 2: Note: load and store buffer busy also needed Name Busy Op Vj Vk Qj Qk Add1 Yes SUB Mem[34 + Regs[R2]] Load2 Add2 Yes Add Add1 Load2 Add3 No Mult1 Yes Mult Regs[F4] Load2 Mult2 Yes Div Mem[34 + Regs[R2]] Mult1 0 Register Status Table 3: F0 F2 F4 F6 F8 F10... F30 Mult1 Load2 Add2 Add1 Mult2 Chapter 4 page 38

39 Blank Forms LD1 LD2 LD3 LD4 LD5 LD6 Busy Addr Load Status LD F6, 34(R2) LD F2, 45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 Instruction Status Table 1: Instruction Issue Execute Write Result Reservation Stations Table 2: ST1 ST2 ST3 Qi Busy Addr Store Status Name Busy Op Vj Vk Qj Qk Add1 Add2 Add3 Mult1 Mult2 Register Status Table 3: F0 F2 F4 F6 F8 F10... F30 Chapter 4 page 39

40 Blank Forms LD1 LD2 LD3 LD4 LD5 LD6 Busy Addr Load Status LD F6, 34(R2) LD F2, 45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 Instruction Status Table 1: Instruction Issue Execute Write Result Reservation Stations Table 2: ST1 ST2 ST3 Qi Busy Addr Store Status Name Busy Op Vj Vk Qj Qk Add1 Add2 Add3 Mult1 Mult2 Register Status Table 3: F0 F2 F4 F6 F8 F10... F30 Chapter 4 page 40

41 Blank Forms LD1 LD2 LD3 LD4 LD5 LD6 Busy Addr Load Status LD F6, 34(R2) LD F2, 45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 Instruction Status Table 1: Instruction Issue Execute Write Result Reservation Stations Table 2: ST1 ST2 ST3 Qi Busy Addr Store Status Name Busy Op Vj Vk Qj Qk Add1 Add2 Add3 Mult1 Mult2 Register Status Table 3: F0 F2 F4 F6 F8 F10... F30 Chapter 4 page 41

42 Blank Forms LD1 LD2 LD3 LD4 LD5 LD6 Busy Addr Load Status LD F6, 34(R2) LD F2, 45(R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 Instruction Status Table 1: Instruction Issue Execute Write Result Reservation Stations Table 2: ST1 ST2 ST3 Qi Busy Addr Store Status Name Busy Op Vj Vk Qj Qk Add1 Add2 Add3 Mult1 Mult2 Register Status Table 3: F0 F2 F4 F6 F8 F10... F30 Chapter 4 page 42

43 Key Components of Tamosulo's Algorithm Benefit is Total Data Driven Dynamic memory disambiguation allowing loads and stores to be issued if addresses are different Hence: stall loads if there is a pending store with a matching address wait until the store is done then issue the load likewise, stall stores if there is a pending load from a previous instruction -- note that memory address conflict cannot be resolved by register renaming Register Renaming & Buffering of Sources source operand buffering resolves WAR hazards virtual registers and tagging resolve RAW and WAW Consider the following example: How are the hazards resolved? ADDD F1,F1,F3 followed by ADD F1,F1,F4 Chapter 4 page 43

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

What is ILP? Instruction Level Parallelism. Where do we find ILP? How do we expose ILP? What is ILP? Instruction Level Parallelism or Declaration of Independence The characteristic of a program that certain instructions are, and can potentially be. Any mechanism that creates, identifies,

More information

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

CPE 631 Lecture 11: Instruction Level Parallelism and Its Dynamic Exploitation Lecture 11: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenkovic, milenka@ece.uah.edu Electrical and Computer Engineering University of Alabama in Huntsville Outline Instruction

More information

Instruction-Level Parallelism and Its Exploitation

Instruction-Level Parallelism and Its Exploitation Chapter 2 Instruction-Level Parallelism and Its Exploitation 1 Overview Instruction level parallelism Dynamic Scheduling Techniques es Scoreboarding Tomasulo s s Algorithm Reducing Branch Cost with Dynamic

More information

Processor: Superscalars Dynamic Scheduling

Processor: Superscalars Dynamic Scheduling Processor: Superscalars Dynamic Scheduling Z. Jerry Shi Assistant Professor of Computer Science and Engineering University of Connecticut * Slides adapted from Blumrich&Gschwind/ELE475 03, Peh/ELE475 (Princeton),

More information

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

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenkovic, milenka@ece.uah.edu Electrical and Computer Engineering University of Alabama in Huntsville Outline Instruction

More information

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

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenković, milenka@ece.uah.edu Electrical and Computer Engineering University of Alabama in Huntsville Outline Tomasulo

More information

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

Graduate Computer Architecture. Chapter 3. Instruction Level Parallelism and Its Dynamic Exploitation Graduate Computer Architecture Chapter 3 Instruction Level Parallelism and Its Dynamic Exploitation 1 Overview Instruction level parallelism Dynamic Scheduling Techniques Scoreboarding (Appendix A.8) Tomasulo

More information

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

Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls CS252 Graduate Computer Architecture Recall from Pipelining Review Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: March 16, 2001 Prof. David A. Patterson Computer Science 252 Spring

More information

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

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1) Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1) ILP vs. Parallel Computers Dynamic Scheduling (Section 3.4, 3.5) Dynamic Branch Prediction (Section 3.3) Hardware Speculation and Precise

More information

CISC 662 Graduate Computer Architecture. Lecture 10 - ILP 3

CISC 662 Graduate Computer Architecture. Lecture 10 - ILP 3 CISC 662 Graduate Computer Architecture Lecture 10 - ILP 3 Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer

More information

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

Page 1. Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls CS252 Graduate Computer Architecture Recall from Pipelining Review Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: March 16, 2001 Prof. David A. Patterson Computer Science 252 Spring

More information

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

CS252 Graduate Computer Architecture Lecture 6. Recall: Software Pipelining Example CS252 Graduate Computer Architecture Lecture 6 Tomasulo, Implicit Register Renaming, Loop-Level Parallelism Extraction Explicit Register Renaming John Kubiatowicz Electrical Engineering and Computer Sciences

More information

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

Reduction of Data Hazards Stalls with Dynamic Scheduling So far we have dealt with data hazards in instruction pipelines by: Reduction of Data Hazards Stalls with Dynamic Scheduling So far we have dealt with data hazards in instruction pipelines by: Result forwarding (register bypassing) to reduce or eliminate stalls needed

More information

Metodologie di Progettazione Hardware-Software

Metodologie di Progettazione Hardware-Software Metodologie di Progettazione Hardware-Software Advanced Pipelining and Instruction-Level Paralelism Metodologie di Progettazione Hardware/Software LS Ing. Informatica 1 ILP Instruction-level Parallelism

More information

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

ELEC 5200/6200 Computer Architecture and Design Fall 2016 Lecture 9: Instruction Level Parallelism ELEC 5200/6200 Computer Architecture and Design Fall 2016 Lecture 9: Instruction Level Parallelism Ujjwal Guin, Assistant Professor Department of Electrical and Computer Engineering Auburn University,

More information

Floating Point/Multicycle Pipelining in DLX

Floating Point/Multicycle Pipelining in DLX Floating Point/Multicycle Pipelining in DLX Completion of DLX EX stage floating point arithmetic operations in one or two cycles is impractical since it requires: A much longer CPU clock cycle, and/or

More information

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

Review: Compiler techniques for parallelism Loop unrolling Ÿ Multiple iterations of loop in software: CS152 Computer Architecture and Engineering Lecture 17 Dynamic Scheduling: Tomasulo March 20, 2001 John Kubiatowicz (http.cs.berkeley.edu/~kubitron) lecture slides: http://www-inst.eecs.berkeley.edu/~cs152/

More information

COSC4201 Instruction Level Parallelism Dynamic Scheduling

COSC4201 Instruction Level Parallelism Dynamic Scheduling COSC4201 Instruction Level Parallelism Dynamic Scheduling Prof. Mokhtar Aboelaze Parts of these slides are taken from Notes by Prof. David Patterson (UCB) Outline Data dependence and hazards Exposing parallelism

More information

EECC551 Exam Review 4 questions out of 6 questions

EECC551 Exam Review 4 questions out of 6 questions EECC551 Exam Review 4 questions out of 6 questions (Must answer first 2 questions and 2 from remaining 4) Instruction Dependencies and graphs In-order Floating Point/Multicycle Pipelining (quiz 2) Improving

More information

Scoreboard information (3 tables) Four stages of scoreboard control

Scoreboard information (3 tables) Four stages of scoreboard control Scoreboard information (3 tables) Instruction : issued, read operands and started execution (dispatched), completed execution or wrote result, Functional unit (assuming non-pipelined units) busy/not busy

More information

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

CPE 631 Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation Aleksandar Milenkovic, milenka@ece.uah.edu Electrical and Computer Engineering University of Alabama in Huntsville Outline Instruction

More information

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

Page 1. Recall from Pipelining Review. Lecture 15: Instruction Level Parallelism and Dynamic Execution CS252 Graduate Computer Architecture Recall from Pipelining Review Lecture 15: Instruction Level Parallelism and Dynamic Execution March 11, 2002 Prof. David E. Culler Computer Science 252 Spring 2002

More information

The basic structure of a MIPS floating-point unit

The basic structure of a MIPS floating-point unit Tomasulo s scheme The algorithm based on the idea of reservation station The reservation station fetches and buffers an operand as soon as it is available, eliminating the need to get the operand from

More information

Static vs. Dynamic Scheduling

Static vs. Dynamic Scheduling Static vs. Dynamic Scheduling Dynamic Scheduling Fast Requires complex hardware More power consumption May result in a slower clock Static Scheduling Done in S/W (compiler) Maybe not as fast Simpler processor

More information

Lecture 4: Introduction to Advanced Pipelining

Lecture 4: Introduction to Advanced Pipelining Lecture 4: Introduction to Advanced Pipelining Prepared by: Professor David A. Patterson Computer Science 252, Fall 1996 Edited and presented by : Prof. Kurt Keutzer Computer Science 252, Spring 2000 KK

More information

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

Dynamic Scheduling. Better than static scheduling Scoreboarding: Tomasulo algorithm: LECTURE - 13 Dynamic Scheduling Better than static scheduling Scoreboarding: Used by the CDC 6600 Useful only within basic block WAW and WAR stalls Tomasulo algorithm: Used in IBM 360/91 for the FP unit

More information

Website for Students VTU NOTES QUESTION PAPERS NEWS RESULTS

Website for Students VTU NOTES QUESTION PAPERS NEWS RESULTS Advanced Computer Architecture- 06CS81 Hardware Based Speculation Tomasulu algorithm and Reorder Buffer Tomasulu idea: 1. Have reservation stations where register renaming is possible 2. Results are directly

More information

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

Review: Evaluating Branch Alternatives. Lecture 3: Introduction to Advanced Pipelining. Review: Evaluating Branch Prediction Review: Evaluating Branch Alternatives Lecture 3: Introduction to Advanced Pipelining Two part solution: Determine branch taken or not sooner, AND Compute taken branch address earlier Pipeline speedup

More information

Instruction Level Parallelism

Instruction Level Parallelism Instruction Level Parallelism The potential overlap among instruction execution is called Instruction Level Parallelism (ILP) since instructions can be executed in parallel. There are mainly two approaches

More information

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

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 Instruction Issue Execute Write result L.D F6, 34(R2) L.D F2, 45(R3) MUL.D F0, F2, F4 SUB.D F8, F2, F6 DIV.D F10, F0, F6 ADD.D F6, F8, F2 Name Busy Op Vj Vk Qj Qk A Load1 no Load2 no Add1 Y Sub Reg[F2]

More information

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

CS252 Graduate Computer Architecture Lecture 8. Review: Scoreboard (CDC 6600) Explicit Renaming Precise Interrupts February 13 th, 2010 CS252 Graduate Computer Architecture Lecture 8 Explicit Renaming Precise Interrupts February 13 th, 2010 John Kubiatowicz Electrical Engineering and Computer Sciences University of California, Berkeley

More information

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

ILP concepts (2.1) Basic compiler techniques (2.2) Reducing branch costs with prediction (2.3) Dynamic scheduling (2.4 and 2.5) Instruction-Level Parallelism and its Exploitation: PART 1 ILP concepts (2.1) Basic compiler techniques (2.2) Reducing branch costs with prediction (2.3) Dynamic scheduling (2.4 and 2.5) Project and Case

More information

Adapted from David Patterson s slides on graduate computer architecture

Adapted from David Patterson s slides on graduate computer architecture Mei Yang Adapted from David Patterson s slides on graduate computer architecture Introduction Basic Compiler Techniques for Exposing ILP Advanced Branch Prediction Dynamic Scheduling Hardware-Based Speculation

More information

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

Compiler Optimizations. Lecture 7 Overview of Superscalar Techniques. Memory Allocation by Compilers. Compiler Structure. Register allocation Lecture 7 Overview of Superscalar Techniques CprE 581 Computer Systems Architecture, Fall 2013 Reading: Textbook, Ch. 3 Complexity-Effective Superscalar Processors, PhD Thesis by Subbarao Palacharla, Ch.1

More information

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

吳俊興高雄大學資訊工程學系. October Example to eleminate WAR and WAW by register renaming. Tomasulo Algorithm. A Dynamic Algorithm: Tomasulo s Algorithm EEF011 Computer Architecture 計算機結構 吳俊興高雄大學資訊工程學系 October 2004 Example to eleminate WAR and WAW by register renaming Original DIV.D ADD.D S.D SUB.D MUL.D F0, F2, F4 F6, F0, F8 F6, 0(R1) F8, F10, F14 F6,

More information

Latencies of FP operations used in chapter 4.

Latencies of FP operations used in chapter 4. Instruction-Level Parallelism (ILP) ILP: refers to the overlap execution of instructions. Pipelined CPI = Ideal pipeline CPI + structural stalls + RAW stalls + WAR stalls + WAW stalls + Control stalls.

More information

Four Steps of Speculative Tomasulo cycle 0

Four Steps of Speculative Tomasulo cycle 0 HW support for More ILP Hardware Speculative Execution Speculation: allow an instruction to issue that is dependent on branch, without any consequences (including exceptions) if branch is predicted incorrectly

More information

CS425 Computer Systems Architecture

CS425 Computer Systems Architecture CS425 Computer Systems Architecture Fall 2018 Static Instruction Scheduling 1 Techniques to reduce stalls CPI = Ideal CPI + Structural stalls per instruction + RAW stalls per instruction + WAR stalls per

More information

Superscalar Architectures: Part 2

Superscalar Architectures: Part 2 Superscalar Architectures: Part 2 Dynamic (Out-of-Order) Scheduling Lecture 3.2 August 23 rd, 2017 Jae W. Lee (jaewlee@snu.ac.kr) Computer Science and Engineering Seoul NaMonal University Download this

More information

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

Hardware-based speculation (2.6) Multiple-issue plus static scheduling = VLIW (2.7) Multiple-issue, dynamic scheduling, and speculation (2. Instruction-Level Parallelism and its Exploitation: PART 2 Hardware-based speculation (2.6) Multiple-issue plus static scheduling = VLIW (2.7) Multiple-issue, dynamic scheduling, and speculation (2.8)

More information

Multi-cycle Instructions in the Pipeline (Floating Point)

Multi-cycle Instructions in the Pipeline (Floating Point) Lecture 6 Multi-cycle Instructions in the Pipeline (Floating Point) Introduction to instruction level parallelism Recap: Support of multi-cycle instructions in a pipeline (App A.5) Recap: Superpipelining

More information

Lecture 6 MIPS R4000 and Instruction Level Parallelism. Computer Architectures S

Lecture 6 MIPS R4000 and Instruction Level Parallelism. Computer Architectures S Lecture 6 MIPS R4000 and Instruction Level Parallelism Computer Architectures 521480S Case Study: MIPS R4000 (200 MHz, 64-bit instructions, MIPS-3 instruction set) 8 Stage Pipeline: first half of fetching

More information

Instruction Level Parallelism

Instruction Level Parallelism Instruction Level Parallelism Dynamic scheduling Scoreboard Technique Tomasulo Algorithm Speculation Reorder Buffer Superscalar Processors 1 Definition of ILP ILP=Potential overlap of execution among unrelated

More information

COSC 6385 Computer Architecture - Pipelining (II)

COSC 6385 Computer Architecture - Pipelining (II) COSC 6385 Computer Architecture - Pipelining (II) Edgar Gabriel Spring 2018 Performance evaluation of pipelines (I) General Speedup Formula: Time Speedup Time IC IC ClockCycle ClockClycle CPI CPI For a

More information

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

Advanced Computer Architecture CMSC 611 Homework 3. Due in class Oct 17 th, 2012 Advanced Computer Architecture CMSC 611 Homework 3 Due in class Oct 17 th, 2012 (Show your work to receive partial credit) 1) For the following code snippet list the data dependencies and rewrite the code

More information

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

Exploiting ILP with SW Approaches. Aleksandar Milenković, Electrical and Computer Engineering University of Alabama in Huntsville Lecture : Exploiting ILP with SW Approaches Aleksandar Milenković, milenka@ece.uah.edu Electrical and Computer Engineering University of Alabama in Huntsville Outline Basic Pipeline Scheduling and Loop

More information

Advanced Pipelining and Instruction- Level Parallelism 4

Advanced Pipelining and Instruction- Level Parallelism 4 4 Advanced Pipelining and Instruction- Level Parallelism 4 Who s first? America. Who s second? Sir, there is no second. Dialog between two observers of the sailing race later named The America s Cup and

More information

Hardware-based Speculation

Hardware-based Speculation Hardware-based Speculation Hardware-based Speculation To exploit instruction-level parallelism, maintaining control dependences becomes an increasing burden. For a processor executing multiple instructions

More information

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática Architectures for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 09

More information

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

Chapter 3: Instruction Level Parallelism (ILP) and its exploitation. Types of dependences Chapter 3: Instruction Level Parallelism (ILP) and its exploitation Pipeline CPI = Ideal pipeline CPI + stalls due to hazards invisible to programmer (unlike process level parallelism) ILP: overlap execution

More information

Chapter 4. Advanced Pipelining and Instruction-Level Parallelism. In-Cheol Park Dept. of EE, KAIST

Chapter 4. Advanced Pipelining and Instruction-Level Parallelism. In-Cheol Park Dept. of EE, KAIST Chapter 4. Advanced Pipelining and Instruction-Level Parallelism In-Cheol Park Dept. of EE, KAIST Instruction-level parallelism Loop unrolling Dependence Data/ name / control dependence Loop level parallelism

More information

Hardware-based Speculation

Hardware-based Speculation Hardware-based Speculation M. Sonza Reorda Politecnico di Torino Dipartimento di Automatica e Informatica 1 Introduction Hardware-based speculation is a technique for reducing the effects of control dependences

More information

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1 CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1 Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer

More information

Pipelining and Exploiting Instruction-Level Parallelism (ILP)

Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining and Instruction-Level Parallelism (ILP). Definition of basic instruction block Increasing Instruction-Level Parallelism (ILP) &

More information

EE 4683/5683: COMPUTER ARCHITECTURE

EE 4683/5683: COMPUTER ARCHITECTURE EE 4683/5683: COMPUTER ARCHITECTURE Lecture 4A: Instruction Level Parallelism - Static Scheduling Avinash Kodi, kodi@ohio.edu Agenda 2 Dependences RAW, WAR, WAW Static Scheduling Loop-carried Dependence

More information

EITF20: Computer Architecture Part3.2.1: Pipeline - 3

EITF20: Computer Architecture Part3.2.1: Pipeline - 3 EITF20: Computer Architecture Part3.2.1: Pipeline - 3 Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Dynamic scheduling - Tomasulo Superscalar, VLIW Speculation ILP limitations What we have done

More information

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

CSE 820 Graduate Computer Architecture. week 6 Instruction Level Parallelism. Review from Last Time #1 CSE 820 Graduate Computer Architecture week 6 Instruction Level Parallelism Based on slides by David Patterson Review from Last Time #1 Leverage Implicit Parallelism for Performance: Instruction Level

More information

Handout 2 ILP: Part B

Handout 2 ILP: Part B Handout 2 ILP: Part B Review from Last Time #1 Leverage Implicit Parallelism for Performance: Instruction Level Parallelism Loop unrolling by compiler to increase ILP Branch prediction to increase ILP

More information

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

Chapter 4 The Processor 1. Chapter 4D. The Processor Chapter 4 The Processor 1 Chapter 4D The Processor Chapter 4 The Processor 2 Instruction-Level Parallelism (ILP) Pipelining: executing multiple instructions in parallel To increase ILP Deeper pipeline

More information

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

Page # CISC 662 Graduate Computer Architecture. Lecture 8 - ILP 1. Pipeline CPI. Pipeline CPI (I) Michela Taufer CISC 662 Graduate Computer Architecture Lecture 8 - ILP 1 Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD

DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD Slides by: Pedro Tomás Additional reading: Computer Architecture: A Quantitative Approach, 5th edition, Chapter 3, John L. Hennessy and David A. Patterson,

More information

Instruction-Level Parallelism. Instruction Level Parallelism (ILP)

Instruction-Level Parallelism. Instruction Level Parallelism (ILP) Instruction-Level Parallelism CS448 1 Pipelining Instruction Level Parallelism (ILP) Limited form of ILP Overlapping instructions, these instructions can be evaluated in parallel (to some degree) Pipeline

More information

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

Page 1. CISC 662 Graduate Computer Architecture. Lecture 8 - ILP 1. Pipeline CPI. Pipeline CPI (I) Pipeline CPI (II) Michela Taufer CISC 662 Graduate Computer Architecture Lecture 8 - ILP 1 Michela Taufer Pipeline CPI http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson

More information

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

Detailed Scoreboard Pipeline Control. Three Parts of the Scoreboard. Scoreboard Example Cycle 1. Scoreboard Example. Scoreboard Example Cycle 3 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

More information

Advantages of Dynamic Scheduling

Advantages of Dynamic Scheduling UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Computer Architecture ECE 568 Part 5 Dynamic scheduling with Scoreboards Israel Koren ECE568/Koren Part.5.1 Advantages of Dynamic

More information

Course on Advanced Computer Architectures

Course on Advanced Computer Architectures Surname (Cognome) Name (Nome) POLIMI ID Number Signature (Firma) SOLUTION Politecnico di Milano, July 9, 2018 Course on Advanced Computer Architectures Prof. D. Sciuto, Prof. C. Silvano EX1 EX2 EX3 Q1

More information

Instruction Level Parallelism. Taken from

Instruction Level Parallelism. Taken from Instruction Level Parallelism Taken from http://www.cs.utsa.edu/~dj/cs3853/lecture5.ppt Outline ILP Compiler techniques to increase ILP Loop Unrolling Static Branch Prediction Dynamic Branch Prediction

More information

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

Lecture-13 (ROB and Multi-threading) CS422-Spring Lecture-13 (ROB and Multi-threading) CS422-Spring 2018 Biswa@CSE-IITK Cycle 62 (Scoreboard) vs 57 in Tomasulo Instruction status: Read Exec Write Exec Write Instruction j k Issue Oper Comp Result Issue

More information

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

Multicycle ALU Operations 2/28/2011. Diversified Pipelines The Path Toward Superscalar Processors. Limitations of Our Simple 5 stage Pipeline //11 Limitations of Our Simple stage Pipeline Diversified Pipelines The Path Toward Superscalar Processors HPCA, Spring 11 Assumes single cycle EX stage for all instructions This is not feasible for Complex

More information

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

Computer Architectures. Chapter 4. Tien-Fu Chen. National Chung Cheng Univ. Computer Architectures Chapter 4 Tien-Fu Chen National Chung Cheng Univ. chap4-0 Advance Pipelining! Static Scheduling Have compiler to minimize the effect of structural, data, and control dependence "

More information

5008: Computer Architecture

5008: Computer Architecture 5008: Computer Architecture Chapter 2 Instruction-Level Parallelism and Its Exploitation CA Lecture05 - ILP (cwliu@twins.ee.nctu.edu.tw) 05-1 Review from Last Lecture Instruction Level Parallelism Leverage

More information

Advanced issues in pipelining

Advanced issues in pipelining Advanced issues in pipelining 1 Outline Handling exceptions Supporting multi-cycle operations Pipeline evolution Examples of real pipelines 2 Handling exceptions 3 Exceptions In pipelined execution, one

More information

CMSC 611: Advanced Computer Architecture

CMSC 611: Advanced Computer Architecture CMSC 611: Advanced Computer Architecture Instruction Level Parallelism Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson /

More information

COSC 6385 Computer Architecture - Instruction Level Parallelism (II)

COSC 6385 Computer Architecture - Instruction Level Parallelism (II) COSC 6385 Computer Architecture - Instruction Level Parallelism (II) Edgar Gabriel Spring 2016 Data fields for reservation stations Op: operation to perform on source operands S1 and S2 Q j, Q k : reservation

More information

CPI < 1? How? What if dynamic branch prediction is wrong? Multiple issue processors: Speculative Tomasulo Processor

CPI < 1? How? What if dynamic branch prediction is wrong? Multiple issue processors: Speculative Tomasulo Processor 1 CPI < 1? How? From Single-Issue to: AKS Scalar Processors Multiple issue processors: VLIW (Very Long Instruction Word) Superscalar processors No ISA Support Needed ISA Support Needed 2 What if dynamic

More information

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

CISC 662 Graduate Computer Architecture Lecture 11 - Hardware Speculation Branch Predictions CISC 662 Graduate Computer Architecture Lecture 11 - Hardware Speculation Branch Predictions Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis6627 Powerpoint Lecture Notes from John Hennessy

More information

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

Lecture 9: Case Study MIPS R4000 and Introduction to Advanced Pipelining Professor Randy H. Katz Computer Science 252 Spring 1996 Lecture 9: Case Study MIPS R4000 and Introduction to Advanced Pipelining Professor Randy H. Katz Computer Science 252 Spring 1996 RHK.SP96 1 Review: Evaluating Branch Alternatives Two part solution: Determine

More information

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

Pipelining: Issue instructions in every cycle (CPI 1) Compiler scheduling (static scheduling) reduces impact of dependences Dynamic Scheduling Pipelining: Issue instructions in every cycle (CPI 1) Compiler scheduling (static scheduling) reduces impact of dependences Increased compiler complexity, especially when attempting

More information

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

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 3. Instruction-Level Parallelism and Its Exploitation Computer Architecture A Quantitative Approach, Fifth Edition Chapter 3 Instruction-Level Parallelism and Its Exploitation Introduction Pipelining become universal technique in 1985 Overlaps execution of

More information

EECC551 Review. Dynamic Hardware-Based Speculation

EECC551 Review. Dynamic Hardware-Based Speculation EECC551 Review Recent Trends in Computer Design. Computer Performance Measures. Instruction Pipelining. Branch Prediction. Instruction-Level Parallelism (ILP). Loop-Level Parallelism (LLP). Dynamic Pipeline

More information

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e Instruction Level Parallelism Appendix C and Chapter 3, HP5e Outline Pipelining, Hazards Branch prediction Static and Dynamic Scheduling Speculation Compiler techniques, VLIW Limits of ILP. Implementation

More information

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

Instruction Frequency CPI. Load-store 55% 5. Arithmetic 30% 4. Branch 15% 4 PROBLEM 1: An application running on a 1GHz pipelined processor has the following instruction mix: Instruction Frequency CPI Load-store 55% 5 Arithmetic 30% 4 Branch 15% 4 a) Determine the overall CPI

More information

Preventing Stalls: 1

Preventing Stalls: 1 Preventing Stalls: 1 2 PipeLine Pipeline efficiency Pipeline CPI = Ideal pipeline CPI + Structural Stalls + Data Hazard Stalls + Control Stalls Ideal pipeline CPI: best possible (1 as n ) Structural hazards:

More information

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

NOW Handout Page 1. Review from Last Time #1. CSE 820 Graduate Computer Architecture. Lec 8 Instruction Level Parallelism. Outline CSE 820 Graduate Computer Architecture Lec 8 Instruction Level Parallelism Based on slides by David Patterson Review Last Time #1 Leverage Implicit Parallelism for Performance: Instruction Level Parallelism

More information

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

University of Southern California Department of Electrical Engineering EE557 Fall 2001 Instructor: Michel Dubois Homework #3. University of Southern California Department of Electrical Engineering EE557 Fall 2001 Instructor: Michel Dubois Homework #3. SOLUTIONS Problem 1 (20pts). There are seven dependences in the C loop presented

More information

Copyright 2012, Elsevier Inc. All rights reserved.

Copyright 2012, Elsevier Inc. All rights reserved. Computer Architecture A Quantitative Approach, Fifth Edition Chapter 3 Instruction-Level Parallelism and Its Exploitation 1 Branch Prediction Basic 2-bit predictor: For each branch: Predict taken or not

More information

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

Outline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar, VLIW. CPE 631 Session 19 Exploiting ILP with SW Approaches Session xploiting ILP with SW Approaches lectrical and Computer ngineering University of Alabama in Huntsville Outline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar,

More information

CS425 Computer Systems Architecture

CS425 Computer Systems Architecture CS425 Computer Systems Architecture Fall 2017 Multiple Issue: Superscalar and VLIW CS425 - Vassilis Papaefstathiou 1 Example: Dynamic Scheduling in PowerPC 604 and Pentium Pro In-order Issue, Out-of-order

More information

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

Functional Units. Registers. The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Input Control Memory The Big Picture: Where are We Now? CS152 Computer Architecture and Engineering Lecture 18 The Five Classic Components of a Computer Processor Input Control Dynamic Scheduling (Cont), Speculation, and ILP

More information

ILP: Instruction Level Parallelism

ILP: Instruction Level Parallelism ILP: Instruction Level Parallelism Tassadaq Hussain Riphah International University Barcelona Supercomputing Center Universitat Politècnica de Catalunya Introduction Introduction Pipelining become universal

More information

Hardware Speculation Support

Hardware Speculation Support Hardware Speculation Support Conditional instructions Most common form is conditional move BNEZ R1, L ;if MOV R2, R3 ;then CMOVZ R2,R3, R1 L: ;else Other variants conditional loads and stores nullification

More information

Dynamic Control Hazard Avoidance

Dynamic Control Hazard Avoidance Dynamic Control Hazard Avoidance Consider Effects of Increasing the ILP Control dependencies rapidly become the limiting factor they tend to not get optimized by the compiler more instructions/sec ==>

More information

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

CS 252 Graduate Computer Architecture. Lecture 4: Instruction-Level Parallelism CS 252 Graduate Computer Architecture Lecture 4: Instruction-Level Parallelism Krste Asanovic Electrical Engineering and Computer Sciences University of California, Berkeley http://wwweecsberkeleyedu/~krste

More information

CPI IPC. 1 - One At Best 1 - One At best. Multiple issue processors: VLIW (Very Long Instruction Word) Speculative Tomasulo Processor

CPI IPC. 1 - One At Best 1 - One At best. Multiple issue processors: VLIW (Very Long Instruction Word) Speculative Tomasulo Processor Single-Issue Processor (AKA Scalar Processor) CPI IPC 1 - One At Best 1 - One At best 1 From Single-Issue to: AKS Scalar Processors CPI < 1? How? Multiple issue processors: VLIW (Very Long Instruction

More information

ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST *

ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST * ELE 818 * ADVANCED COMPUTER ARCHITECTURES * MIDTERM TEST * SAMPLE 1 Section: Simple pipeline for integer operations For all following questions we assume that: a) Pipeline contains 5 stages: IF, ID, EX,

More information

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

Chapter 3 (CONT II) Instructor: Josep Torrellas CS433. Copyright J. Torrellas 1999,2001,2002,2007, Chapter 3 (CONT II) Instructor: Josep Torrellas CS433 Copyright J. Torrellas 1999,2001,2002,2007, 2013 1 Hardware-Based Speculation (Section 3.6) In multiple issue processors, stalls due to branches would

More information

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation TDT4255 Lecture 9: ILP and speculation Donn Morrison Department of Computer Science 2 Outline Textbook: Computer Architecture: A Quantitative Approach, 4th ed Section 2.6: Speculation Section 2.7: Multiple

More information

Advanced Computer Architecture. Chapter 4: More sophisticated CPU architectures

Advanced Computer Architecture. Chapter 4: More sophisticated CPU architectures Advanced Computer Architecture Chapter 4: More sophisticated CPU architectures Lecturer: Paul H J Kelly Autumn 2001 Department of Computing Imperial College Room 423 email: phjk@doc.ic.ac.uk Course web

More information

Tomasulo s Algorithm

Tomasulo s Algorithm Tomasulo s Algorithm Architecture to increase ILP Removes WAR and WAW dependencies during issue WAR and WAW Name Dependencies Artifact of using the same storage location (variable name) Can be avoided

More information

Good luck and have fun!

Good luck and have fun! Midterm Exam October 13, 2014 Name: Problem 1 2 3 4 total Points Exam rules: Time: 90 minutes. Individual test: No team work! Open book, open notes. No electronic devices, except an unprogrammed calculator.

More information