Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usbdpi] Fix SYNC generation #19646

Merged
merged 1 commit into from
Feb 17, 2024
Merged

[usbdpi] Fix SYNC generation #19646

merged 1 commit into from
Feb 17, 2024

Conversation

alees24
Copy link
Contributor

@alees24 alees24 commented Sep 11, 2023

Fix SYNC signal generation on SETUP and OUT DATA packets. Non-initial SYNC omitted the first K state and usbdev coped because it responds to the final 6 bits of the SYNC signal rather than requiring detection of the full 8 bits.*

Previous SYNC signal at start of DATA transaction/packet shows [J]KJKJKJKK at the position of the red marker:
DPIsyncInvalid

Note that the first 'J' is transmitted but since the bus is already in the Idle/J state, there is no transition.
The invalid signal results from advancing the bit number even when transitioning from ST_EOP to S_SYNC

The above signals show three distinct packets, separated by the driver output enable on the bottom row. The packets are Start Of Frame (SOF), SETUP and DATA. The invalid SYNC generation occurs on any DATA packet being transmitted by the USBDPI model, ie. all packets following SETUP token packets or OUT token packets.

Corrected behavior with the full 8-bit SYNC signal KJKJKJKK:
DPIsyncFixed

Reference (from logic analyzer displaying traffic from real host controller):
USB_SYNC_Trace

  • Since this makes the usbdev slightly more robust against transmission/synchronization issues, there could be an argument for introducing generation of invalid SYNC signals as a special test case, in the same way that the DPI model currently has some limited capacity to generate other invalid data including PID errors and Bit Stuffing violations.

@alees24 alees24 requested a review from a team as a code owner September 11, 2023 22:35
@alees24 alees24 requested review from hcallahan-lowrisc, a-will, vogelpi and pamaury and removed request for a team and hcallahan-lowrisc September 11, 2023 22:35
Fix SYNC signal generation on SETUP and OUT DATA packets.
Non-initial SYNC omitted the first K state and usbdev coped
because it responds to the final 6 bits of the SYNC signal
rather than requiring detection of the full 8 bits.

Signed-off-by: Adrian Lees <[email protected]>
@alees24 alees24 merged commit f639768 into lowRISC:master Feb 17, 2024
32 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