Course: Computer Architectures
Source: E. Sanchez, Hardware-based Speculation, Politecnico di Torino, ASE 2026/27, 24 PDF pages. Local source: 11 - hw speculation.pdf. Number 11 follows the filename; no lecture date is inferred. The original PDF and slide figures remain local because redistribution permission is uncertain.
Learning route
The preceding lecture explained how ready instructions execute out of order. This lecture completes the recovery story: execute and forward results early, but commit architectural changes in order. Branch prediction exposes a possible future, dynamic scheduling finds ready work, and a reorder buffer retains provisional effects until they are safe. Hardware Speculation and the Reorder Buffer
Read these in sequence:
- Separate execution, result broadcast and commitment; IF has already fetched the instruction and is not the commit condition.
- Allocate a reservation station and ROB entry at issue. Follow an output tagged with its ROB number through the CDB to consumers and the buffer.
- Keep completed results usable while they wait behind an older instruction at the ROB head.
- Trace wrong predictions, stores and recorded exceptions before reading the larger snapshot below.
- Distinguish architectural recovery from resource costs or cache effects that speculative work can leave behind.
Prerequisites: Tomasulo Dynamic Scheduling, Branch Prediction Fundamentals, Precise Exceptions.
What the added buffer changes
The lecture’s ROB entries retain instruction type, destination, value and readiness, with additional information needed for faults and pending store data. The ROB is circular but preserves instruction age. Every issued instruction in this architecture gets an entry, including ordinary arithmetic and branches. It is a feature of this design, not something every processor universally uses.
A reservation station holds an operation and its operand state; an execution unit calculates; the CDB broadcasts (ROB tag, value); the ROB retains the result for commit. A station may be reused after result publication while its instruction’s ROB entry is still occupied. Consumers can read ready results from the ROB before commitment. Full issue-to-commit path.
Worked source snapshot: pages 17–21
FP addition/subtraction takes 2 cycles, multiplication 10 and division 40. The code reuses the six-instruction example from Lecture 10 - Dynamic Scheduling:
1. load f6 from 32(x2)
2. load f2 from 44(x3)
3. f0 = f2 * f4
4. f8 = f2 - f6
5. f10 = f0 / f6
6. f6 = f8 + f2At the shown instant the two loads have committed and the multiply is ready to commit:
| Entry | Destination | State | Consequence |
|---|---|---|---|
| 1 | f6 | Committed; slot free | Its earlier value is architectural. |
| 2 | f2 | Committed; slot free | Loaded value is architectural. |
| 3, head | f0 | Result ready | Next eligible normal commit. |
| 4 | f8 | Result ready | Must wait behind entry 3. |
| 5 | f10 | Division executing | Will block entry 6’s commitment. |
| 6 | f6 | Result ready | Usable provisionally, not yet architectural. |
The subtract and final add can finish before the long division because they do not depend on its output. After 3 and 4 commit, entry 5 remains the head until it finishes safely; entry 6 cannot pass it. Register f6 still has the value from load 1, while ROB6 retains the newer provisional version. The division uses the older version captured for its input.
Register-status mappings are f0→ROB3, f6→ROB6, f8→ROB4 and f10→ROB5. Ready ROB4/ROB6 results need not remain in reservation stations; their operations have already published. The station table on page 20 still shows the divider’s Qj as #3 while page 18 says it is executing. Treat that input tag as a stale/inconsistent snapshot field: once ROB3’s value is captured for execution, the operand must be ready. Do not infer that the divide executes with a genuinely missing input.
Recovery, stores and exception precision
In the slide model, a mispredicted branch at the ROB head flushes wrong-path work and redirects fetch. The earlier committed prefix remains valid. A normal head instruction commits only when ready and safe. A branch has no ordinary arithmetic register result to write; a faulting instruction invokes handling rather than committing a bad result.
Stores calculate addresses provisionally but update memory only at commit, with their data available. A younger load of the same location waits under the conservative page 16 scheme. A correct branch prediction alone does not release that dependency. Store-to-load forwarding is a possible extension, not the model used for this example. Follow the store/load distinction.
Faults are recorded in ROB entries. A wrong-path fault is discarded with its instruction; a surviving fault is handled at the head, after earlier work commits and before younger work does. This supplies the precise boundary discussed in Precise Exceptions.
PDF page map
| Pages | Topic |
|---|---|
| 2–4 | Prediction, scheduling and speculative execution; historical processor examples |
| 5–9 | Computation versus architectural update; ROB and architecture |
| 10–14 | Issue, execute, write result, commit; circular ROB |
| 15–16 | Renaming, ordered memory writes and memory RAW checks |
| 17–21 | Six-instruction snapshot with ROB and register status |
| 22 | Store address/data tracking and commit |
| 23 | Deferred exception handling and wrong-path fault suppression |
| 24 | Deferring selected expensive speculative events |
Page 4’s processor list is historical source context, not a current product survey. Page 14’s recovery-at-head scheme is the lecture model; real designs may redirect sooner. Page 24 describes selected policies, not a universal rule for all cache/TLB misses.
Review route
Trace an addition producing 7: who calculates, who broadcasts, who waits on its tag, where is 7 retained, and what condition permits commitment? Then trace a wrong-path store and a wrong-path fault. Finish with the source snapshot: why can entry 6 finish before entry 5 but not commit before it? Answered practice is in Hardware Speculation and the Reorder Buffer > 8. Recall and worked answers.