Skip to content

Backend drops the zero-length rejection response when the consumer is not ready #189

Closed

Description

@DanielKellerM

Summary

With RejectZeroTransfers=1, the backend answers a zero-length request combinationally in the cycle it accepts it, but acceptance does not depend on rsp_ready_i. The injected error response is asserted for exactly one cycle, so if the consumer is not ready in that cycle the response is silently dropped. The backend has then accepted N requests and delivered N-1 responses; every later response is credited to the wrong transfer, and the last one is never acked.

gen_reject_zero_transfers in src/backend/tpl/idma_backend.sv.tpl:

if (is_length_zero & req_valid_i & req_ready_o) begin
    rsp_ready = 1'b0;
    rsp_valid_o = 1'b1;   // one cycle only, regardless of rsp_ready_i
    ...
end

Affected

Every variant built with RejectZeroTransfers=1; the construct is variant-independent. Reproduced on tb_idma_backend_rw_axi_rw_axis, and the same stimulus also reproduces on rw_axi and r_obi_w_axi. With RejectZeroTransfers=0 the identical stimulus passes.

Minimal reproduction

Two transfers, no randomisation needed:

length src dst src/dst proto max_src_len max_dst_len decouple aw/rw
A 16 0x1000 0x80001000 0 / 0 1 128 0 / 0
B 0 0x2000 0x80002000 0 / 0 256 256 0 / 0

Transfer A must split into enough bursts that the legalizer retires while the datapath is still draining, so that the consumer is busy when B's rejection response is emitted. Boundary behaviour: length=8 with max_src_len=1 passes, length=16 fails; max_src_len=2 passes; max_src_len=256/max_dst_len=256 passes at any length.

Deterministic, trips in 1360 ns.

Observed stuck state

dp_busy=1; r_dp_req_out_valid=1 with ready low and w_dp_req_out_valid=1 with ready low (both FIFOs at usage 1); i_idma_axi_write.w_dp_valid_i=1, w_dp_ready_o=0, aw_valid_i=0 - the write transport waits for an AW meta that never comes; r_dp_rsp_valid and w_dp_rsp_valid stay high with ready low forever. The legalizer is idle and req_ready_o=1. On the memory port, axi_rsp_mem.b_valid=1 is never taken and three AW bursts (= NumAxInFlight) never receive a B.

Not fixed by the existing interlock

A zero_len_stall interlock addresses the other half of this defect, where the injected response overtakes an older in-flight transfer's response. It does not gate acceptance on rsp_ready_i, so this lost-response hole survives it.

Possibly a second instance

src/midend/idma_nd_midend.sv:99 and 212-228 show the same accept-without-checking-ready shape with neither interlock present. Flagged by inspection only; four directed ND shapes failed to provoke it, so it is unproven and needs its own investigation.

Impact on CI

This is the one remaining red vsim-sim-random leg (rw_axi_rw_axis seed 1). The other 10 were two testbench defects, fixed in #188. After that PR the leg fails honestly on this bug rather than on a bogus mismatch.

Activity

  1. DanielKellerM commented on Aug 13, 2026

    @DanielKellerM
    CollaboratorAuthor

    Correction to the stuck-state description above, from cycle-by-cycle measurement while fixing this in #193.

    I wrote that the write transport "waits for an AW meta that never comes". That reading was wrong. The legaliser pushes the AW meta and the w_dp_req on the same handshake, so they are strictly 1:1 and every AW for the in-flight transfer was emitted and consumed. aw_valid_i=0 with aw_ready_o=1 is a symptom, not the cause: with aw_decoupled=0 the post-#80 coupler only releases the next AW once the W path is ready to write, and the W path is stalled.

    The actual chain, measured:
    rsp_ready_i=0 -> r_dp_rsp_ready/w_dp_rsp_ready=0 -> the depth-NumAxInFlight write response FIFO fills and cannot drain -> w_resp_fifo_in_ready=0 gates both w_dp_ready_o and ready_to_write -> the write module stops accepting beats -> three AWs stay open with no B taken -> the testbench's writes_in_flight never decrements, so it never re-asserts rsp_ready. Circular wait.

    The root cause in the issue stands and is unchanged: the rejection is combinational on the request handshake, so it is neither held until accepted nor ordered against transfers still in flight. Both halves are fixed in #193.

  2. added 3 commits that reference this issue on Sep 24, 2026
    12fb7dd
    2ff37a2
    892434b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions