50 likes | 238 Views
Dynamic Scheduling How have we dealt with data hazards so far? Forward logic to reduce effective pipeline latency Hazard detection hardware stalls Compiler scheduling of instructions, known as static scheduling But the instructions are issued in order. Dynamic Scheduling (Cont’d)
E N D
Dynamic Scheduling • How have we dealt with data hazards so far? • Forward logic to reduce effective pipeline latency • Hazard detection hardware stalls • Compiler scheduling of instructions, known as static scheduling • But the instructions are issued in order
Dynamic Scheduling (Cont’d) • DIVD F0, F2, F4 • ADDD F10, F0, F8 • SUBD F12, F8, F14 • Due to the stalls between DIVD and ADDD, SUBD cannot execute, although it has no dependence on the above two instructions. This is a performance limitation • Dynamic scheduling overcomes this limitation • The hardware dynamically changes the order of instruction execution to reduce the stalls. • The pipeline could do out-of-order execution and out-of-order completion
Dynamic Scheduling with a Scoreboard • (Figure 4.3) • Scoreboarding is a technique that allows instructions to execute out of order • WAR hazards may arise when instructions are issued out of order • DIVD F0, F2, F4 • ADDD F10, F0, F8 • SUBD F8, F8, F14
Dynamic Scheduling with a Scoreboard (Cont’d) • There is an antidependence between ADDD and SUBD • A WAR hazard exists if SUBD executes before ADDD • Similarly, if the destination of SUBD were F10, a WAW hazard would occur • Both these types of hazards are to be detected and avoided in a scoreboard
Scoreboard Example LD F6, 34 (R2) LD F2, 45 (R3) MULTD F0, F2, F4 SUBD F8, F6, F2 DIVD F10, F0, F6 ADDD F6, F8, F2 (Figure 4.4, 4.5, 4.6 and 4.7)