Skip to content

[rtl] Debug module integration#614

Open
marnovandermaas wants to merge 12 commits into
mainfrom
dbg-module
Open

[rtl] Debug module integration#614
marnovandermaas wants to merge 12 commits into
mainfrom
dbg-module

Conversation

@marnovandermaas

Copy link
Copy Markdown
Collaborator

This integrates the debug module into Mocha. It is testable out of the box with Verilator and the JTAG DPI, but on FPGA you must generate a new bitstream. For convenience I have attached a bitstream for those that want to test on FPGA.
mocha_debug_module_spi_disabled.zip

Closes: #303

@marnovandermaas

This comment was marked as outdated.

@marnovandermaas marnovandermaas force-pushed the dbg-module branch 2 times, most recently from d7001d4 to f1b1013 Compare June 18, 2026 09:32
@marnovandermaas marnovandermaas marked this pull request as draft June 18, 2026 10:04
@marnovandermaas

This comment was marked as outdated.

@marnovandermaas marnovandermaas marked this pull request as ready for review June 18, 2026 11:15
@marnovandermaas

Copy link
Copy Markdown
Collaborator Author

Marked this pull request as ready for review again because both the FPGA tests are passing and the expect GDB script seems to pass as well.

@raylau1 raylau1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some formatting nits which I'll fix. Debugging on verilator and FPGA with gdb seems to be working on my side.

Comment thread hw/top_chip/dv/verilator/top_chip_verilator.sv
Comment thread hw/top_chip/dv/verilator/top_chip_verilator.vlt
Comment thread hw/top_chip/rtl/top_chip_system.sv Outdated
Comment thread hw/top_chip/rtl/top_chip_system.sv Outdated
Comment thread hw/top_chip/rtl/jtag_id_pkg.sv Outdated
elliotb-lowrisc and others added 2 commits June 18, 2026 14:56
This includes vendoring the debug module in and including it in the chip
top.

The CVA6 halt and exception addresses are fed in through the top and the
debug module address is fed into the debug module.

It also marks the license as Solderpad license for the Pulp debug
module.

Co-authored-by: Alexandre Joannou <alexandre@capabilitieslimited.co.uk>
Co-authored-by: Jonathan Woodruff <jonathan.woodruff@capabilitieslimited.co.uk>
Co-authored-by: Ray Lau <ray.lau@lowrisc.org>
Co-authored-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
elliotb-lowrisc and others added 9 commits June 18, 2026 16:04
The Verilator config allows program buffer access as fallback

Disable GDB hardware breakpoints since these are not supported by the
current CVA6 configuration and the trigger_module.sv doesn't work out of
the box when enabled. This issue is tracked here:
Capabilities-Limited/cheri-cva6#80

Co-authored-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
With 2 hosts on the primary AXI crossbar, the device-side ID needs
to be 1 bit ($clog2(AxiXbarHosts)) wider than the host-side ID.

This commit adds device-side AXI types and improves comments about
AXI ID widths in top_pkg.sv.
The debug module top now track pending resets and only acknowledges the
reset when the core is ready to fetch again.
This is so the debug module knows when the CVA6 is ready to start
fetching again.
This only works when SPI device is disconnected.
Before this you could not pass an SramInitFile into the core file.
This is necessary to have an example that doesn't actually exit the
simulator.
@marnovandermaas

Copy link
Copy Markdown
Collaborator Author

The last push changes the ID code to 0x200 instead of 0x102 as per discussion in this PR: lowRISC/part-number-registry#9

This adds a shell script that launches Verilator, OpenOCD and GDB.

GDB is run through an expect script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[design] Integrate debug module into Mocha top

3 participants