Dynamic Scheduling Using Tomasulos Approach
A big picture
Focus on FP and load/store, can be easily extended (for example, integer, branch, etc) 4 Steps: Fetch, Issue, Execute, Write Result
Each steps can take more than one cycles
Reservation stations
Associated with functional units Hold issued instructions awaiting executions at that unit Provide the values for the insts or the name of other reservations stations that will provide the values
The Basic Structure
How the instruction goes through?
Fetch
Fetch instructions until the instruction queue is full
Issue
In-order issue: get the next instruction from instruction queue (FIFO) Issuing the next instruction if a matching reservation station is available Keeping track of the availability of operands Renaming registers
How the instruction goes through (Contd)
Execute
Monitoring the common data bus (CDB) for the operands Placing the available value in the reservation station Executing inst when the operands are available
How the instruction goes through (Contd)
Write result
Write the result on the CDB and into the registers or reservation stations Store the data into memory
Reservation Station Fields
Op: operation Qj, Qk: name of reservation stations that will produce the source operands Vj, Vk: Values of the source operands A: Memory address for load/store Busy: reservation station and related func unit is occupied or not
Register Field
Qi: which reservation station has the operations whose result should be stored into this register
Example
L.D L.D Mul.D Sub.D Div.D Add.D F6, 34(R2) F2, 45(R3) F0, F2, F4 F8, F2, F6 F10, F0, F6 F6, F8, F2 41
Assume Execution Cycles: load 2 cycle, add 3 cycles, mul 11 cycles, div cycles
Assume Execution Cycles: load 2 cycle, add 3 cycles, mul 11 cycles, div 41 cycles
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Add1 No Add2 No Add3 No Mult1 No Mult2 No
Op
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
0 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 Load1 Load2 Load3
Busy Address
Yes No No 34+R2
Reservation Stations:
Time Name Busy Add1 No Add2 No Add3 No Mult1 No Mult2 No
Op
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
1 FU
F0
F2
F4
F6
Load1
F8
F10
F12
...
F30
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 Load1 Load2 Load3
Busy Address
Yes Yes No 34+R2 45+R3
Reservation Stations:
Time Name Busy Add1 No Add2 No Add3 No Mult1 No Mult2 No
Op
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
2 FU
F0
F2
Load2
F4
F6
Load1
F8
F10
F12
...
F30
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 3 Load1 Load2 Load3
Busy Address
Yes Yes No 34+R2 45+R3
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No Mult1 Yes MULTD Mult2 No
S1 Vj
S2 Vk
RS Qj
RS Qk
R(F4) Load2
Register result status: Clock
3 FU
F0
F2
F4
F6
Load1
F8
F10
F12
...
F30
Mult1 Load2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 3 4 4 Load1 Load2 Load3
Busy Address
No Yes No 45+R3
Reservation Stations:
Time Name Busy Op Add1 Yes SUBD M(A1) Load2 Add2 No Add3 No Mult1 Yes MULTD R(F4) Load2 Mult2 No
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
4 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 Load2
M(A1) Add1
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 3 4 4 5 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op 2 Add1 Yes SUBD M(A1) M(A2) Add2 No Add3 No 10 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
5 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
M(A1) Add1 Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 4 5 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op 1 Add1 Yes SUBD M(A1) M(A2) Add2 Yes ADDD M(A2) Add1 Add3 No 9 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
6 FU
F0
F2
F4
F6
Add2
F8
F10
F12
...
F30
Mult1 M(A2)
Add1 Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 4 5 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op 0 Add1 Yes SUBD M(A1) M(A2) Add2 Yes ADDD M(A2) Add1 Add3 No 8 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
7 FU
F0
F2
F4
F6
Add2
F8
F10
F12
...
F30
Mult1 M(A2)
Add1 Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 4 5 8 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No 2 Add2 Yes ADDD (M-M) M(A2) Add3 No 7 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
8 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
Add2 (M-M) Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 4 5 8 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No 1 Add2 Yes ADDD (M-M) M(A2) Add3 No 6 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
9 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
Add2 (M-M) Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 10 4 5 8 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No 0 Add2 Yes ADDD (M-M) M(A2) Add3 No 5 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
10 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
Add2 (M-M) Mult2
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 10 4 5 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No 4 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
11 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 10 4 5 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No 3 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
12 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 10 4 5 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No 2 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
13 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 7 10 4 5 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No 1 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
14 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 15 7 10 4 5 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No 0 Mult1 Yes MULTD M(A2) R(F4) Mult2 Yes DIVD M(A1) Mult1
S1 Vj
S2 Vk
RS Qj
RS Qk
Register result status: Clock
15 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
Mult1 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 15 7 10 4 5 16 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No Mult1 No 40 Mult2 Yes DIVD
S1 Vj
S2 Vk
RS Qj
RS Qk
M*F4 M(A1)
Register result status: Clock
16 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
M*F4 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Skips some cycles
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 15 7 10 4 5 16 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No Mult1 No 1 Mult2 Yes DIVD
S1 Vj
S2 Vk
RS Qj
RS Qk
M*F4 M(A1)
Register result status: Clock
55 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
M*F4 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 15 7 56 10 4 5 16 8 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No Mult1 No 0 Mult2 Yes DIVD
S1 Vj
S2 Vk
RS Qj
RS Qk
M*F4 M(A1)
Register result status: Clock
56 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
M*F4 M(A2)
(M-M+M)M-M) Mult2 (
Load=2
Add=3
Mult=11
Div=41
Instruction status:
Instruction LD F6 LD F2 MULTD F0 SUBD F8 DIVD F10 ADDD F6 j 34+ 45+ F2 F6 F0 F8 k R2 R3 F4 F2 F6 F2
Exec Write Issue Comp Result
1 2 3 4 5 6 3 4 15 7 56 10 4 5 16 8 57 11 Load1 Load2 Load3
Busy Address
No No No
Reservation Stations:
Time Name Busy Op Add1 No Add2 No Add3 No Mult1 No No Mult2 Yes DIVD
S1 Vj
S2 Vk
RS Qj
RS Qk
M*F4 M(A1)
Register result status: Clock
56 57 FU
F0
F2
F4
F6
F8
F10
F12
...
F30
M*F4 M(A2)
(M-M+M)M-M) Result (
Load=2
Add=3
Mult=11
Div=41