RTL Design / Module 6: FSMs & Control
Lesson 6.6

Handshakes — valid-ready & req-ack

Handshakes are how RTL blocks agree that a transfer happened. Valid-ready (AXI-stream style) and req-ack (classic bus) are the two you'll see everywhere. Get the rules wrong and you get dropped data, deadlock, or combinational loops that synthesis rejects.

Transfer occurs when…

Valid-ready: valid && ready on a clock edge (or combo handshake).
Req-ack: req asserted, ack returned — timing defined by protocol (level vs pulse).

Handshakes are the contract between RTL blocks. AXI-Stream, TileLink, and internal FIFO interfaces all boil down to valid-ready or req-ack semantics. Violating independence rules creates combinational loops that synthesis rejects and simulation may hide until silicon.

1

Valid-ready — the four rules

RuleSender (valid)Receiver (ready)
1valid may rise anytimeready may rise anytime
2Once valid high, data must stay stable until transferOnce ready high, receiver must accept if valid
3Transfer = valid && readySame
4Sender drops valid after transfer (unless back-to-back)Receiver may deassert ready after transfer
Valid-ready handshake diagram

Transfer occurs when valid && ready are both high.

2

Valid-ready RTL — sender & receiver

vr_sender.v
// Sender: assert valid when data available; hold until xfer
always @(posedge clk or negedge rst_n) begin
  if (!rst_n) begin
    valid <= 1'b0;
    data  <= 8'h00;
  end else if (valid && ready) begin
    valid <= 1'b0;           // transfer complete
    // load next beat if available
  end else if (!valid && has_data) begin
    valid <= 1'b1;
    data  <= next_data;
  end
  // else: hold valid and data (rule 2)
end
vr_receiver.v
// Receiver: ready when internal buffer has space
assign ready = !fifo_full;   // ★ ready NOT a function of valid!

// Capture on transfer
always @(posedge clk) begin
  if (valid && ready)
    fifo_push(data);
end
Combo loop trap

NEVER: assign ready = !valid; or assign valid = ready; — this creates a combinational loop. ready must depend only on receiver internal state (FIFO space). valid only on sender state.

3

Back-to-back transfers — sustained throughput

When both sides are ready, valid-ready supports one transfer per cycle without gaps. The sender keeps valid high and updates data each cycle while ready stays high.

AXI-Stream alignment: This is exactly AXI-Stream beat behavior — TVALID/TREADY with no mandatory gap between beats. Req-ack level protocols usually need an IDLE cycle between transactions.

4

Deadlock — when handshakes never complete

Deadlock happens when both sides wait on each other: sender won't assert valid until ready, receiver won't assert ready until valid. Classic combo-loop variant at the protocol level.

Handshake deadlock
Trap

Always-ready sink (assign ready = 1) is fine for testbenches. In real designs, ready must reflect back-pressure. Never tie ready to valid — even indirectly through a long combo chain.

5

Skid buffer — break the ready timing path

When the receiver's ready logic is slow, a skid buffer (2-entry FIFO) lets the sender see ready=1 one cycle earlier. Full design in Module 7.1 — here's the concept:

Skid buffer concept
Preview

Without skid: ready = f(slow_logic) → long combo path. With skid: ready = !skid_full (fast). The skid absorbs one cycle when sink hiccups.

6

Req-ack — level-sensitive handshake

SignalDirectionMeaning
reqRequester → Servicer"I need a transfer / service"
ackServicer → Requester"Transfer accepted / done"
req_ack_fsm.v
// Requester FSM — level req until ack
localparam IDLE = 2'd0, WAIT = 2'd1;
reg [1:0] state;

always @(posedge clk or negedge rst_n) begin
  if (!rst_n) begin
    state <= IDLE;
    req   <= 1'b0;
  end else case (state)
    IDLE: if (want_xfer) begin
            req   <= 1'b1;
            state <= WAIT;
          end
    WAIT: if (ack) begin
            req   <= 1'b0;
            state <= IDLE;
          end
    default: state <= IDLE;
  endcase
end
7

Valid-ready vs req-ack — when to use

ProtocolStrengthCommon in
Valid-readyBack-pressure native; pipelined; burst-friendlyAXI-Stream, TileLink, internal NoC
Req-ackSimple FSM mapping; clear transaction boundaryRegister bus, config ports, legacy IPs
Req-ack timing
▶ Test handshakes in simulator
8

Handshake design checklist

  • Transfer condition documented: valid&ready or req&ack
  • ready never depends combinationally on valid
  • Sender holds data stable while valid asserted (until xfer)
  • No combinational loops through handshake signals
  • FSM has safe default; req dropped only after ack
  • Back-pressure path tested: sink never ready for N cycles
  • Consider skid buffer if ready path is on critical timing

🎯 What to remember

  • Valid-ready transfer = valid && ready — both sides independent.
  • Never tie ready to valid — combo loop trap.
  • Req-ack maps cleanly to 2-state FSMs — great for simple ports.
  • Skid buffers break ready timing — Module 7.1 goes deep.
Advertisement