[darjeeling,sim] Replace DMI DPI to rv_dm with JTAG DPI to toplevel #24758
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.
Commit 87d5764 brought rv_dm and lc_ctrl to the same debugging crossbar. However, the existing DMI DPI interface interacts only with rv_dm. Swap this out for the JTAG DPI interface so we can talk to both modules.
I really wanted to also support the old infrastructure, allowing folks to use dmidpi to talk directly (and exclusively) to rv_dm for better performance. But I couldn't find a clean way to do this: the old functionality was gated off by the
DMIDirectTAP
Verilog define, but as far as I can tell, FuseSoC will always define the Verilog macro, so using this Verilog `ifdef won't work, as the `else block will never be triggered (and Verilog lacks the#if
that exists for the C preprocessor):opentitan/hw/top_darjeeling/dv/verilator/chip_sim_tb.sv
Lines 67 to 100 in 2585f4a
Making it a Verilog parameter might let it look like this:
But this caused two problems: 1) I'd have to punch a signal from toplevel all the way to rv_dm, which feels clumsy, but the bigger problem was 2) Verilator seems to instantiate both DPI modules, which caused OpenOCD to play poorly when trying to connect to the bitbang port.
This PR is a little more bold in that it eliminates the DMI DPI interface entirely. I'd sincerely appreciate comments on the best way to proceed from here.