You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to integrate Ibex with debug module, however I found that under current implementation of the debug module, both reset-to-halt and reset-to-run are not working correctly, which crashes the OpenOCD process.
Below are my attempts to locate the problem, However, I have little knowledge about the code or the specification, if there are anything I got wrong or missed, please point out. Any suggestions are appreciated. Thanks in advance.
However, the debug module has its ALLRUNNING field wired to halted signal, which is set by a write operation to HALT address of the debug bus, and cleared by write to RESUME address of the debug bus.
// clear the halted flag as the hart resumed execution
halted_d_aligned[wdata_hartsel] =1'b0;
// set the resuming flag which needs to be cleared by the debugger
resuming_d_aligned[wdata_hartsel] =1'b1;
end
When the core is already in parked-loop state and a reset-to-run command is issued by OpenOCD, the core may never has a chance to write to RESUME address, since it has been resetted by ndmreset signal. So the ALLRUNNING field will never be set and OpenOCD just get stucked in the loop until timeout reached.
This internal state (core is actually running while dmstatus has wrong value) also causes crash of OpenOCD, then a reset to dm will be needed for the dm to function properly.
The text was updated successfully, but these errors were encountered:
yeah, this is because when ndmreset is set, the current version DM doesn't clear the "halted flags".
and one more thing, the dmcontrol.dmactive may also not works well because it should do something with the registers in dm_mem.sv but it doesn't.
for example:
spec says dmactive can clear the abstractcs.busy status. but the current version does nothing with abstractcs.busy
Hi, I'm trying to integrate Ibex with debug module, however I found that under current implementation of the debug module, both reset-to-halt and reset-to-run are not working correctly, which crashes the OpenOCD process.
Below are my attempts to locate the problem, However, I have little knowledge about the code or the specification, if there are anything I got wrong or missed, please point out. Any suggestions are appreciated. Thanks in advance.
OpenOCD sets
NDMRESET
field indmcontrol
during reset period, and expects to seeALLRUNNING
field to be set indmstatus
indicating the end of reset operation. These behaviors are addressed below:https://github.com/riscv/riscv-openocd/blob/4f9e2d7171f3cad8d1a99dff3eee5ec5e6d8ea2b/src/target/riscv/riscv-013.c#L2090
https://github.com/riscv/riscv-openocd/blob/4f9e2d7171f3cad8d1a99dff3eee5ec5e6d8ea2b/src/target/riscv/riscv-013.c#L2144
However, the debug module has its
ALLRUNNING
field wired tohalted
signal, which is set by a write operation toHALT
address of the debug bus, and cleared by write toRESUME
address of the debug bus.riscv-dbg/src/dm_csrs.sv
Lines 249 to 250 in 3670267
riscv-dbg/src/dm_mem.sv
Lines 242 to 255 in 3670267
When the core is already in parked-loop state and a reset-to-run command is issued by OpenOCD, the core may never has a chance to write to
RESUME
address, since it has been resetted byndmreset
signal. So theALLRUNNING
field will never be set and OpenOCD just get stucked in the loop until timeout reached.This internal state (core is actually running while dmstatus has wrong value) also causes crash of OpenOCD, then a reset to dm will be needed for the dm to function properly.
The text was updated successfully, but these errors were encountered: