Add support for tunneled JTAG access to RISC-V targets #2794
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.
Change
This change adds
TunneledJtagDtminarchitecture::riscv::dtm::jtag_dtmthat allows access to a RISC-V target through a JTAG tunnel with a configurable instruction and data register width. Additionally, this change addsattached_tunneledandattach_autoinRiscvInterfaceBuilderto allowSessionto use a tunnel if configured on theTarget.The JTAG tunnel is configurable in YAML for a variant like this:
I've tested it with a VexRiscv soft-core running on a Xilinx XC7A200T using a Digilent HS3 probe.
Background
It's common to use a JTAG tunnel to access RISC-V soft-cores running on FPGAs. A tunnel allows using the same cable for configuring the FPGA and debug access to the soft-core within. The simple protocol was originally created by SiFive, but is now used by many (including VexRiscv).
OpenOCD supports tunneled JTAG access to RISC-V with the
riscv use_bscan_tunnelcommand (docs on this page).A tunneled scan looks like this:
RiscvJtagTunnel::ir_id)