5.3.1 · D4Advanced Microarchitecture

Exercises — Superscalar execution

2,960 words13 min readBack to topic

Before we start, here is the one formula that most problems lean on. We repeat it so no symbol is used before it is named.


Level 1 — Recognition

Recall Solution L1.1
  • (a) RAW (Read After Write): the MUL reads R1 that ADD just wrote. This is a true data dependency — the value genuinely must flow. Renaming cannot remove it.
  • (b) WAW (Write After Write): both instructions write R1. A false (name-only) dependency. Renaming eliminates it by sending each write to a different physical register.
  • (c) WAR (Write After Read): the first reads R1, the second writes R1. A false (anti-)dependency. Renaming eliminates it so the writer doesn't clobber a value the reader still needs.
  • Renaming removes (b) and (c); (a) stays.
Recall Solution L1.2
  • "4-wide" = the front-end issue width : at most 4 instructions are fetched/decoded/renamed per cycle.
  • "6 execution ports" = 6 places instructions can be sent to execute per cycle, i.e. the total execution back-end can accept up to 6/cycle (spread across the functional units).
  • The 4 is . Note the back-end (6) is wider than the front-end (4) here — a common design so the narrow front-end is never starved by the back-end.

Level 2 — Application

Recall Solution L2.1

Compute every ceiling, then take the min.

  • .
  • Integer:
  • FP:
  • Memory:
  • Branch: → tightest FU ceiling .
  • Dependency: . The front-end width is the bottleneck; the machine has plenty of units and lookahead.
Recall Solution L2.2

First, the FP edge case. This program has : no instruction ever uses an FP unit. From the formula's edge-case rule, — an infinitely high ceiling that can never be the smallest — so we drop the FP term entirely and it plays no role below.

  • .
  • Integer:
  • FP: term dropped (never the bottleneck).
  • Memory: ← tightest
  • Branch:
  • Dependency: . Bottleneck: memory ports. Only 2 load/store units, but 60% of work needs them.
Figure — Superscalar execution

Look at the figure: each colored bar is one ceiling. The shortest bar wins — that is what means visually. In L2.1 the width bar is shortest; in L2.2 the memory bar drops below the width bar and becomes the limiter. Note L2.2 has no FP bar at all — a dropped term simply does not appear.


Level 3 — Analysis

Recall Solution L3.1
  • .
  • FU ceilings unchanged (same 40/20/30/10 mix): (memory).
  • Dependency: . Now the dependency term dominates. Physically: the ROB (lookahead window) is so small the machine can't see far enough ahead to find independent work while long chains stall. The functional units sit idle waiting — plenty of execution muscle, no independent instructions to feed it.
Recall Solution L3.2

Current bottleneck (from L2.2) is memory: . FP term is dropped (). We now show all three terms of the for each fix.

  • Fix A (): only changes. FU ceilings are . Dependency becomes . So Memory is still the smallest — widening the front-end and enlarging the window both raise their terms, but neither touches the memory ceiling. IPC stays 3.33; the silicon is wasted.
  • Fix B (3rd L/S unit): memory ceiling becomes . FU ceilings . Width , dependency . So

Fix B works, raising IPC from 3.33 to 4 (now width-limited: the is the smallest of the three). Attack the actual bottleneck, not the biggest-sounding knob.


Level 4 — Synthesis

Recall Solution L4.1

Target: every ceiling , with so width is the (cheapest) binding term. FP is absent (, term dropped).

  • Width: need . Choose (smallest that admits IPC 4).
  • Memory (): need . Choose 2.
  • Integer (): need . Choose 2 (must be integer count, gives ).
  • Branch (): need . Choose 1. Check all terms: . ✔ Minimal design: , 2 mem, 2 int, 1 branch. Note integer needed 2 (not 1) purely because you can't buy a fractional unit.
Recall Solution L4.2
  • Physical registers available for renaming in-flight writers .
  • Each in-flight writer needs one. Fraction of in-flight instructions that write .
  • So the ROB can hold entries where .
  • Largest usable ROB entries. Interpretation: if the ROB were built bigger than 228, the physical register file would run dry first — the two structures must be sized together (see Register Renaming and Reorder Buffer).

Level 5 — Mastery

Recall Solution L5.1

Design X: ceilings — ; mem ; int ; branch ; dep . (memory-limited). Design Y: ceilings — ; mem ; int ; branch ; dep . (width-limited). Same IPC = 4 on this workload!

  • Ship for power: Design Y. It reaches IPC 4 with a narrower front-end (). Front-end width is one of the most power-hungry parts of a core (wide fetch, wide decode, wide rename, more wakeup logic). Y burns less to hit the same throughput here — the sensible pick under a power budget.
  • When X wins — the alternate workload. Take a compute-heavy mix of 15% memory / 65% integer / 20% branch (still 0% FP). Recompute both designs on it:
    • Design X (, 2 mem, 3 int, 1 branch): mem ; int ; branch ; dep . So (integer-limited).
    • Design Y (, 3 mem, 2 int, 1 branch): mem ; int ; branch ; dep . So (integer-limited).
    • Now X wins, vs . With little memory traffic and lots of integer work, X's extra ALU (3 vs 2) and its wider front-end ( vs ) both pay off, while Y's 2 ALUs choke on the 65% integer stream. The moral: no design is "best" — the winner depends on the program's mix.

The figure below turns the first (50/30/20) comparison into bars. Read it as follows: for each design, the shortest bar is the ceiling that binds. Design X's memory bar (4) is its shortest — X is memory-limited. Design Y's width bar (4) is its shortest — Y is width-limited. The dashed line at IPC 4 shows both land on the same height by different routes, which is the whole point of the exercise.

Figure — Superscalar execution
Recall Solution L5.2

Work in "instructions per branch" as the natural chunk.

  • Fraction of instructions that are branches , so on average there is 1 branch every instructions.
  • Misprediction rate . So a mispredict happens every instructions on average.
  • Cycles for those 62.5 instructions: useful cycles (running at IPC 4), plus one penalty cycles.
  • Effective IPC . Lesson: an 8% miss rate nearly halves real throughput on a deep-pipeline wide machine — which is exactly why branch prediction accuracy is worth so much silicon. Compare this dynamic-scheduling cost with the compiler-scheduled VLIW Architecture approach, and note that Tomasulo's Algorithm provides the out-of-order engine that keeps IPC near between mispredicts.