Roflin e9b1a75bfe Discard SPRAM responses with no request outstanding
SPRAMArbiter gives ETH writes ABSOLUTE priority -- eth_wr_ready is asserted
combinationally whenever eth_wr_valid is high, so the write port is never
stalled.  Two consequences worth recording:

  - The T5 stall model added to rx_frame_assembler does NOT reflect hardware.
    Its value was eliminating a hypothesis, not modelling reality.
  - EXI READS are what get preempted, so a read response can be delayed --
    including past the end of the transaction that asked for it.

The register file did not guard against that.  The response handler pushed
whatever arrived, and HEADER0 reset `outstanding` and `sp_req` but not
`sp_pending`.  So a late response was pushed into tx_fifo anyway, a held byte
leaked across the transaction boundary, and `outstanding - 1` from zero
underflowed a 4-bit counter to 15 -- which then broke the prefetch bound for
the rest of that transaction.

Now guarded on (outstanding != 0), and sp_pending is cleared in HEADER0.

WHAT THIS DOES NOT CLAIM.  I cannot demonstrate that this causes the +1
descriptor offset seen on hardware (17 of 22 frames, varying frame to frame).
A test written in bba_register_file passes with AND without the guard --
checked both ways -- because that testbench models TX as a capture list per
transaction, with no persistent tx FIFO and no header drain pops, which is
precisely the mechanism by which a leaked byte would shift the next read.  A
test that cannot fail is worse than no test, so it is deleted rather than
banked, and the gap is documented where it was.

THE MISSING TEST, recorded in bba_register_file.py: a bba_top-level test that
performs an EXI DMA read from the SPRAM ring WHILE the ethernet side writes
frames into it.  Only under that overlap can a response be delayed past its
transaction.  No simulation does this today, which is why the offset is still
formally unexplained -- the fix here is a real latent bug, not a proven cause.

--seeds 8: clk 28.1-30.3 MHz, EXI 54.9-62.3 MHz, 8/8 PASS.  Best seed 7
(clk 30.26, EXI 61.09), flashed.  Gateware only -- .dol unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-09 19:00:35 +02:00
2026-06-13 19:02:58 +02:00
2026-08-28 10:29:41 +02:00
2026-06-16 14:59:18 +02:00
2026-08-28 10:29:41 +02:00
S
Description
No description provided
60 MiB
Languages
Python 84.9%
C 12.4%
Shell 1.1%
Dockerfile 0.7%
Makefile 0.4%
Other 0.5%