AMBA AXI · Module 15
Ready/Valid Pipelining
Chain registered VALID/READY handshakes into a multi-stage pipeline without losing data or throughput — how backpressure propagates upstream stage-by-stage, why each stage needs a skid (not a bare register), the enable rule that gates every stage, and how to add compute stages while keeping the handshake intact.
A skid buffer registers one handshake stage. Real datapaths need many stages — an AXI path might register a port boundary, then an address decode, then an arbiter, then an alignment/conversion step, each adding a cycle of latency for timing. Chaining them correctly is ready/valid pipelining: a sequence of stages, each driving the next with a VALID/READY handshake, where data flows forward and backpressure propagates backward stage-by-stage, with no data lost and full one-beat-per-cycle throughput preserved when nothing stalls. Get the per-stage rule wrong and you either drop beats under backpressure or bubble the pipeline. This chapter builds the multi-stage pattern on top of the skid buffer, derives the universal per-stage enable rule, and shows how to interleave compute with the handshake.
1. The Pipeline Structure
A ready/valid pipeline is a chain of stages connected by handshakes: stage k's output (valid_k, data_k) is stage k+1's input, and stage k+1's ready feeds back to stage k. Data moves forward when a stage's output handshake completes; backpressure (a downstream ready going low) ripples backward as each stage in turn fills and deasserts its own ready.
2. The Universal Stage Enable Rule
Every pipeline stage obeys one rule. A stage advances (latches new data from upstream, or shifts its data downstream) only when it is either empty or its output is being consumed this cycle. Expressed with the handshake signals, a stage's register enable is:
// Stage k holds: valid_k, data_k. Upstream: valid_in/ready_out. Downstream: ready_k
// The stage can accept/advance when it's empty or its output is leaving:
assign ready_out = !valid_k || ready_k; // upstream-facing READY
wire advance = ready_out; // enable for this stage's register
always_ff @(posedge clk) begin
if (!rstn) valid_k <= 1'b0;
else if (advance) begin
valid_k <= valid_in; // take new beat (or go empty)
if (valid_in) data_k <= data_in; // payload only when valid
end
endThe crucial term is ready_out = !valid_k || ready_k: a stage presents READY upstream when it has no beat (!valid_k) or when its current beat is being taken downstream (ready_k). This single expression is what makes backpressure propagate exactly one stage per cycle and guarantees no overwrite of an unconsumed beat.
3. Bare Registers vs. Skid Stages
The enable rule above describes a bare pipeline register (one slot per stage): correct, full-throughput, but it leaves ready_out combinational off ready_k — so the READY path ripples through the entire pipeline in one cycle, which defeats the timing purpose. Two options:
- Skid stage per boundary. Replace each bare register with a skid buffer (Chapter 15.5): both
VALIDandREADYare registered at every boundary, so no combinationalREADYpath spans more than one stage. Full throughput, fully timing-closed, at the cost of two registers per stage and one cycle latency each. - Periodic skid insertion. Use bare registers for most stages and insert a skid buffer every few stages to chop the combinational
READYchain into bounded segments — a pragmatic area/timing trade when theREADYpath through a few bare stages still meets timing.
The decision is the same as for a single stage: register the READY path (via skid) exactly where it would otherwise be the critical path; use bare registers where it wouldn't.
4. The Timing: Backpressure Propagation
The waveform shows a three-stage pipeline streaming one beat per cycle, then the sink stalls. Backpressure climbs the pipeline one stage per cycle — each stage holds its beat as its downstream ready drops — until the source is held. When the sink resumes, the pipeline drains forward and full-rate streaming returns. No beat is lost; the only cost is the stall depth in latency.
Backpressure climbing a 3-stage ready/valid pipeline
10 cycles5. Common Misconceptions
6. Debugging Insight
7. Verification Insight
8. Interview Questions
9. Summary
Ready/valid pipelining chains registered handshake stages so data flows forward and backpressure propagates backward one stage per cycle, with no loss and full throughput. Every stage obeys one universal rule: it advances (latches a new beat) only when empty or its output is being consumed — ready_out = !valid || ready_downstream, which is also the register enable. That single invariant guarantees no overwrite of a pending beat (no loss) and acceptance of a replacement exactly when the current beat leaves (no bubble), so a chain of such stages is a lossless, order-preserving, one-beat-per-cycle channel of arbitrary depth.
A bare pipeline register registers only VALID/data, leaving the READY path combinational across the whole pipeline; to register the backward path and bound the READY critical path you use skid stages (Chapter 15.5) at the boundaries that need them — full skid where the READY path fails timing, bare registers (or periodic skid insertion) where it doesn't. Adding stages adds latency, not throughput loss, and backpressure's one-stage-per-cycle climb means deep pipelines have deep stall latency the source must tolerate. Compute blocks integrate by becoming handshake participants (output valid only when ready, input ready only when able, freeze under backpressure). Verification is a stall storm plus end-to-end conservation/ordering — the standard sign-off for any handshaked pipeline. Next, we add real buffering with FIFOs to decouple producer and consumer rates.
10. What Comes Next
You can now pipeline a handshake to any depth; next we add genuine buffering to decouple rates:
- 15.7 — FIFO-Based Buffering (coming next) — using FIFOs to decouple producer and consumer rates on AXI, absorbing bursts and bridging rate mismatches beyond what a two-entry skid can.
Previous: 15.5 — The Skid Buffer. Related: 3.1 — The VALID/READY Handshake for the per-stage contract, 3.3 — Backpressure & Stalls for the stall propagation, and 13.2 — Latency Analysis for how pipeline depth shows up as latency.