pulp-platform / riscv-dbg

RISC-V Debug Support for our PULP RISC-V Cores
Other
218 stars 72 forks source link

Functional Resets and Async Reset Glitch Prevention #123

Closed meggiman closed 2 years ago

meggiman commented 2 years ago

Fixes #120 and adds support for dtmcs.dmihardreset.

The asynchronous reset now is only controlled by the asynchronous active-low jtag_trst signal. All functional reset sources (JTAG Softreset through TestLogicReset state or dtmcs.dmihardreset) trigger a synchronous reset which is then handled by the new, clearable CDC module that synchronizes the clear request into the other clock-domain. I modified the existing dmi TB to issue random resets (synchronous and asynchronous) during the dmi transactions to verify proper functionality. To that end this PR fixes a small bug in the JTAG verification IP (ir_select was not reset during the jtag.master_reset() task).

The PR depends on an outstanding PR in the pulp-platform/common_cells repository that adds new CDC IPs with support for one-sided asynchronous resets. Once the common_cells PR is merged, I will update the bender dependency pointer in this PR accordingly.

vogelpi commented 2 years ago

Thanks for pinging @meggiman , I would certainly like to review this and provide feedback. But I won't manage to do this before end of next week.

GregAC commented 2 years ago

@andreaskurth is this something you're able to comment on?

msfschaffner commented 2 years ago

It looks like the commit that introduced the CDC problem has been reverted (https://github.com/lowRISC/opentitan/issues/11095#issuecomment-1061604875) - hence we should be able to re-vendor the RV_DM without having to wait for this patch to land.

andreaskurth commented 2 years ago

@GregAC wrote:

@andreaskurth is this something you're able to comment on?

The reset glitch (which had not been vendored into OT) has been fixed outside this PR. (This is currently not reflected in the diff of this PR because the branch has yet to be rebased onto the current master.) This PR would be relevant for OT if functional/"warm" resets triggered by the JTAG FSM or the DMI reset CSR of the DTM are required features.