riscv-openocd icon indicating copy to clipboard operation
riscv-openocd copied to clipboard

target/riscv: check `abstractcs.busy`

Open en-sc opened this issue 11 months ago • 2 comments

According to the RISC-V Debug Spec (1.0.0-rc1)[3.7 Abstract Commands]:

While an abstract command is executing (busy in abstractcs is high), a debugger must not change hartsel, and must not write 1 to haltreq, resumereq, ackhavereset, setresethaltreq, or clrresethaltreq.

This patch ensures OpenOCD does not violate this rule.

The patch is separated into three commits.

  1. target/riscv: cache abstractcs.busy in dm013_info_t -- provides facilities to track the state of abstractcs.busy
  2. target/riscv: introduce examine_dm() function -- ensures the rule is followed during examination.
  3. target/riscv: check abstractcs.busy -- takes care of other cases.

en-sc avatar Feb 29 '24 19:02 en-sc