Computer Architecture · All levels

Hazards and Forwarding Networks — Theory Deep Dive

Theory Deep Dive for Hazards and Forwarding Networks (Pipeline Fundamentals).

Foundational theory

Hazards and Forwarding Networks sits inside Pipeline Fundamentals and changes how workload pressure becomes stalls, bandwidth, latency, and power. Hazard units arbitrate execution order when data is not yet architecturally committed. Forwarding minimizes waits by routing results from intermediate pipeline points, but incorrect age/valid selection or timing races can introduce silent corruption.

Core concepts explained

  • Design and debug RAW/WAR/WAW hazard handling plus forwarding paths that reduce bubbles without violating timing or formal correctness.

  • Primary evidence: Hazard stall + forwarding correctness dashboard

  • Downstream: Compiler scheduling assumptions, DV reference model alignment, and post-silicon debug time are directly impacted.

  • Risk: Incorrect hazard handling can create low-frequency silent data corruption that escapes directed testing.

  • Classify hazards by dependency type and producer readiness window.

  • Separate structural hazards (resource conflict) from data hazards (operand availability).

  • Validate forwarding mux select with age tags, kill signals, and exception replay semantics.

  • Use scoreboarding occupancy metrics to tune false-positive stalls.

Why this matters in real chips

In production programs, Hazards and Forwarding Networks appears when workloads miss IPC, latency, or power targets. Mechanism-first reasoning prevents expensive architecture churn.

Mental model

diagram
THEORY STACK — Hazards and Forwarding Networks
Workload -> mechanism -> metric (Hazard stall + forwarding correctness dashboard) -> bounded decision

Worked intuition

  1. Name the workload class.

  2. Name the metric that moves first.

  3. Identify the responsible structure.

  4. Check software/coherency amplification.

  5. Propose the smallest reversible experiment.

Common misconceptions

  • Using average metrics when tails dominate.

  • Tuning one benchmark without product workload mix.

  • Ignoring verification and software cost.

  • Optimizing for average stall reduction while weakening correctness guarantees.

  • Ignoring rare replay/exception windows where forwarded values must be invalidated.

Key takeaways

  • Explain Hazards and Forwarding Networks with mechanism and metric.

Architecture deep dive

Pipeline depth and width are bets on branch predictability and cache behavior.

Concept diagram

diagram
PIPELINE VIEW

Fetch ──► Decode ──► Rename ──► Issue ──► Execute ──► Memory ──► Commit
  │         │          │          │          │          │          │
  ▼         ▼          ▼          ▼          ▼          ▼          ▼
I-cache   decode     ROB/RS     wakeup     ALU/BR     LSU       retire
miss      bubbles    full       select     latency    miss      bandwidth

Every pipeline discussion should name where bubbles enter and where they retire.

Metric graph

diagram
STALL STACK EXAMPLE

cycles (%)
frontend       ██████████████  28
branch         ████████        16
backend        ████████████    24
memory         █████████       18
retire/other   ██████          12

Read this before saying "make the pipe wider."

Metrics and artifacts

  • IPC/CPI breakdown

  • stall cycles by stage

  • branch mispredict rate

  • frontend vs backend bound

Mini case study

IPC drops after widening decode but branch-heavy workload shows frontend stalls unchanged. The correct read: backend was not the bottleneck — branch prediction and fetch bandwidth need investment first.

Debug branches

  • If IPC flat after deeper pipeline, check branch MPKI and cache miss stalls.

  • If hold timing fails on critical path, architecture may need shorter pipeline stage — link PD.

Senior review question

Ask: what single metric would prove this concept is working or failing on your workload?

Key takeaways

  • Connect every architecture claim to a workload and measurable metric.

  • State verification and PPA impact before proposing design changes.

Common pitfalls

  • Feature-driven design without MPKI/IPC/bandwidth evidence.

  • Ignoring coherency and NoC traffic in cache and accelerator sizing.

Study notes

Re-read this topic with one concrete workload.