wire / wire-format / cpu-pipeline

CPU pipeline stages (classic 5-stage)

The classic 5-stage RISC pipeline: IF (Instruction Fetch), ID (Instruction Decode + Register Read), EX (Execute/ALU), MEM (Memory Access), WB (Write Back). Each stage takes one clock cycle. Hazards: structural (resource conflict), data (RAW/WAR/WAW dependencies), control (branch). Solutions: forwarding/bypassing, stalling, branch prediction, out-of-order execution.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: CPU pipeline stages (classic 5-stage)

wire format

spec: Computer architecture

The classic 5-stage RISC pipeline: IF (Instruction Fetch), ID (Instruction Decode + Register Read), EX (Execute/ALU), MEM (Memory Access), WB (Write Back). Each stage takes one clock cycle. Hazards: structural (resource conflict), data (RAW/WAR/WAW dependencies), control (branch). Solutions: forwarding/bypassing, stalling, branch prediction, out-of-order execution.

fieldsizemeaning
IF (Instruction Fetch)stage 1Fetch instruction from memory (I-cache). Compute next PC (PC+4 or branch target).
ID (Instruction Decode)stage 2Decode instruction. Read source registers from register file. Sign-extend immediate.
EX (Execute)stage 3ALU operation. Compute branch target. Evaluate branch condition.
MEM (Memory Access)stage 4Load/store to data cache. (NOP for non-memory instructions.)
WB (Write Back)stage 5Write result to register file. (NOP for stores and branches.)
RAW hazarddata hazardRead After Write: instruction needs a result that hasn't been written yet. Solved by forwarding or stalling.
WAR hazarddata hazardWrite After Read: less common in in-order pipelines. Solved by register renaming in OoO.
WAW hazarddata hazardWrite After Write: two instructions write the same register. Solved by register renaming in OoO.
Control hazardcontrol hazardBranch outcome unknown until EX stage. Solved by branch prediction and flushing on misprediction.
Structural hazardresource hazardTwo instructions need the same resource (e.g., single-ported memory). Solved by duplicating resources or stalling.

example:

00 00 00 00

CPU pipeline stages (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/cpu-pipeline or /wire-format/cpu-pipeline.json