Microarchitecture field notes · rev. 1967→today

Out-of-Order
Execution

The Machine Beneath the ISA: How modern processors stop waiting politely for slow instructions, dynamically discover independent operations, and yet guarantee the illusion of strict sequential execution.

LAB RESEARCH TEAMPresented By:
Mohil GosarI025
Yaswanth IllaI031
Aliasgar LakkadghatI037
THE PROCESSOR'S CONTRACT

The ISA Abstraction

The Instruction Set Architecture (ISA) promises the programmer that instructions execute one after another in strict program order: Instruction N+1 sees all changes made by Instruction N.

Microarchitectures are free to violate this internal execution order as long as the program-visible outcome is 100% indistinguishable from sequential execution.

PARALLELISM HUNT

Instruction-Level Parallelism

Programs are not purely serial strings of math. Many instructions compute completely unrelated values on disjoint registers.

ILP is the potential to execute multiple independent instructions concurrently within a single program thread. Dynamic out-of-order execution is the hardware engine that finds and exploits this ILP at runtime.

THE LATENCY GAP

Why Latencies Differ

Physical physics and arithmetic complexity dictate that operations cannot take equal time. An integer bitwise OR finishes in picoseconds; a double-precision floating-point divide or cache miss takes orders of magnitude longer.

If an in-order CPU stalls on a 300-cycle DRAM miss, all downstream execution units sit completely starved and idle.

Interactive Hardware Latency Scale

Click an operation to inspect physical latency
Integer ALULATENCY: 1 cycle

Bit shifts, additions, bitwise AND/OR. Single-cycle combinational datapath.

Chapter 02why is everyone waiting?

The Bottleneck: In-Order Execution

In an in-order processor, instructions march down the pipeline like soldiers in single file. If instruction I2 requires an operand produced by instruction I1 that has not yet completed, the pipeline registers must inject bubbles (stalls).

Even if instructions further down the stream (like I4 or I5) are ready to compute, the in-order dispatch stage refuses to advance them. Valuable functional units—adders, multipliers, memory ports—sit completely idle.

OUR BENCHMARK INSTRUCTION STREAM
I1: L.D F6, 34(R2)PRODUCES F6 IN 2 CYCLES
I2: MUL.D F0, F4, F6STALLED WAITING FOR F6
I3: ADD.D F8, F0, F2BLOCKED BY IN-ORDER POLICY
I4: DIV.D F10, F0, F6BLOCKED BY IN-ORDER POLICY
I5: ADD.D F6, F8, F2BLOCKED BY IN-ORDER POLICY

One blocked slot, all resources wasted.

Notice: I2 (MUL.D) has a true data dependency on I1 (L.D) for F6. That waiting is mathematically necessary.

However, I3, I4, and I5 waiting behind I2 simply because they were written later in the assembly file is an artifact of scheduling policy, not physical necessity!

Dependency Breakdown & Concurrency Opportunity
  • I1 (L.D): Memory read from 34(R2). Takes 2 cycles.
  • I2 (MUL.D): Genuinely blocked on F6 from I1. (RAW True Dependency).
  • I3 (ADD.D) & I4 (DIV.D): Both depend on F0 from I2.
  • I5 (ADD.D): Depends on F8 from I3.
  • 🚀 Opportunity: As soon as I2 finishes, I3 and I4 can execute CONCURRENTLY on separate Functional Units! In-order execution serializes them!

Visual Conveyor: The In-Order Pipeline Freeze

Stage 1: Fetch
Stage 2: Decode / Issue
Stage 3: Execute
Stage 4: Memory
Stage 5: Writeback
I2 (MUL.D)
I1 (L.D)
Idle
Idle
Idle
Chapter 03keep the semantics, loosen the schedule

The Solution: Out-of-Order Execution

01FRONTEND DISPATCH

Issue in Order

Instructions are fetched and decoded strictly in program order. Operands are renamed to isolate dependencies before entering waiting stations.

02DYNAMIC CORE

Execute When Ready

Instructions sit in reservation stations snooping for their operands. As soon as all required inputs arrive and a functional unit is free, execution fires immediately.

03BACKEND COMMIT

Retire in Order

Results complete out of order, but in modern processors, architectural registers and memory stores are only made permanent in strict program order via a Reorder Buffer (ROB).

