-
Notifications
You must be signed in to change notification settings - Fork 361
target/riscv: hard reset DTM if dmistat is busy #1287
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
base: riscv
Are you sure you want to change the base?
Conversation
Due to certain reasons, the DMI scan is busy, leading to a timeout and exit. When restarting OpenCD, a hard reset of the DTM is required.
9675154
to
c9193f8
Compare
some logs is as follows:
|
I don't think this should be done. I am not opposed to having some command which will force a reset if we don't have it already. But this sounds to me that it is a buggy chip. Which chip causes this if you can share it? |
@MarekVCodasip Thank you for your reply.
Could you please tell me why you think this is a chip bug?
This is the chip we are developing. The chip is a daisy chain structure with an RCPU and an ACPU. The power of ACPU DM requires the RCPU to manipulating hardware registers. Accessing the power-down ACPU DM will cause this problem. About the usage scenarios of dtmhardreset: In general this should only be used when the Debugger has reason to expect that the outstanding DMI transaction will never complete (e.g. a reset condition caused an inflight DMI transaction to be cancelled). |
I understand the usecase, but a hard-reset of the DTM is a big hammer: it aborts every in-flight DMI transaction and loses all debugger state. On large RTL simulations that can hide real bugs or corrupt the debug session, so I’d rather not make it the default recovery path for a plain timeout. Could we expose it as an explicit TCL variable like |
I agree, and you’d make a optional hard-reset of the DTM for a plain timeout instead of this PR? |
@lz-bro, @MarekVCodasip, I'd suggest considering just implementing this as a Tcl script, something like:
To achieve the behavior in this patch, this script can be run on We could add a target-type-specific event that is triggered on DMI operation timeout, though I'd suggest to wait until the event interface is reworked (see https://review.openocd.org/c/openocd/+/9079/comment/5ef2cfe8_f3d174aa/). |
Due to certain reasons, the DMI scan is busy, leading to a timeout and exit. When restarting OpenCD, a hard reset of the DTM is required.