Debug spec v1.0 implementation#1590
Open
JacobPease wants to merge 191 commits intoopenhwgroup:debugfrom
Open
Conversation
…mentation. These implementations will look less like how the JTAG spec mandates it and more like what the Debug spec says it should be.
…on of the Debug Transport Module.
update debug header for tap_controller.sv + some comments
…to reset the op when receiving an acknowledgement as to not trigger another transaction.
…e different fields of the registers.
… they are implemented.
…umeAck reset errors.
…of the ebreak when an ebreak enables DebugMode.
…atch due to Spike and Wally having different reset vectors.
…a mismatch with Spike's DPC.
… PC address after the jump to store in DPC.
…based on feedback in a code review meeting.
…. Committed test changed.
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 pull request contains an early stage implementation of the Debug Specification. It has the basic features of halting, resuming, resetting, halting on reset, and reading GPRs, CSRs, and FPRs. In it's current state it provides a framework with which we can implement more complicated features, like stepping and going into debug mode on ebreaks in various privilege modes. Inside
docs/debug/wallydebug.mdis a list of features already implemented and features that are going to be implemented.This PR also contains a new method of Verification for the Debug module. Since the Debug module is driven by commands sent over a JTAG interface, separate testvectors must drive the JTAG pins while Wally executes instructions. To accomplish this, a test building framework was developed taking advantage of the features of Spike and the RISC-V variant of OpenOCD which can be found at this repo: riscv-openocd
First we write assembly tests for Spike and we write Tcl scripts to drive OpenOCD. We then run these two programs together as separate processes and connect OpenOCD to Spike's remote bitbang interface. The Tcl commands drive the JTAG pins and allows the RISC-V code, which has certain stopping points in it, to finish executing, ending the test. OpenOCD is configured to output a log of all Debug Module Interface commands it writes over the JTAG interface. This log is scraped for testvectors and saved to a file.
When we run
wsimwith a configuration withDEBUG_SUPPORTEDset high, the testbenches Debugger module is driven with the testvectors generated using OpenOCD and Spike. Several features have been verified using this method.To build and run the debug tests, run the following commands starting in the cvw root directory:
In addition to remaining features to be added, there's room for other improvements and discussion on how to optimally modify the current setup. There are currently only tests written for the
rv64gcconfiguration with Debug supported. Additionally, implementing Imperas support requires thatwsimand the testbench be expanded to take two testvector references when doing single tests on a single elf file and a Debugger testvector file, though thervviinterface to the DMI is simple and easy to add to the testbench. ThisrvviDMI interface is serial interface agnostic and only requires that we connect the DMI signals.