riscv / riscv-test-env

https://jira.riscv.org/browse/RVG-141
Other
42 stars 107 forks source link

Add tcontrol CSR to encoding.h #42

Closed Wren6991 closed 1 year ago

Wren6991 commented 1 year ago

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)

timsifive commented 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

Wren6991 commented 1 year ago

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.