S4 · Problem set 2
Problem set 2: pipeline depth, branch prediction, dynamic scheduling and speculation
These problems cover lessons 6 to 10: optimal pipeline depth and latch overhead, misprediction costs and predictor tables, fetch rates and micro-op caches, Little's law for windows and reservation stations, renaming, and how much of a speculative window is useful.
Check
A core with 90 FO4 of logic per instruction, 3 FO4 of overhead per stage and 0.09 stall cycles per instruction per stage.
(a)
Optimal depth?
(b)
Time per instruction there, in FO4?
(c)
FO4 per cycle there?
Check
The same model at a fixed depth of 28 stages: 120 FO4 of logic, 3.5 FO4 overhead, 0.07 stalls per instruction per stage.
(a)
Overhead share of each cycle?
(b)
Time per instruction, in FO4?
Check
A core with base CPI 0.9: 0.16 of instructions are branches, 0.03 mispredicted, resolved at stage 20.
(a)
Misprediction CPI?
(b)
Speedup if a better predictor halves the misprediction rate?
Check
A loop of 12 iterations runs over and over.
(a)
1-bit predictor misprediction rate?
(b)
2-bit counter?
Check
A predictor table of two-bit counters, with 400 active branches.
(a)
Table size, in bits?
(b)
Chance a given branch shares its entry?
Check
Branches are 0.15 of instructions, 0.55 of them taken; the BTB holds 0.95 of taken targets (miss cost 4 cycles), and direction accuracy is 0.94 (penalty 15).
(a)
CPI from BTB misses?
(b)
CPI from direction mispredictions?
Check
A 4-wide out-of-order core averaging 25 cycles per instruction in flight, with a 256-entry window.
(a)
Window for full width?
(b)
Sustainable IPC with 256 entries?
Check
A core renames 32 architectural registers for 160 in-flight instructions (0.8 write a register); it has 3 result buses, and 0.75 of instructions produce results.
(a)
Physical registers?
(b)
IPC limit from the result buses?
Check
A floating-point multiplier gets 0.6 instructions per cycle, each waiting 6 cycles for operands and executing for 4; elsewhere, a chain of 7 dependent multiplies runs alone.
(a)
Reservation stations needed on average?
(b)
Cycles for the chain, with 1 cycle of CDB broadcast per link?
Check
A 300-entry window, a branch every 1/0.17 instructions, accuracy 0.94.
(a)
Chance the youngest instruction is on the correct path?
(b)
Expected useful instructions?
Check
A core fetches 6 per cycle with 0.75 useful and commits at most 3; 0.3 of instructions are loads, 0.01 of them replayed at 15 cycles each.
(a)
Best IPC?
(b)
CPI added by replays?
Check
A deep pipeline resolves branches at stage 18; a shallow one resolves them at stage 6 but its clock period is 1.5× longer. Branches are 0.2 of instructions, 0.08 mispredicted; ignore other stalls.
(a)
CPI of the deep design?
(b)
Shallow design's time per instruction relative to the deep one's?
Check
A 4-wide fetch meets a taken branch every 6 instructions and loses 2 cycle(s) on each redirection.
(a)
What fetch rate does it reach?
Check
A µop cache delivers 6 µops a cycle on hits (0.75 of µops) and the decoders 4.
(a)
What average rate results?
Check
Branches are 0.15 of instructions, predicted 0.95 right with a 20-cycle penalty; the instruction cache misses 8 times per thousand instructions at 20 cycles.
(a)
What CPI does the front end lose?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.