Closed Wren6991 closed 1 year ago
The debug spec itself can generate a very comprehensive set of constants for use in C code. The process is described at https://github.com/riscv/riscv-debug-spec#build-instructions
Here's what the output looks like: https://github.com/riscv/riscv-openocd/blob/riscv/src/target/riscv/debug_defines.h
Looks this was actually fixed last night by 91754f96c, so I'll close this PR as it's now redundant. I was just extending the existing pattern to avoid using a hardcoded bitmask in a fix for one of the asm tests.
Thanks for linking that debug_defines.h header, I'd seen that the .tex was generated from the XML source but hadn't seen the header generation.
This CSR is in the 0.13.2 debug spec, but not listed here. Needed for a fix to the breakpoint.S test in riscv-tests, which fails to set
tcontrol.mte
on systems that implement it (PR forthcoming)