HomeComputer Science5-Stage CPU Pipeline: Hazards & Forwarding

5-Stage CPU Pipeline: Hazards & Forwarding

Watch instructions flow through a classic 5-stage RISC pipeline (IF/ID/EX/MEM/WB) in 3D. Toggle data forwarding on/off and see stall bubbles appear when a load-use hazard or register dependency can't be resolved in time.

Computer Science3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
computer-architecture ↗ Open standalone

This simulator renders the classic 5-stage RISC instruction pipeline (Fetch, Decode, Execute, Memory, Write-Back) as a live 3D animation. A randomly generated instruction stream — a mix of ALU operations, loads and stores, seeded with deliberate register dependencies — flows through the datapath one cycle at a time. Toggle data forwarding to see the pipeline's hazard-detection logic in action: with forwarding off, any true register dependency stalls the pipeline until the producing instruction reaches write-back; with forwarding on, most stalls vanish except the one-cycle bubble a load-use hazard always costs, because a load's value genuinely doesn't exist until the memory stage completes. Live readouts track cycle count, retired instructions, injected stall bubbles, forwarding events and the resulting instructions-per-cycle.

⚙ Under the hood

Watch instructions flow through a classic 5-stage RISC pipeline (IF/ID/EX/MEM/WB) in 3D, toggle data forwarding on and off, and see stall bubbles appear whenever a register dependency or load-use hazard can't be resolved in time.

cpupipelinecomputer-architecturehazardsforwardingrisc

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)