20d64ac416
844 -> 818 lines, 30% -> 12% comment-only. The descriptor bit layout is kept
in FULL, because it is the one interface in this module an external driver
parses; what went was the disassembly listing that proves it (CLAUDE.md holds
that) and the per-bug narrative around each fix.
Stale references fixed:
* The module claimed to receive frames "from W5500SPIMaster". The W5100
parallel master is the default back-end; the stream interface is
deliberately identical, so the text now names neither.
* "RWP FIFO write-side (sync->exi)" and "rx_irq : 1-cycle pulse ->
PulseSynchronizer input" both described the old split clock domains. The
exi domain was merged into sync; that FIFO is a SyncFIFO and the pulse is
a plain wire.
* The module docstring's write sequence said descriptor "bytes 0, 1 and 2"
are rewritten and "byte 3 (status) stays 0x00", and WRITE_D2's comment
said byte 3 "keeps the placeholder". Both predate WRITE_D3, which exists
precisely because the placeholder NEVER reaches desc_base+3 -- so the
file contradicted its own next state, and in the direction that sounds
reassuring.
Two comment blocks were duplicated outright: the registered-ring-bounds
timing note appeared twice in a row with slightly different wording, and the
NCRA-reset rationale appeared both on the port and again at the logic.
Structure: elaborate() is now _ring_bounds, _free_space, _frame_fsm and
_ncra_reset, with _ncra_reset still elaborated last so it keeps priority over
ADVANCE_RWP. The FSM's docstring lists all eleven states in visit order, and
the valid-&-ready rule that both 2026-10-09 handshake bugs violated is stated
once for every write state instead of twice at two of them.
Also fixed a real (if harmless) bug in the testbench: send_frame's docstring
sat after two statements, making it a no-op expression rather than a
docstring.
VERIFIED EQUIVALENT: generated RTLIL identical, 1930 lines, after stripping
\src attributes. Full module suite passes, bba_top T9 6/6 at EXI_HALF=1, 2
and 8, and this module's own 25 checks all pass including T5's stalled-write
case and T7's small-ring wrap.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>