CHERIoT debug module integrated#387
Conversation
c8391fb to
d5e339a
Compare
elliotb-lowrisc
left a comment
There was a problem hiding this comment.
I've not managed to get to the point of testing this yet, but here are a couple of early comments.
d5e339a to
b7f362c
Compare
|
I tried building LLDB using the CHERIoT LLVM toolchain, but I'm not sure it's CHERI-aware. It seemed less capable than the RISC-V GDB we have in the |
57b36a3 to
2d62e46
Compare
This comment was marked as outdated.
This comment was marked as outdated.
I think I've found the cause of this. I noticed the Verilator sim output an |
Cool, that makes sense! It also means that using a CHERIoT-enabled debugger should help this issue. |
2d62e46 to
95b1824
Compare
This patch fixes the test logic inside the CHERIoT debug module TAP.
Initialize the vendor directory from the CHERIoT debug module upstream at revision: 145bc9e2186368ec804aadfe61d21e7cbcbba33c The upstream repository is located at github.com/CHERIoT-Platform/cheriot-dbg-module
The debug module needs to be accessible on both the data and instruction ports.
95b1824 to
de033a2
Compare
|
Ah ha! The instruction cache is the culprit. It's not respecting the mutable nature of instructions loaded from the AbstractCmd part of the debug module memory map. Register load Abstract Commands kept ending up returning the value of |
|
@elliotb-lowrisc here's a fix for the MISA issue: lowRISC/sunburst-chip#68 |
399cea6 to
4bb8ca9
Compare
This commit: - Regenerates both crossbars and connect up debug module. - Removes the custom debug reset logic. - Switches from RISC-V to CHERIoT debug module. - Adjust Verilator lints.
An example of how you would use this is: $ util/mem_helper.sh load_program -e sw/cheri/build/checks/uart_check -t util/verilator-openocd-cfg.tcl
This also includes code to restart the core after reprogramming using the memory helper script.
With the RTOS mainline gaining some support for code in HyperRAM, it would be nice to be able to load such images in over OpenOCD without needing to write code to do bounce buffering. While here, also give the debug host access to the system_info peripheral, to provide some more diagnostic information.
This connects the debug host up so that it can also inspect the HyperRAM and the System information IP.
63841b5 to
347aa3d
Compare
Also remove stale sw-debug.md
This renames the chip to riscv-cheriot and also adds some additional configuration for GDB.
This means that you can load a new program into memory and not exit OpenOCD immediately, for example: util/mem_helper.sh load_program -e sw/cheri/build/checks/uart_check -x ""
Synthesis under Vivado 2021.1 is currently not passing timing because of the debug module being added to the instruction fetch bus. Vivado 2024.1 does pass timing so use this instead. Co-authored-by: Elliot Baptist <elliot.baptist@lowrisc.org>
Now that we have a properly functioning debug module, we must start the core again after loading the image.
This commit pulls in the latest changes to the sonata-ibex branch, which reports RV32E as enabled when running in CHERIoT mode and disables the instruction cache when in debug mode. Update code from upstream repository https://github.com/lowrisc/cheriot-ibex.git to revision 158a03fd338f9a5aa977edbe7452bff67c499e93 Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
347aa3d to
f09d47f
Compare
This integrates the CHERIoT debug module into Sonata.
Memory inspection and register inspection work, as well as setting break points.
When trying the "run" command in GDB and asking it to start from the beginning, I get a remote failure reply 'E0E', but I'm hoping this will be solved when using a CHERI-aware LLDB.