[rtl] Debug module integration#614
Open
marnovandermaas wants to merge 11 commits into
Open
Conversation
10f249a to
973d94d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d7001d4 to
f1b1013
Compare
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>
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>
This comment was marked as outdated.
This comment was marked as outdated.
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 adds a shell script that launches Verilator, OpenOCD and GDB. GDB is run through an expect script.
f1b1013 to
95e6543
Compare
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
reviewed
Jun 18, 2026
Comment on lines
+172
to
+187
| // Virtual jtag | ||
| jtagdpi #( | ||
| .Name("jtag0"), | ||
| .ListenPort(44853) | ||
| ) u_jtagdpi ( | ||
| .clk_i, | ||
| .rst_ni, | ||
| .active(1'b1), | ||
| .jtag_tck(jtag_tck), | ||
| .jtag_tms(jtag_tms), | ||
| .jtag_tdi(jtag_tdi), | ||
| .jtag_tdo(jtag_tdo), | ||
| .jtag_trst_n(jtag_trst_n), | ||
| .jtag_srst_n( ) | ||
| ); | ||
|
|
Comment on lines
30
to
+32
|
|
||
| lint_off -rule BLKSEQ -file "*/lowrisc_dv_dpi_sv_jtagdpi*/jtagdpi.sv" -match "*ctx = jtagdpi_create(Name, port, assert_srst)*" | ||
|
|
Contributor
There was a problem hiding this comment.
Better to add a comment here:
// Mute RTL style warning from lowRISC JTAG DPI
Comment on lines
+405
to
+423
| dmi_jtag i_dmi_jtag ( | ||
| .clk_i ( clkmgr_clocks.clk_main_infra ), | ||
| .rst_ni ( rstmgr_resets.rst_debug_n[rstmgr_pkg::DomainMainSel] ), | ||
| .testmode_i ( 1'b0 ), | ||
| .test_rst_ni ( 1'b1 ), | ||
| .dmi_rst_no ( ), // keep open | ||
| .dmi_req_valid_o ( debug_req_valid ), | ||
| .dmi_req_ready_i ( debug_req_ready ), | ||
| .dmi_req_o ( debug_req ), | ||
| .dmi_resp_valid_i( debug_resp_valid), | ||
| .dmi_resp_ready_o( debug_resp_ready), | ||
| .dmi_resp_i ( debug_resp ), | ||
| .tck_i ( dm_jtag_tck ), | ||
| .tms_i ( dm_jtag_tms ), | ||
| .trst_ni ( dm_jtag_trst_n ), | ||
| .td_i ( dm_jtag_tdi ), | ||
| .td_o ( dm_jtag_tdo ), | ||
| .tdo_oe_o ( ) | ||
| ); |
Contributor
There was a problem hiding this comment.
Nit: port formatting, instance name should be u_dmi_jtag.
Comment on lines
+405
to
+407
| dmi_jtag i_dmi_jtag ( | ||
| dmi_jtag #( | ||
| .IdcodeValue(jtag_id_pkg::RV_DM_JTAG_IDCODE) | ||
| ) i_dmi_jtag ( |
Comment on lines
+8
to
+9
| localparam logic [10:0] JEDEC_MANUFACTURER_ID = {4'd12, 7'b110_1111}; | ||
| localparam logic [3:0] JTAG_VERSION = 4'h1; |
Contributor
There was a problem hiding this comment.
Nit: alignment can be better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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