Repository navigation
[src] Fix ENTDAA TE3 parity bypass and stale data in RX/TX width converters - #139
Merged
Merged
Conversation
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
approved these changes
Feb 18, 2026
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.
clayton8
force-pushed
the
v1p5-i3c-tx-fifo
branch
from
February 18, 2026 17:02
86ba0b0 to
ec28c78
Compare
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.
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.
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.
!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.
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.
left up to 32 bits of stale data in the converter. Added converter clear on TX FIFO reset to fully flush the TX path.