Skip to content

[src] Fix ENTDAA TE3 parity bypass and stale data in RX/TX width converters - #139

Merged
clayton8 merged 6 commits into
chipsalliance:v1p5from
clayton8:v1p5-i3c-tx-fifo
Feb 20, 2026
Merged

clayton8 merged 6 commits into
chipsalliance:v1p5from
clayton8:v1p5-i3c-tx-fifo

Conversation

@clayton8

@clayton8 clayton8 commented Feb 17, 2026 •

Copy link
Copy Markdown
Collaborator
  • ENTDAA TE3 parity check bypassed when enabled — parity_ok in ccc_entdaa.sv used || te3_err_det_en_i instead of ||
    !te3_err_det_en_i, making TE3 error detection non-functional. The target ACKed addresses with bad parity instead of
    NACKing per I3C spec §5.1.10.1.4.
  • Stale RX byte after overflow — After an RX FIFO overflow during a private write, rx_fifo_wvalid_o stayed asserted in
    i3c_target_fsm.sv. When the FIFO later drained, the stale byte entered the 8-to-N width converter and corrupted the next
    transfer. Fixed by gating wvalid on overflow and clearing the converter on RX FIFO reset.
  • Stale TX data after FIFO reset — The N-to-8 converter immediately loads from the TX FIFO, so a TX FIFO reset alone
    left up to 32 bits of stale data in the converter. Added converter clear on TX FIFO reset to fully flush the TX path.
  • Fix TE0 pulsing for 2 clock cycles causing the counter to be inaccurate.
  • handle STOP/Sr during T-bit in private write
  • do not mark tx_data_complete on Sr abort in TxDataTbit

Nto8 converter immediatly loads data from the TX_DATA. If trying to
flush out the TX path this is impossible since the TX FIFO reset
only reset the FIFO and this module would have a "stale" 32 bits of data
unless there was a prive read. This change will help fully clear out the
TX path when you reset the TX FIFO.

@mkj121 mkj121 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of typos

Comment thread src/rdl/docs/README.md Resolved
After an RX FIFO overflow during a private write, rx_fifo_wvalid_o in
i3c_target_fsm.sv remains asserted indefinitely. When the FIFO later
drains (SW reads + RX_DATA_RST), the stale byte completes a spurious
handshake and enters the width converter, corrupting the first bytes
of the next private write transfer.

New logic prevents rx_fifo_wvalid_o from asserting when overflow is detected
and when we clear the RX_DATA fifo we also clear the converter logic to be safe.
The parity_ok bypass condition used '|| te3_err_det_en_i', which
short-circuited the parity check to True when TE3 detection was
enabled — the opposite of the intended behavior. Changed to
'|| !te3_err_det_en_i' so the bypass activates when detection is
disabled, matching the TE4 pattern on line 229 and I3C spec §5.1.10.1.4.
@clayton8 clayton8 changed the title [src] clear Nto8 when TX_DATA fifo cleared [src] Fix ENTDAA TE3 parity bypass and stale data in RX/TX width converters Feb 18, 2026
te0_err_o was level-sensitive — qualified by last_addr_valid_o (registered)
which stays high for 2+ cycles, causing downstream TE0 counter to
double-count. Use bus_addr_valid (single-cycle combinational pulse from
the FSM) with bus_addr_d/bus_rnw_d instead, consistent with all other
TE error signals.
When STOP or Repeated Start arrives during the T-bit phase
(RxPWriteTbit), two bugs were triggered:

1. rx_fifo_wvalid_raw fired on any exit from RxPWriteTbit, including
   STOP/Sr overrides that pre-empt T-bit completion. This pushed a byte
   to the RX queue without parity verification.

2. rx_last_byte_o only checked state_q == RxPWriteData, so it did not
   fire when leaving RxPWriteTbit due to STOP/Sr. No RX descriptor was
   generated, the queue was not flushed, and byte_counter in
   descriptor_rx carried stale state into the next transfer.

Fix rx_fifo_wvalid_raw by gating with bus_rx_rsp_i.done instead of
(state_d != RxPWriteTbit). This ensures the byte is only pushed when the
T-bit was actually received by bus_rx_flow and parity can be checked.

Fix rx_last_byte_o by extending the state_q check to include
RxPWriteTbit. When STOP/Sr aborts the T-bit, state_d is Idle or RxFByte
respectively, which matches the existing state_d inside {RxFByte, Idle}
check. The normal T-bit completion path (state_d = RxPWriteData) is
excluded, so no spurious descriptor is generated.
When the Controller aborts a GET CCC (e.g. GETSTATUS) with a Repeated
Start during the T-bit phase, the transfer is incomplete. Previously,
set_tx_data_complete was unconditionally asserted on any Sr in
TxDataTbit. If a STOP followed before TxTargetAddrAck could clear
tx_data_complete, get_status_done_o would falsely fire, causing
controller_standby to clear err_o and lose the Protocol Error.

Remove set_tx_data_complete from the Sr abort path entirely. An Sr
abort means the Controller interrupted — the transfer is definitionally
incomplete. The normal completion path (bus_tx_rsp_i.done with
tx_data_last_byte) is unchanged and continues to correctly mark
tx_data_complete when all bytes are sent.
@clayton8
clayton8 merged commit 44c9615 into chipsalliance:v1p5 Feb 20, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants