Forwarding Paths and Limitations
What you'll learn: You'll understand which pipeline stages can send data forward to resolve hazards and when forwarding alone isn't enough.
Where Forwarding Works
Data forwarding (bypassing) creates shortcut paths between pipeline stages to deliver results before they reach the Write-Back stage. But not all stages can forward to all others.
Common forwarding paths:
- EX → EX: The ALU result from one instruction's Execute stage forwards directly to the next instruction's Execute stage (most common)
- MEM → EX: Data from the Memory Access stage forwards to an Execute stage operation
- MEM → MEM: Memory data forwards to another memory operation
Think of it like passing a baton in a relay race—you hand it off as soon as you finish your leg, not waiting to cross the final finish line.
When Forwarding Fails
Forwarding has a critical limitation: you can't forward data that doesn't exist yet. This creates a scenario called a load-use hazard.
Example scenario:
- Instruction A loads data from memory (takes time to fetch)
- Instruction B immediately needs that data in its Execute stage
The problem? When instruction B reaches Execute, instruction A is only at Memory Access—still waiting for data from RAM. The result isn't available to forward yet.
The solution: Insert a pipeline stall (bubble) to delay instruction B by one cycle, giving the load time to complete. Forwarding alone cannot overcome the physical delay of memory access.
Key Takeaway: Forwarding paths connect later pipeline stages (EX, MEM) back to earlier ones (EX), but cannot compensate for instructions where the data isn't ready in time—particularly load instructions followed immediately by dependent operations.