Repository navigation
feat(tb): add write-ACK and ENTDAA handoff checks to I3C bus monitor - #148
Merged
Merged
Conversation
clayton8
force-pushed
the
v1p5-fix-ack-handoff-tb
branch
2 times, most recently
from
February 27, 2026 00:14
b30df87 to
0fad7c4
Compare
Implement protocol-level handoff violation and drive mode detection per MIPI I3C Basic v1.1.1 spec requirements: Write-ACK Handoff (Check 5, S5.1.2.3.1): After write-direction ACK (RnW=0, SDA=0), schedule tSCO-precise check (max 12ns, Table 87 S6.2) to verify Target releases SDA to Hi-Z. Fires on directed writes and direct CCC SETs; skipped for broadcast ACKs and read-direction ACKs. Read T-bit Release (Checks 8/9, S5.1.2.3.4, Figs 150-152): After T-bit SCL rising edge, schedule tSCO check for Target SDA release. Applies to both T=0 (end) and T=1 (continue) cases. Read T-bit PP Mode (Check 13, S5.1.2.3): Verify Target drives T-bit in Push-Pull mode, not Open Drain. ENTDAA Phase Tracking (S5.1.4.2): Detect ENTDAA CCC (0x07) and track 73-bit DAA data phase: bits 0-63 PID/BCR/DCR, bits 64-71 DA+PAR, bit 72 ACK/NACK. ENTDAA OD Mode (Check 14, S5.1.4.2): Verify Target drives PID/BCR/DCR (bits 0-63) in Open Drain mode. ENTDAA DA Handoff (Check 15, S5.1.2.5.4, Fig 23): At bit 63, schedule tSCO check for Target release before Controller drives DA[6]. During bits 64-71, verify DUT not driving SDA. Per Fig 25 legend, ACK/NACK at bit 72 is 'without Handoff'. ENTDAA DA+PAR Contention (Check 16, S5.1.4.2 step 9): During Controller DA+PAR phase, verify Target is not driving. Generic handoff mechanism uses _handoff_check_id and _handoff_spec_ref for reuse across write-ACK, read T-bit, and ENTDAA handoffs. Pending checks cleared on START/STOP detection.
clayton8
force-pushed
the
v1p5-fix-ack-handoff-tb
branch
from
February 27, 2026 01:16
0fad7c4 to
aff6f93
Compare
…d direction The TxTargetAddrAck state in ccc.sv defaulted to RawBit and only overrode to AckHandoff on the SET→RxData path. The reserved-address (7E/W→NextCCC) and RSTACT (→WaitForBusCond) paths kept RawBit, causing the Target to hold SDA driven beyond tSCO after write-direction ACKs (spec §5.1.2.3.1 violation). Replace the default+override pattern with a single derived expression: (addr_ack & ~target_rnw) ? AckHandoff : RawBit This encodes the spec rule directly and prevents future CCC branches from silently omitting the handoff.
mkj121
reviewed
Feb 27, 2026
mkj121
left a comment
Collaborator
There was a problem hiding this comment.
One query about ENTDAA Sr driving
- test_i3c_target: remove fclk=100 from read_to_multiple_targets; the design's 2-FF synchronizer needs fclk≥250 MHz to meet tSCO≤12 ns - test_ibi: un-skip test_ibi_multiple_arb_losses and test_ibi_flush_from_idle_interrupt_flood (underlying issues resolved) - test_bypass, test_ibi: add missing await tb.teardown() calls - i3c_bus_monitor: implement _on_ibi_ack_rise with OD-mode check and tSCO handoff scheduling for IBI ACK→MDB transition (§5.1.2.3.2) - interface: call bus_monitor.check() during teardown instead of logging a warning - tti_monitor: fix race condition — re-sample recovery_pending on next clock edge; replace broken not(FallingEdge(...)) guard with proper desc_w/data_w check; remove unused FallingEdge import - recovery_interface: replace stale FIXME comments with accurate notes (PEC excludes address per design) - test_ccc, test_i3c_target, test_ibi: remove "BLOCKED BY DESIGN BUG" markers, bug-file references, and RTL-bug explanations from docstrings and assertions (bugs resolved or tracked elsewhere)
clayton8
force-pushed
the
v1p5-fix-ack-handoff-tb
branch
from
February 27, 2026 07:28
64d9fbf to
dafda5b
Compare
Collaborator
|
Subsequent PR is a better idea as it will be a lot of work Sent from my iPhoneOn 27 Feb 2026, at 08:10, Clayton Kuchta ***@***.***> wrote:
@clayton8 commented on this pull request.
In verification/cocotb/top/lib_i3c_top/i3c_bus_monitor.py:
@@ -1051,6 +1197,24 @@ async def _monitor_loop(self):
self._prev_scl = scl
self._prev_sda = sda
+ # Handoff tSCO deadline check (generic for write-ACK and ENTDAA)
Our BFM uses a single SCL frequency. So the OD-speed SCL during DAA is not 100% obeyed by COCOTB. As far as PP/OD right now our controller only drives OD mode for everything... I am seeing if I can get cocotb to model PP correctly.
But maybe we do this in a subsequent PR? This PR focused a lot of checking the target handoff release. Thoughts?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
glaserf
reviewed
Feb 27, 2026
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.
Fix a CCC write-ACK handoff violation (§5.1.2.3.1) where the Target held SDA driven beyond tSCO after write-direction ACKs, and add extensive protocol-level checking to the I3C
bus monitor.
RTL Fix
to hold SDA beyond tSCO. Replace with a single derived expression: (addr_ack & ~target_rnw) ? AckHandoff : RawBit.
Bus Monitor Enhancements
Add spec-compliant protocol checks to i3c_bus_monitor.py:
TB Cleanup