Debug spec v1.0 implementation#1590
Open
JacobPease wants to merge 222 commits into
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.
… resets to IDCODE.
… FPGA, but a test still needs to be written.
…eps, setting ebreak, resetting, and setting DCSR fields.
… stepping into a load or store instruction. Also added the stoptime field in the DCSR.
…DPCWriteValM needs to be refactored.
…ded comment about spec 3.7.1.1
…comb block. Fixed knownExceptions in debugger now that hasresethaltreq is high. Spike doesn't have that bit set high.
…ported. Also added comments clarifying some things.
…not just LSUStallM, potentially removing possible bugs in the future. Also, treating WFI as a NOP during stepping and DebugMode is implemented, but it has not been tested.
…tep after designing wfiM to be treated as a NOP during stepping. Needs DebugMode awareness too
… will reliably fail if WFI triggers an exception during stepping.
…pon resume. Added a test for it.
Contributor
|
Hi @JacobPease . It would be great to have this. Would it be working with current master? I don't have an Arty A7 but I can try to test it in a Nexys A7 or a Genesys 2 if that helps. |
Member
|
Juan,
Thanks for the email. Jacob and I aRe working to get this up to spec, hopefully this week. We are still going through code review, but hope to do another pass to get into master. Please feel free to try on Nexus A7 or Genesys 2 - I don’t have those boards with me right now, but would appreciate if you could look.
Our debug implementation only is a minimal implementation that implements abstract read/write. We hope to add more once we get into master. We welcome any involvement you can have with this. Let me know any questions or issues. Take care.
All my best,
James
On Jun 1, 2026, at 6:13 AM, Juan Schroeder ***@***.***> wrote:
[https://avatars.githubusercontent.com/u/25896545?s=20&v=4]juanschroeder left a comment (openhwgroup/cvw#1590)<#1590 (comment)>
Hi @JacobPease<https://github.com/JacobPease> . It would be great to have this. Would it be working with current master? I don't have an Arty A7 but I can try to test it in a Nexys A7 or a Genesys 2 if that helps.
—
Reply to this email directly, view it on GitHub<#1590?email_source=notifications&email_token=AFSIHPH3W66WYFIWAEDIKED45VJNZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJZGE3DENJQHE22M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4591625095>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFSIHPG6COV5ON3HCMI2KBL45VJNZAVCNFSM6AAAAACPGSQQPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKOJRGYZDKMBZGU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
…r time for a correct implementation stores the MTIME value in a new register in csrc.sv
…tion about Spike not implementing stopcount or stoptime.
…Tracer.sv and modified wsim to work with. type wsim debug64 <path/to/test> --lockstep --debug <path/to/testvector/file>
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.