CPI = BASE_CPI + STALLS/INSTR
EXEC_TIME = IC * CPI * CLK_t
ARCHITECTURE: SUPERSCALAR_OoO
STATE: PIPELINE_FLUSHED
ASKiIMAN™ DOOR 01 / FOUNDATIONS / REALM 09
--:-- · -- --- ----

Ontological Layer: Temporal Optimization

Pipelining & Performance

Making the Processor Work Faster by Overlapping Time

The Factory of Instructions

A processor does not become faster merely by rushing. True performance is achieved through the industrialization of time. By dividing instruction execution into discrete stages—Fetch, Decode, Execute, Memory, Writeback—the CPU transforms into an assembly line. Pipelining does not make an individual instruction complete faster; it overlaps the work of *many* instructions so that the aggregate throughput skyrockets. Realm 09 explores this beautiful choreography, the Hazards that disrupt it, and the mathematical formulas governing architectural efficiency.

INSTRUCTION → FETCH (IF) → DECODE (ID) → EXECUTE (EX) → MEMORY (MEM) → WRITEBACK (WB) vs HAZARD / STALL

The 12 Stages of Execution

Ontological Mapping: From Pipeline Overlap to Out-of-Order Execution

CHAMBER 01

The Nature of Performance

  • Execution time as the ultimate metric
  • Instruction Count (Compiler dependency)
  • Cycles Per Instruction (Architecture)
  • Clock Rate (Hardware physical limit)
CHAMBER 02

Clock & Cycle Time

  • Clock frequency (MHz, GHz)
  • Clock period duration
  • Synchronizing functional units
  • Frequency vs Actual Performance
CHAMBER 03

Instruction Pipelining

  • The assembly line analogy
  • Overlapping independent operations
  • Increasing aggregate throughput
  • Pipeline fill and drain phases
CHAMBER 04

Stages & Timing

  • IF: Fetch from PC
  • ID: Decode & read registers
  • EX: ALU operations
  • MEM: Data memory access
  • WB: Register write-back
CHAMBER 05

Structural Hazards

  • Hardware resource conflicts
  • Unified memory (IF & MEM collision)
  • Resolved by resource duplication
  • Split I-Cache and D-Cache
CHAMBER 06

Data Hazards

  • RAW, WAR, WAW dependencies
  • Subsequent instr needs unwritten result
  • Data Forwarding (Bypassing)
  • Routing EX result directly to next EX
CHAMBER 07

Control Hazards

  • Branches disrupt the PC sequence
  • Next instruction is unknown until EX
  • Static vs Dynamic Branch Prediction
  • Misprediction penalty (Flushes)
CHAMBER 08

Stalls & Bubbles

  • Load-Use dependencies
  • Injecting NOPs (Bubbles)
  • Deliberately idling stages
  • Severe impact on overall CPI
CHAMBER 09

Performance Math

  • Ideal Pipeline CPI ≈ 1.0
  • Actual CPI = Ideal CPI + Stall CPI
  • Amdahl's Law limit on optimization
  • Pipeline Speedup = T_seq / T_pipe
CHAMBER 10

Superscalar Execution

  • Multiple instructions issued per clock
  • Instruction-Level Parallelism (ILP)
  • Multiple execution units (ALU/FPU)
  • Pushing CPI below 1.0 (IPC > 1)
CHAMBER 11

Out-of-Order Execution

  • Reordering instructions to avoid stalls
  • Register Renaming (eliminating WAW/WAR)
  • Speculative Execution past branches
  • Reorder Buffer (ROB) for in-order retire
FINAL PROTOCOL

12 — Pipeline Engineering Laboratory

1. EX: ADD R1, R2, R3 (Writes R1)
2. ID: SUB R4, R1, R5 (Reads R1) -> HAZARD
3. ACTIVATE FWD: EX/MEM -> ID/EX MUX
[1] TRACE DATA DEPENDENCY [2] CALCULATE SPEEDUP [3] IDENTIFY BUBBLES [4] ROUTE FORWARDING [5] ANALYZE AMDAHL'S LAW

Pipelining and Superscalar design push a single processor to its absolute physical limits. When instruction-level parallelism runs dry and clock speeds hit the thermal wall, computer architects must look elsewhere for performance. They stop making a single processor faster, and start building systems with *many* processors. This brings us to Realm 10: Parallel Computing.

PERFORMANCE DIAGNOSTIC RUNNING