-
Notifications
You must be signed in to change notification settings - Fork 72
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
Timing of DMI req/rsp signals #166
Comments
Oh! I've just realised that the implausibly large delay is caused by the fact that TCK is not being toggled (so the CDC takes a long time!). So there's an easy workaround on the OpenTitan side: make sure that TCK is being toggled in that time. The result ends up being a 4 cycle wait between request and response, which is much more sensible! But I think my question in the last paragraph still stands. |
I don't think we have documented anything like that. Usually, we have logic that does an exponential (or linear) backoff whenever we hit "busy" as is described in the spec.
I'm confused. Shouldn't that be the case already? |
I'm thinking about the following sequence:
From the outside agent's point of view, it sees:
|
I've spent a rather confusing couple of hours trying to diagnose behaviour that I'm seeing in OpenTitan. There, we have a frontdoor agent that does DMI transactions as follows:
dmi
register with the operation required.dmi
register withop
set to zero (a "nop").dmireset
field indtmcs
to clear the flag, then go back to the previous step.The "short time" that is currently in the agent is 10 TCK cycles. But this is not really enough. Specifically, the CDC component (
i_dmi_cdc
indap
) takes a reasonable time for thedmi_resp_i
signal to be synchronised todmi_resp
indmi_jtag.sv
. This timing depends on the implementation ofprim_fifo_async_simple
.In an example test that I've just run, the time from the end of the first JTAG transaction to when
dmi_resp_valid
goes high indmi_jtag
is 13 TCK cycles. Here's a screenshot of waves that show this:Unfortunately, the OpenTitan frontdoor didn't wait long enough (because of the 10 TCK cycles above). The result is that the "nop" JTAG transaction starts too early and the
CaptureDr
JTAG state happens a cycle before the response comes back. The end result is that our frontdoor agent thinks the DMI operation is complete, but then gets rather confused when it sees a "busy" response in the next JTAG transaction it sends.There's a trivial short-term workaround: to increase the "short time" that we wait in the DV agent. (I'm going to do that). But I'm a bit confused: is there a minimum number of clk/TCK cycles between request and reading the response? (And is it described anywhere?) If not, maybe it makes sense to make things a bit more robust by treating an operation as being in progress from when the req goes out to when the response comes back.
The text was updated successfully, but these errors were encountered: