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

[jtag,dv] Keep TCK running a short time after a transaction #23747

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

rswarbrick
Copy link
Contributor

This handles a rather confusing situation in the DMI frontdoor. The problem is that a DMI request has to travel from dmi_jtag to dm_top (involving a CDC from TCK to the main clock) and then back again (involving a CDC from the main clock back to TCK).

If we stop sending JTAG operations in that time, the CDC doesn't actually get anywhere. The wait is jtag_agent_cfg_h.vif.wait_tck(10), which ends up waiting based on elapsed time rather than clock edges.

The result is that when we send another JTAG operation to find out the result of the operation, the "busy" status only makes it through the CDC after the JTAG operation has finished and reported that the dm is idle.

Things then get rather confused when the "busy" status appears, which the agent interprets as a mysterious operation that has just come into being.

This handles a rather confusing situation in the DMI frontdoor. The
problem is that a DMI request has to travel from dmi_jtag to
dm_top (involving a CDC from TCK to the main clock) and then back
again (involving a CDC from the main clock back to TCK).

If we stop sending JTAG operations in that time, the CDC doesn't
actually get anywhere. The wait is jtag_agent_cfg_h.vif.wait_tck(10),
which ends up waiting based on elapsed time rather than clock edges.

The result is that when we send another JTAG operation to find out the
result of the operation, the "busy" status only makes it through the
CDC *after* the JTAG operation has finished and reported that the dm
is idle.

Things then get rather confused when the "busy" status appears, which
the agent interprets as a mysterious operation that has just come into
being.

Signed-off-by: Rupert Swarbrick <[email protected]>
@rswarbrick rswarbrick added the Component:DV DV issue: testbench, test case, etc. label Jun 20, 2024
@rswarbrick rswarbrick requested a review from a team as a code owner June 20, 2024 13:40
@rswarbrick
Copy link
Contributor Author

The fact that this window exists at all seems like a design error (or maybe a misunderstanding on the part of me / the DV team!)

I've raised a question about it on the Pulp project here: pulp-platform/riscv-dbg#166.

Copy link
Contributor

@hcallahan-lowrisc hcallahan-lowrisc left a comment

Choose a reason for hiding this comment

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

This makes sense to me, but I don't know the problem space too well. Is it expected under normal use for TCK to continue running in the intermediate period to ensure data has time to propagate through the CDC?

@rswarbrick
Copy link
Contributor Author

Yep, that's exactly right. The propagation time is essentially measured in cycles of the two clocks. If one of the clocks stops, it takes a while :-D

@rswarbrick rswarbrick merged commit 7eb9f33 into lowRISC:master Jun 24, 2024
32 checks passed
@rswarbrick rswarbrick deleted the jtag-tck-for-dmi branch June 24, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants