backend: Hold the zero-length rejection until it is accepted - #193
Open
DanielKellerM wants to merge 1 commit into
Open
backend: Hold the zero-length rejection until it is accepted#193DanielKellerM wants to merge 1 commit into
DanielKellerM wants to merge 1 commit into
Conversation
The rejection was a combinational function of the request handshake, so it lasted one cycle whether or not the consumer was ready and it could overtake the response of a transfer still in flight. A dropped rejection leaves the backend owing a response forever; a reordered one is credited to the wrong transfer. Latch it into a proper stream and hold back a zero-length request while an older rejection is unaccepted or any transfer still owes a response. Fixes pulp-platform#189
This was referenced Aug 13, 2026
Collaborator
Author
|
Deferred until after the 0.7.0 release, per Daniel. Not to be merged into the release branch. |
DanielKellerM
force-pushed
the
devel
branch
3 times, most recently
from
August 19, 2026 11:33
a4b8a4e to
2e0b0fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #189.
With
RejectZeroTransfers=1the rejection response was a purely combinational function of the request handshake, so it carried no state. That gave it two failure modes:rsp_ready_i, so a consumer that is busy elsewhere never sees it. The backend has then accepted N requests and delivered N-1 responses, and every later response is credited to the wrong transfer.The fix
Latch the rejection into a proper valid/ready stream that is held until accepted, and hold back a zero-length request while an older rejection is unaccepted or any transfer still owes a response:
Gating acceptance directly on
rsp_ready_iwas considered and rejected: it puts a bus-facing ready into thereq_ready_ocone and closes a real combinational loop through the ND midend and the inst64 top. Herezero_len_stalldepends only on flops, so no loop is created. Confirmed with verilator: the UNOPTFLAT warnings on this top are pre-existing and unchanged in count.Verified
jobs/backend_*/zero_transfer_busy.txt, registered injobs.json): deterministic, no randomisation. Passes on rw_axi, rw_axi_rw_axis, r_obi_w_axi, r_axi_w_obi and rw_obi.Tripped Watchdog (i_axi_r_watchdog)at 1170 ns on rw_axi and 1160 ns on rw_axi_rw_axis. Restoring it passes again. Noter_axi_w_obiandrw_obipass either way, since an OBI write destination commits synchronously and the deadlock chain cannot close.rw_axi_rw_axisrandom seed 1 leg, which contains two zero-length transfers, goes from failing (Tripped Watchdogat 236210 ns, 19 of 20 jobs launched) to passing (20 of 20, normal finish).target/rtlbyte-for-byte, so nothing generated was hand-edited.** Fatal:.Follow-up, not fixed here
src/midend/idma_nd_midend.sv(around lines 211-227) has the same construct with neither interlock. It was flagged by inspection and four directed ND shapes failed to provoke it, so it is unproven and deserves its own investigation rather than a speculative copy of this fix.