Skip to guide

Chapter 6 of 8 · Computer Architecture

Out-of-order execution

Trace one instruction through rename, reservation stations, physical registers, the ROB, speculative memory ordering, recovery, and precise retirement.

Watercolor of a processor die with instruction tiles moving through parallel execution lanes.

Dynamic scheduling · speculation

Separate execution order from architectural order.

An out-of-order core looks ahead, renames values, and schedules ready work. In-order retirement preserves precise per-thread architectural state; the ISA memory model separately constrains which memory orders other cores may observe.

Instruction lifecycle explorer

Execute when ready. Retire when safe.

1 / 6

Front end

Build an ordered stream.

The fetch engine predicts the next PC, fetches a block, and decodes instructions in program order. A wide front end can produce several operations per cycle, but it still needs accurate direction and target predictions to remain fed.

Live reorder-buffer snapshot

Completion can pass; architectural visibility cannot.

WorkingCompleteRetired
ROB head
ROB 0 · I0LD p21 ← [p4]Oldest · L1 missDecodedSpeculative
ROB 1 · I1ADD p22 ← p21, p7True RAW on I0Front-end queueSpeculative
ROB 2 · I2MUL p31 ← p8, p9IndependentFront-end queueSpeculative
ROB 3 · I3XOR p32 ← p10, p11IndependentFront-end queueSpeculative
ROB tail
Completion observedNone yet
Architectural retirementBlocked at ROB head

Lifecycle state update. Step 1, Fetch + decode. The front end knows program order, but the ROB has not exposed any result to architectural state.

Representative structure mapFour ordered boundaries surround a data-driven execution core.Exact queues and broadcast networks vary by implementation. The ownership and recovery roles do not.
01 · Supply

Predict + fetch

  • Branch predictor + BTB
  • Instruction prefetcher
  • I-cache and fetch queue
  • Decode block
02 · Name + hold

Rename + dispatch

  • Speculative map table
  • Physical-register free list
  • ROB allocation
  • Reservation stations
03 · Run

Schedule + execute

  • Issue / wakeup logic
  • ALU and branch units
  • Load-store queue
  • D-cache, MSHRs, memory controller / DRAM
04 · Make visible

Complete + retire

  • PRF result writeback
  • ROB completion state
  • Store queue release
  • Architectural map update

Value pathExecution broadcasts result tags through a CDB-like wakeup network; consumers read the physical value when ready.

Memory pathLoads and stores pass through ordering checks, D-cache misses allocate MSHRs, and the memory controller services the remaining request.

Recovery pathA ROB or branch checkpoint restores the rename map and free-list state, then redirects fetch while older instructions remain intact.

RAW · true dependencyload p21 ← [p4] add p22 ← p21, p7

The add needs the value produced by the load. Renaming cannot invent that value, so the add waits.

WAR · false name dependencyread old x5 as p12 write new x5 as p37

The reader keeps p12 while the new writer receives p37. Both may proceed without clobbering a name.

WAW · false name dependencywrite x8 as p41 write x8 as p52

Each destination gets a different physical register. In-order retirement chooses the architecturally latest value.

Why width stops scaling

More lanes multiply communication before they multiply performance.

Wakeup + selectCompare more tags against more waiting operands.

Associative issue logic grows with queue entries, source operands, and simultaneous result tags.

PRF portsFeed every lane and accept every result.

Extra read and write ports increase array area, access energy, wiring, and often latency.

Bypass fabricMove fresh values to every possible consumer.

Producer-to-consumer links and muxes expand rapidly as issue width and unit count rise.

Speculative wasteSpend energy on work that may never retire.

A wider window raises useful throughput only when prediction, caches, and available ILP keep it occupied.

Precise exceptions

Record now. Deliver at the ROB head.

A wrong-path page fault is recorded speculatively. If an older branch later mispredicts, the core squashes that ROB entry. If the faulting instruction becomes oldest, the core commits all older work, blocks younger retirement, restores the proper map, and vectors to the handler.

Speculative loads

Predict independence, then verify addresses.

The load-store queue compares a load against older stores with known addresses. An unresolved store may force the load to wait or may be bypassed using a dependence predictor. If addresses later match, the core replays the load and its dependent instructions from the correct value.

PRF sizing

A deeper window needs more value storage.

A deeper pipeline generally keeps more instructions and destinations in flight. The PRF, ROB, issue queues, and checkpoints must grow to avoid rename stalls. Larger multiported arrays consume area, leakage and dynamic power, and can themselves become timing-critical.

Recovery + retirement

Recover speculation at a checkpoint. Report faults at the commit boundary.

Branch recovery and precise exceptions discard younger work for different reasons, but both rely on age ordering in the ROB.

  1. 1CheckpointSave the rename map and allocation state at a speculative branch.
  2. 2DetectResolve the branch, memory ordering, or exception condition.
  3. 3Squash youngerCancel only instructions newer than the recovery point.
  4. 4Restore + redirectReclaim physical registers and restart fetch from the correct PC.
  5. 5Retire oldestCommit completed work in order; deliver a fault only when it reaches the head.

Register invariant: the architectural map changes only in retirement order.

Store invariant: a speculative store cannot update committed memory state. After retirement, a committed store may wait in a store buffer before becoming visible to other cores, subject to the ISA memory model.

Fault invariant: all older instructions appear complete and no younger instruction appears complete.

Why does the processor need a reorder buffer?

The ROB tracks instructions in original program order while execution finishes in another order. It records completion, faults, branch recovery state, and the point at which each result may become architectural. In-order retirement through the ROB is what provides precise exceptions and controlled recovery.

How can a load pass an older store with an unresolved address?

Conservative cores wait. Aggressive cores predict that the addresses will not alias, issue the load, and retain enough load-store-queue state to check once the store address resolves. A discovered conflict causes replay of the load and dependent work. Forwarding is used instead when an older matching store already has its data.

Put it into practice

Explain the mechanism. Test your reasoning.

Use the experiment above to support your answer, then apply the idea in the question bank.

Browse architecture questions

Continue the learning path

Next: Branch prediction

Simulate saturating counters and global history, distinguish BHT direction from BTB targets, and account for bubbles even when direction is correct.