Critical Precision: What Out-of-Order Execution Is (and Isn't)

A common beginner misconception is that out-of-order processors fetch or decode instructions randomly. They do not.

1. Issue Stage:

Strictly IN-ORDER. The hardware reads the program sequence consecutively to accurately track data dependencies.

2. Execution Stage:

OUT-OF-ORDER. Governed purely by dataflow readiness (when operands are valid), completely decoupled from program position.

3. Retirement Stage:

Strictly IN-ORDER (in ROB architectures) to guarantee precise interrupts, branch misprediction recovery, and sequential semantics.

Side-by-Side Schedule Timeline Comparison

Notice how the long-latency DIV.D (6 cycles) completely overlaps with the execution of ADD.D F6, F8, F2.

IN-ORDER SCHEDULE (26 CYCLES)
Cyc 1–4: [ L.D ]
Cyc 5–9: [ MUL.D ] (Pipeline halts!)
Cyc 10–12: [ ADD.D F8 ]
Cyc 13–19: [ DIV.D F10 ] (Adder sits idle!)
Cyc 20–22: [ ADD.D F6 ]
OUT-OF-ORDER SCHEDULE (17 CYCLES)
Cyc 1–5: [ L.D ]
Cyc 5–10: [ MUL.D ]
Cyc 10–12: [ ADD.D F8 ] ⇄ [ DIV.D ] (PARALLEL!)
Cyc 13–15: [ ADD.D F6 ] ⇄ [ DIV.D ] (PARALLEL!)
Cyc 16–17: [ DIV.D completes ]
Chapter 04the algorithm that schedules around waiting

Tomasulo's Algorithm: The Core Idea

Robert M. Tomasulo's Landmark Breakthrough

In 1967, computer engineer Robert M. Tomasulo introduced his dynamic scheduling algorithm at IBM for the System/360 Model 91 floating-point execution unit. His goal was to maximize floating-point throughput across multiple arithmetic units without forcing software compilers to be hand-tuned to the specific pipeline latencies of the Model 91.

DISTRIBUTED BUFFERS

Reservation Stations (RS)

Instead of instructions waiting in a centralized register file or stalled pipeline register, each functional unit has distributed buffer slots called Reservation Stations.

Key Mechanism & Function:
  • Holds the pending opcode (e.g., ADD.D, MUL.D).
  • Tracks operand readiness via Vj (value) or Qj (producer tag).
  • Buffers inputs right at the execution unit port.
  • Frees the instruction fetch unit to continue issuing future instructions.
Chapter 05follow the instruction from issue to result

Tomasulo's Algorithm: Step by Step

ALGORITHM SPECIFICATION

Step 1: Issue (Dispatch)

In-order dispatch and reservation station allocation

Get the next instruction from the program queue. Find a free reservation station for this instruction's opcode. If no reservation station is free, stall instruction issue (Structural Hazard). Otherwise, allocate the station.

ALGORITHM PSEUDOCODE · Tomasulo Core Loop
EXECUTED EVERY CYCLE
while instructions_remain_in_program():
    // 1. ISSUE STAGE (Strict Program Order)
    if next_instruction_ready_to_issue() and free_reservation_station_available():
        allocate_station(inst)
        capture_ready_operands_or_record_producer_tags(inst)
        rename_destination_register(inst.dest, station.tag)
    
    // 2. EXECUTE STAGE (Out-of-Order / Dataflow Driven)
    for each station in busy_reservation_stations:
        if station.operands_ready() and functional_unit_available():
            execute_operation_cycle(station)
            if station.execution_finished():
                mark_ready_for_cdb_broadcast(station)
    
    // 3. WRITE RESULT / BROADCAST STAGE (CDB Arbitration)
    if station_ready_to_write_result():
        broadcast_on_cdb(station.tag, station.result_value)
        wake_up_waiting_reservation_stations(matching_tag)
        update_register_status_and_value(matching_tag)
        release_reservation_station(station)

    // 4. COMMIT STAGE (Modern Reorder Buffer Extension)
    if using_reorder_buffer() and rob_head.is_ready():
        retire_instruction_in_order(rob_head)
        commit_to_architectural_state(rob_head)
Chapter 06case file #F0–F10 · true vs false dependencies

The Enemy: Data Hazards

Evidence Board Case File
HAZARD INVESTIGATION: TRUE DATA DEPENDENCY
EARLIER INSTRUCTION (I1)
MUL.D F0, F4, F6
CONFLICT: F0
LATER INSTRUCTION (I2)
ADD.D F8, F0, F2

Read After Write (True Data Dependency)

A consumer instruction requires a numerical value produced by an earlier instruction. ADD.D requires the product computed by MUL.D. Register renaming cannot eliminate this hazard because the data physically does not exist yet. The consumer must wait until the producer broadcasts.

Can Register Renaming Solve This?

CANNOT BE REMOVED BY RENAMING

No! True data dependencies represent fundamental physical dataflow. You cannot compute an answer before its inputs are produced.

Structural Hazards in Tomasulo Architectures

1. RS Starvation:

If all 2 Multiplier stations (Mul1, Mul2) are full, dispatch must STALL until one completes and broadcasts.

2. FU Contention:

If multiple reservation stations have ready operands simultaneously, they arbitrate for limited ALU ports.

3. CDB Bus Collision:

If Add1 and Mul1 finish in the same clock cycle, only one can broadcast on the single CDB. Priority arbitration decides who wins.

Chapter 07the hardware that coordinates the work

Inside Tomasulo's Blueprint

Select a Subsystem to Inspect:
DISTRIBUTED BUFFERS

Reservation Stations (Add / Mul / Load)

Architectural Purpose: Holds pending operations and their operands right at the functional unit inputs, decoupling issue from execution.

STATE STORED:

Busy flag, Opcode, Vj & Vk (operand values), Qj & Qk (waiting producer tags), Dest tag.

INTERACTIONS:

Constantly snoops the Common Data Bus, comparing Qj/Qk tags with broadcast tags.

INPUTS RECEIVED:

Operands from Register File / RAT at issue; broadcast results from Common Data Bus (CDB).

OUTPUTS SENT:

Operands and start signals to Arithmetic Functional Units when all operands are valid.

CDB Broadcast Tap Connected: Associative Snooping Active
Chapter 08what changes when useful work stops waiting?

Performance Lab: Statistical Comparison

Scientific measurement & honest limits

Historical Floating-Point Throughput (1967 Estimates)

Comparison of independent operations vs sequentially dependent operations across pioneering architectures.

Y-Axis Scale:
MachineYearIndependent (MFLOPS)Dependent (MFLOPS)Parallelism RatioMicroarchitecture Key Innovation
IBM 709019590.0460.0461.0×Sequential vacuum-tube/transistor baseline
CDC 6600196441.33.08×Central Scoreboard with 10 functional units
IBM S/360 M911967116.71.64×Robert Tomasulo's reservation stations & CDB
ACS-11968 est.160275.93×Advanced Computing Systems out-of-order design
Source: Mark Smotherman, IBM Advanced Computing Systems — Compiler / Performance sections. https://mark.people.clemson.edu/acs_performance.html
Essential Scientific Caveat

These are historical performance estimates across distinct physical computer systems designed over a nine-year period (1959–1968), NOT a controlled ablation experiment comparing Tomasulo's Algorithm against an identical in-order core. The machines differ in clock frequencies (e.g. 7090 at ~450 kHz vs Model 91 at 16.6 MHz), transistor logic family, memory hierarchies, and functional unit counts. The graph illustrates the theoretical headroom of instruction-level parallelism under dependent vs independent code; it must not be interpreted as attributing all performance differences solely to Tomasulo's algorithm.

Chapter 09step the machine; inspect every tag

The Interactive Engine

Scheduling Paradigm
Speed:
MASTER CLOCK
Cycle 0
COMMON DATA BUS (CDB):Bus quiet (no broadcast this cycle)
Tag = Reservation Station Name
What is happening in Cycle 0?

Simulation reset to Cycle 0. Ready to issue the first instruction (L.D F6, 34(R2)).

Instruction Status Ledger
SelectInstructionIssueExec Start–EndCDB WriteCurrent State
👉L.D F6, 34(R2)———Waiting
#2MUL.D F0, F4, F6[Consumer]———Waiting
#3ADD.D F8, F0, F2———Waiting
#4DIV.D F10, F0, F6[Consumer]———Waiting
#5ADD.D F6, F8, F2———Waiting
💡 Tip: Click any row to inspect operands, producer tags, and dependencies in the inspector below.
Register Status & RAT
RegProducer QiArchitectural Value
F0—0.0
F2—2.0
F4—4.0
F6—0.0
F8—0.0
F10—0.0
R2—100.0
Qi shows station producing the value. Value is valid when Qi = —.
Reservation Stations Status
StationBusyOpVj (Ready Val)Vk (Ready Val)Qj (Wait Tag)Qk (Wait Tag)DestRemaining Latency
Load1no———————
Add1no———————
Add2no———————
Mul1no———————
Mul2no———————

Instruction Dossier: L.D F6, 34(R2)

STAGE: WAITING
Destination Reg:
F6
Final Expected: 3.0 (from mem)
Assigned Station:
Not yet assigned
Latency: 2 cycles
True Dependencies (RAW Producers):
None (Operands ready at issue)
Dependent Consumers:
#2 (MUL.D F0, F4, F6)
#4 (DIV.D F10, F0, F6)
Chapter 10from classic Tomasulo to modern CPUs

Modern Evolution and Field Notes

MICROARCHITECTURE ADVANCEMENT

Classic Tomasulo vs Modern CPUs

Modern high-performance processors (such as Intel Golden Cove, AMD Zen 5, and Apple M4) still rely on the foundational dynamic scheduling principles invented by Robert Tomasulo in 1967, but adapt them into scalable, modern microarchitectures:

Concept1967 Classic TomasuloModern OoO Processors
RenamingDistributed in Reservation StationsPhysical Register File (PRF) + RAT
QueuesSmall distributed stations (2–3 entries)Unified Issue Queues (128–256+ entries)
RetirementImprecise, updates registers on CDBIn-order Reorder Buffer (ROB 512+ entries)
BranchingStatic branch handling / stallsBranch Predictors + Speculative Commit

Hides long operation latencies (memory cache misses, complex divides)

Exploits hidden Instruction-Level Parallelism dynamically

High silicon area and static power consumption

Extreme verification complexity for branch misprediction rollbacks

KEY TAKEAWAY

The Power and Penalty of Dynamic Scheduling

Out-of-order execution is an engineering trade-off: spending millions of transistors and watts of electrical energy on rename tables, wake-up comparators, and reorder buffers in exchange for running single-threaded sequential code as close to theoretical dataflow speed as possible.

“Execute when ready. Broadcast once. Retire in order.”

The three-part creed that governs every modern high-performance microarchitecture.