Skip to content
Open
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
d9b8420
Added dummy debug transport module for now.
JacobPease Jul 30, 2025
05d7512
Added tap controller based on Dr. Harris' implementation.
JacobPease Aug 1, 2025
d47fcf1
Merge branch 'main' of github.com:openhwgroup/cvw into debug
JacobPease Aug 1, 2025
45ff8f0
Added a Boundary Scan Register and Instruction Register initial imple…
JacobPease Aug 1, 2025
3dc149c
Lots of clarifying changes. Getting closer to a testable implementati…
JacobPease Aug 4, 2025
ca1ebf7
Fixed syntax errors.
JacobPease Aug 5, 2025
77396ef
update debug header for tap_controller.sv + some comments
stineje Aug 6, 2025
05318c8
Merge pull request #1 from stineje/debug
JacobPease Aug 6, 2025
44c3d9f
change indentation
stineje Aug 6, 2025
024bcab
add state definition for State
stineje Aug 6, 2025
01058ce
formatting
stineje Aug 6, 2025
7c54688
clarify comment
stineje Aug 6, 2025
4324dce
indentation issues on tap_controller
stineje Aug 6, 2025
79a15ce
Cleaned up syntax errors.
JacobPease Aug 7, 2025
cfcb70e
Resolved merge.
JacobPease Aug 7, 2025
02b6420
Fixed illegal unsized constant errors.
JacobPease Aug 7, 2025
33807ef
Bug fixes. Problems with sensitivity lists and resets.
JacobPease Aug 8, 2025
d6e7bf6
Fixed DTMCS reset bug. Need to reset other fields of important regist…
JacobPease Aug 8, 2025
62cc276
Might need to look at this op logic later in the DMI. For now, needs …
JacobPease Aug 8, 2025
3f7d6cd
possible data_reg_new.sv without packed
stineje Aug 11, 2025
9d7ad71
add another change to remove packed
stineje Aug 11, 2025
2f3ea35
clean up blunder on pcked def
stineje Aug 11, 2025
c2a2c33
update dtm
stineje Aug 11, 2025
d8ddb79
update tap_controller
stineje Aug 11, 2025
f7181c4
Added early debug module. Trying to figure out reading and writing th…
JacobPease Aug 13, 2025
be1ec74
small changes to format
stineje Aug 15, 2025
ea07012
Added state machine for halting and resuming the hart.
JacobPease Aug 16, 2025
d3ec8cf
Added ResumeReq masking when HaltReq is set in the debug module.
JacobPease Aug 16, 2025
944d8be
minor tweaks in comments
stineje Aug 17, 2025
eef6c71
Removed data fields.
JacobPease Aug 18, 2025
d146e8b
Fixed merged conflicts.
JacobPease Aug 18, 2025
f588941
update dm comment
stineje Aug 19, 2025
715fcb3
spacing in dm and a comment
stineje Aug 19, 2025
30234a7
Added the feature to read and write registers with the Abstract Acces…
JacobPease Aug 20, 2025
732f4e6
Resolved merge conflict.
JacobPease Aug 20, 2025
c57ae03
Fixed bug where reading a register was putting the wrong value in Data0.
JacobPease Aug 20, 2025
1902e1e
remove old HDL that is probably not needed
stineje Aug 21, 2025
5d796fd
minor tweak on spacing
stineje Aug 21, 2025
5e41892
Vivado linting revealed an issue with the tap_controller's reset sign…
JacobPease Aug 22, 2025
87e8d40
Fixed merge conflict. Merged.
JacobPease Aug 22, 2025
a79fcea
Removed synchronizers, added synchronizer to UpdateDR, and added Debu…
JacobPease Aug 22, 2025
e73cfa1
minor stylistic comment changes
stineje Aug 24, 2025
ca6514a
leave some comments
stineje Aug 24, 2025
0957ff7
add header to inst_reg.sv
stineje Aug 24, 2025
2a772cf
remove blank line bsr.sv
stineje Aug 24, 2025
86ee32f
Temporarily tied bypass to idcode as this fixes OpenOCD's interaction…
JacobPease Aug 26, 2025
429a6ad
Fixed merged conflict.
JacobPease Aug 26, 2025
f5a63ce
Fixed always_comb for cmderr. Now it works on fpga.
JacobPease Aug 26, 2025
fc252b3
Added some untested functionality to the debug module. This should be…
JacobPease Aug 27, 2025
7fefb89
Added the ability to read CSRs with Abstract Register read commands. …
JacobPease Sep 2, 2025
ef2fa06
Fixed bug where response valid wouldn't go high if command wasn't sup…
JacobPease Sep 2, 2025
82e7273
Added better cmderr handling to the Debug Module.
JacobPease Sep 3, 2025
e4e5683
Fixed GPR access, cmderr setting, and NextValid handling.
JacobPease Sep 4, 2025
d19fa5f
Fixed an if condition bug. Need to rebuild on FPGA.
JacobPease Sep 4, 2025
5dd3d0b
This commit is important. This particular commit fixes most issues wi…
JacobPease Sep 5, 2025
4f8d364
Fixed issues with synthesis, but synthesis was not the issue. Missing…
JacobPease Sep 5, 2025
ce67ed8
add ranges for registers per page 19 of the specification. I did not…
stineje Sep 7, 2025
785c3af
Change the way the registers were clocked so that everything is clock…
JacobPease Sep 8, 2025
03eb93b
remove comments in bsr.sv as they are self evident
stineje Sep 9, 2025
086a338
clean up dtm comments
stineje Sep 9, 2025
0e67ba9
remove unneeded signal
stineje Sep 9, 2025
54f51c4
remove unneeded comments
stineje Sep 9, 2025
2169fb7
silly comment clean up
stineje Sep 9, 2025
9f38240
comment cleanup
stineje Sep 9, 2025
87d4282
more comment cleanup on dtm
stineje Sep 9, 2025
630effe
fix spacing of data_reg.sv
stineje Sep 9, 2025
bd8ee8a
add comment on dtm.sv
stineje Sep 9, 2025
9986344
Merge branch 'main' of github.com:openhwgroup/cvw into debug
JacobPease Sep 13, 2025
1ceca47
Adds debug modules to wally
JacobPease Sep 18, 2025
c15788c
Added debugger submodule to primary testbench.
JacobPease Sep 18, 2025
6d5e422
add JEDEC information and hard code logic variable
stineje Sep 19, 2025
3ae4f59
Fixed testbench tdo assignment and fixed naming conflict in data_reg.sv
JacobPease Sep 19, 2025
717ceb3
Removed last traces of old structs.
JacobPease Sep 19, 2025
cb7e2bd
Initial debug csr module. It's a work in progress.
JacobPease Sep 19, 2025
eabc2be
Added Abstract Register Read and Write to CVW.
JacobPease Sep 22, 2025
023a428
get rid of comments - let's move forward :)
stineje Sep 23, 2025
016d12f
refine comments on config-shared
stineje Sep 23, 2025
0ab5f5d
Added DebugMode signal to Hazard Unit.
JacobPease Sep 23, 2025
a2aee1c
Merge branch 'debug' of github.com:JacobPease/cvw into debug
JacobPease Sep 23, 2025
60a73f5
Set up debug tests and fix many bugs.
JacobPease Sep 23, 2025
28e110d
fix(debug): fixed abstract GPR read enable pin
JacobPease Sep 24, 2025
c6d24e1
update debuggers.sv + description
stineje Sep 25, 2025
3220175
remove commented lines out
stineje Sep 25, 2025
459a083
update MD for Wally debug specification
stineje Oct 7, 2025
2179190
feat: Added debug test building
JacobPease Oct 10, 2025
2f31171
Merge branch 'debug' of github.com:JacobPease/cvw into debug
JacobPease Oct 10, 2025
6814085
feat: Initial skeleton of debug test creation python script.
JacobPease Oct 14, 2025
ed53a29
feat: debug test building able to build multiple tests
JacobPease Oct 15, 2025
e35f374
feat: Improved Debug Spec test building
JacobPease Oct 15, 2025
6ba0e21
fix: Multiple files now building for debug
JacobPease Oct 15, 2025
ba1af5b
cleanup of old signals not needed - moving onward and upward
stineje Oct 16, 2025
704abb3
update DFPR item in dm.sv - still need to update in FP regfile and FSM
stineje Oct 16, 2025
8c3e85e
added FPRDDebugEnable to make sure synthesis friendly - still need to…
stineje Oct 16, 2025
f3413ac
fix: objdumps now all build
JacobPease Oct 16, 2025
3ae7642
fix: All make rules now working.
JacobPease Oct 16, 2025
6768627
feat: testbench loads testvectors for debugger simultaneously
JacobPease Oct 16, 2025
36e5098
update Makefile w/header plus info on WALLY which will give error oth…
stineje Oct 17, 2025
079797c
feat: DPC sets PCF and Flushes on Resume
JacobPease Oct 17, 2025
3259dc7
chore: removed useless comment
JacobPease Oct 17, 2025
6eb6971
fix: Implemented correct resumeack and havereset bits
JacobPease Oct 23, 2025
7b0c2be
feat: Debug Module now works on FPGA
JacobPease Oct 28, 2025
ccf9ac1
feat(debug): Halting on reset
JacobPease Nov 6, 2025
669381d
feat(debug): Testbench runs multiple debug tests
JacobPease Nov 7, 2025
d1eddf1
feat(debug): Debugger now tracks testvector state
JacobPease Nov 24, 2025
14c3ae1
fix(debug): Fixed resuming from current PC
JacobPease Nov 25, 2025
a8b613d
feat(debug): Debugger now only prints on failure
JacobPease Nov 26, 2025
02a874a
Merged main into debug.
JacobPease Dec 9, 2025
3f06646
chore(debug): Removed tabs and trailing whitespaces
JacobPease Dec 9, 2025
38e7c0c
Merge branch 'main' of github.com:openhwgroup/cvw into debug
JacobPease Dec 9, 2025
d2dd1e7
fix(debug): SV fork works in Verilator now
JacobPease Dec 9, 2025
b074928
feat(debug): FPU register reading.
JacobPease Dec 13, 2025
bfbc84e
feat(debug): Added debug fpu test.
JacobPease Dec 13, 2025
45bfd17
fix(debug): fixed the debug fpu test signature
JacobPease Dec 16, 2025
f99c486
spacing in tap_controller
stineje Dec 18, 2025
f7c064f
add rv32 program even though not setup for it yet
stineje Dec 22, 2025
8e0ca30
chore: added comments to hazard.sv describing DebugResume
JacobPease Jan 28, 2026
90bce60
update feature list for Wally Debug - more on the way
stineje Jan 29, 2026
81623ff
update install for OpenOCD and wally-packages for OpenOCD
stineje Jan 31, 2026
8522499
delete unnecessary README for Debug OpenOCD
stineje Jan 31, 2026
9767f24
fix typo in wallydebug.md
stineje Feb 3, 2026
1427c94
update README to remove trailing whitespace
stineje Feb 3, 2026
ed997c9
remove modified from openocd-install.sh
stineje Feb 3, 2026
260faa4
remove whitespace after boostrap
stineje Feb 3, 2026
62e0b85
update headers for openocd bin install
stineje Feb 3, 2026
0864751
fix whitespace
stineje Feb 3, 2026
de1faa1
fix PEP8 debugtestgen.py line
stineje Feb 3, 2026
4e25781
add another test example for debug
stineje Feb 5, 2026
4125683
fix missing test for debug that I forgot to push
stineje Feb 5, 2026
6a447e9
fix whitespace tests.vh
stineje Feb 5, 2026
9b9dd6b
update WALLY-ex for debug
stineje Feb 5, 2026
7991a48
chore: added ebreak debug test for rv64
JacobPease Feb 18, 2026
5416d1e
fix: OpenOCD state on ebreak is updated now.
JacobPease Feb 19, 2026
bdc4fbb
update README.md with issue and better clarification for the README r…
stineje Feb 23, 2026
0ca64c6
fix typo in md for README on debug
stineje Feb 23, 2026
a31fecb
fix typos/grammatical issues in README
stineje Feb 23, 2026
5d64259
update README for program issue L122
stineje Feb 24, 2026
3e0ee15
update gcd example
stineje Feb 24, 2026
4bf7bff
add Python for users to see real result
stineje Feb 24, 2026
faeef07
change output of fpu.py to be better represented
stineje Feb 24, 2026
0508bb2
update WALLY-debug-02 test
stineje Feb 25, 2026
6e2c541
update WALLY-debug-01 immutability test
stineje Feb 25, 2026
7c3e003
add README to Python dir
stineje Feb 25, 2026
0067917
feat: Added ebreak to wally. Many fixes to halting and resuming.
JacobPease Feb 26, 2026
2f16b77
Merge branch 'debug' of github.com:JacobPease/cvw into debug
JacobPease Feb 26, 2026
199fcb9
fix: Added state machines for ResumeReq and HaltReq.
JacobPease Feb 26, 2026
0a8e34a
add hazard issue for DebugResume for flushing appropriately
stineje Mar 1, 2026
a0416e5
add comments to csrd.sv
stineje Mar 3, 2026
e37ac98
fix InstrValid as confusing
stineje Mar 3, 2026
e585408
move state info and clean up
stineje Mar 3, 2026
9cfb3c0
remove non-tested item - think we need an ebreak that fires when EBRE…
stineje Mar 3, 2026
9d41615
fix minor typo
stineje Mar 3, 2026
b24ceff
put back but dont like InstrValidE - change
stineje Mar 3, 2026
9545293
remove InstrValidE from csrd.sv to make agnostic
stineje Mar 3, 2026
51cc339
feat: better Resume ack handling with states.
JacobPease Mar 3, 2026
2973b5d
clean up old code and add comment on new ResumeAck sequence
Mar 3, 2026
c98551e
update some minor comments + fixing structure
stineje Mar 4, 2026
6d60503
fix tabs and definitions
stineje Mar 4, 2026
af1a928
beautify of comments
stineje Mar 4, 2026
0ff1b02
beautify of comments
stineje Mar 4, 2026
8305d24
beautify of comments
stineje Mar 4, 2026
1039ea0
beautify of comments
stineje Mar 4, 2026
af15ed9
add comment for dcsr
stineje Mar 4, 2026
a9fcb0e
fix always_ff coding style
stineje Mar 4, 2026
4722927
fix: added reading trigger module registers to known exceptions until…
JacobPease Mar 6, 2026
ef06150
feat: added stepping. Hacky solution, need to revisit.
JacobPease Mar 7, 2026
69570f6
feat: added WALLY-debug-step test to tests.vh
JacobPease Mar 7, 2026
4c095d1
feat: forgot to add WALLY-debug-step test.
JacobPease Mar 7, 2026
ee61e38
fix: made the memory signature change if stepping doesn't work properly.
JacobPease Mar 7, 2026
379ec6c
fix: moved ResumeAck to debug module, it's proper location. Fixes Res…
JacobPease Mar 9, 2026
faab640
feat: Skeleton Trigger Module to fix testvector mismatches.
JacobPease Mar 11, 2026
9dda4ca
fix: DPC now points to next instruction for steps and to the address …
JacobPease Mar 12, 2026
8a35ecb
fix: Removed DPC reading after reset halt, preventing testvector mism…
JacobPease Mar 12, 2026
89d5387
chore: added stepping through branching test.
JacobPease Mar 14, 2026
a7de902
fix: stepping works through branches now, though there appears to be …
JacobPease Mar 14, 2026
1bc7a44
fix: stepping now halts on branch instructions. Now to grab the right…
JacobPease Mar 14, 2026
4427a3c
fix: DPC now points to destination address on Branches and Jumps when…
JacobPease Mar 17, 2026
637d204
cleanup of input/output
stineje Mar 18, 2026
e89b2da
fix: Fixed mismatched width in csrd.sv. Also added a stepping through…
JacobPease Mar 18, 2026
9114f1a
Merge branch 'debug' of github.com:JacobPease/cvw into debug
JacobPease Mar 18, 2026
6566c4c
add headers for Python debug programs
stineje Mar 18, 2026
81cd259
fix: DPC now uses NextValidPCE. Also, a variety of fixes and cleanup …
JacobPease Mar 24, 2026
5fe1c9f
update 'Putting it All Together' tests and associated tcl commands
stineje Mar 26, 2026
9d115d9
update 'Putting it All Together' tests and associated tcl commands
stineje Mar 26, 2026
1a7513b
delete tv
stineje Mar 26, 2026
20a86b6
update tests.vh
stineje Mar 26, 2026
f85d2da
fix WALLY-debug-ex3
stineje Mar 26, 2026
2946c6c
update README.md with repo for openocd + some extra info
stineje Mar 27, 2026
b3b4460
update README.md with repo for openocd + some extra info
stineje Mar 27, 2026
ab43036
update README.md with repo for openocd + some extra info
stineje Mar 27, 2026
99b7952
feat: Abstract Read command reads more CSRs. Needs counter csrs still…
JacobPease Apr 9, 2026
504c016
update comment header on ex?.S
stineje Apr 10, 2026
6af0b6e
fix: Trigger module signal fixed. No longer drives IllegalCSRAccessM …
JacobPease Apr 15, 2026
51dfa37
Merge branch 'debug' of github.com:JacobPease/cvw into debug
JacobPease Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/derivlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ EXT_MEM_RANGE 64'h7FFFFFFF
SDC_SUPPORTED 1
PLIC_SDC_ID 32'd20
BPRED_SIZE 32'd12
DEBUG_SUPPORTED 1

# RV32GC with Debug Mode supported
deriv debug32 rv32gc
DEBUG_SUPPORTED 1

# RV64GC with Debug Mode supported
deriv debug64 rv64gc
DEBUG_SUPPORTED 1

deriv fpgaArtyA7 fpga
EXT_MEM_RANGE 64'h0FFFFFFF
Expand Down
3 changes: 3 additions & 0 deletions config/rv32e/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,7 @@ localparam DIVCOPIES = 32'd4;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
3 changes: 3 additions & 0 deletions config/rv32gc/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,7 @@ localparam DIVCOPIES = 32'd2;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
3 changes: 3 additions & 0 deletions config/rv32i/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,7 @@ localparam DIVCOPIES = 32'd4;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
3 changes: 3 additions & 0 deletions config/rv32imc/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,7 @@ localparam DIVCOPIES = 32'd4;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
3 changes: 3 additions & 0 deletions config/rv64gc/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@ localparam DIVCOPIES = 32'd4;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
3 changes: 3 additions & 0 deletions config/rv64i/config.vh
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,7 @@ localparam DIVCOPIES = 32'd4;
// Memory synthesis configuration
localparam logic USE_SRAM = 0;

// Debug
localparam logic DEBUG_SUPPORTED = 0;

`include "config-shared.vh"
4 changes: 4 additions & 0 deletions config/shared/config-shared.vh
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ localparam FMALEN = 3*NF + 6;
localparam NORMSHIFTSZ = `max(`max((CVTLEN+NF+1), (DIVb + 1 + NF + 1)), (FMALEN + 2));

localparam LOGNORMSHIFTSZ = ($clog2(NORMSHIFTSZ)); // log_2(NORMSHIFTSZ)

// Debug Specification (if enabled)
localparam ABITS = 6'd7;
localparam DTM_INSTR_WIDTH = 32'd5;
5 changes: 4 additions & 1 deletion config/shared/parameter-defs.vh
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,8 @@ localparam cvw_t P = '{
DURLEN : DURLEN,
DIVb : DIVb,
DIVBLEN : DIVBLEN,
INTDIVb : INTDIVb
INTDIVb : INTDIVb,
DEBUG_SUPPORTED : DEBUG_SUPPORTED,
ABITS : ABITS,
DTM_INSTR_WIDTH : DTM_INSTR_WIDTH
};
10 changes: 10 additions & 0 deletions docs/debug/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Wally Debug List

It is our hope that we will get to many of these items for Wally with
the RISC-V Debug specification. We have posted a MarkDown file that lists
the capabilities we have implemented including the items we hope to
implement soon.

### Supported RISC-V Debug Specification
We are currently using the Debug specification with
Version 1.0, Revised 2025-02-21
99 changes: 99 additions & 0 deletions docs/debug/wallydebug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Wally Debug Feature List

:x: means we currently have no intention of implementing this feature.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to - for not planned
indicate x means done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level comment that debugger halts pipeline and takes abstract commands.
Indicate that "Minimal Debug Spec" is implemented with just abstract read/write of GPRs, FPRs, almost all CSRs (which ones not?

🔶 means we intend to implement this in the future at some point but it is not immediately imperative.

Anything else is intended to be implemented and will be implemented as soon as possible.

General Overview of Implemented Features:
- [x] Halting and Resuming
- [x] Abstract GPR read and write access.
- [x] Abstract CSR read and write access.
- [ ] Stepping
- [x] Resetting from Debug Module
- [x] Halt on Reset
- [ ] Trigger Modules 🔶
- [ ] Program buffer 🔶
- [ ] System bus access 🔶

DTM Registers
- [x] idcode
- [x] dtmcs
- [x] dmi

Debug Module
- [x] DMControl
- [x] haltreq
- [x] resumereq
- [ ] hartreset
- [x] ackhavereset
- [ ] ackunavail :x:
- I can't imagine there's a scenario where the only hart that exists wouldn't be available, but I need to investigate further, just in case.
- [ ] hasel :x:
- By hardcoding this to `0` as well as the hardcoding `hartsello` and `hartselhi` to 0 indicates to the debugger that there is only one hart. If Wally becomes multicore, this will need to be expanded so that we can select many harts. For now, it's not important to implement.
- [ ] hartsello :x:
- [ ] hartselhi :x:
- [ ] setkeepalive
- [ ] clrkeepalive
- [x] setresethaltreq
- [x] clrresethaltreq
- [x] ndmreset
- [x] dmactive. Note: Partially implemented. It needs to actually block writes to other debug module registers when set low.
- [x] DMStatus
- [x] ndmresetpending
- [ ] stickyunavail 🔶
- [ ] impebreak 🔶
- [x] allhavereset
- [x] anyhavereset
- [x] allresumeack
- [x] anyresumeack
- [ ] allnonexistent
- [ ] anynonexistent
- [ ] allunavail :x:
- [ ] anyunavail :x:
- [x] allrunning
- [x] anyrunning
- [x] allhalted
- [x] anyhalted
- [ ] authenticated 🔶
- [ ] authbusy 🔶
- [ ] hasresethaltreq
- [ ] confstrptrvalid :x:
- [x] version
- [x] Command
- [x] AbstractCS
- [ ] progbufsize 🔶
- [ ] busy
- For clarification, abstract access are near immediate currently, so there are no busy cycles. This is subject to change.
- [ ] relaxedpriv 🔶
- [x] cmderr
- [x] datacount
- [x] Data0
- [x] Data1 (`if XLEN == 64`)
- [ ] HartInfo
- [ ] Hart Array Window Select
- [ ] Hart

Debug Extension
- [x] DCSR
- [x] Halting
- [x] Resuming
- [x] Version field
- [x] Halt cause updating
- [ ] Stepping
- [ ] Stepie 🔶
- This is for enabling interrupts during stepping. Not as important as implementing stepping itself for now.
- [ ] Ebreak to Debug mode in all modes
- [ ] Stop counters 🔶
- [ ] Stop time 🔶
- [ ] extcause :x:
- Can just be set to 0 for not being implemented and also stays 0 even if cetrig is implemented which is partly what it's needed for. All other values are reserved for future version of the RISCV debug spec.
- [ ] nmip 🔶
- [ ] prv
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three are important.

- [ ] mprven
- [ ] v 🔶
- [x] DPC
- [x] Grabs PC + 4 on Halt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or PC+2. Could get from the IFU PC logic.

- [ ] Resumes at DPC value on Resume

- [ ] Sdtrig 🔶
27 changes: 26 additions & 1 deletion fpga/constraints/constraints-ArtyA7.xdc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# mmcm_clkout0 is the clock output of the DDR3 memory interface / 4.
# This clock is not used by wally or the AHB Bus. However it is used by the AXI BUS on the DD3 IP.

#set_property DONT_TOUCH true [get_nets wallypipelinedsoc/uncoregen.uncore/sdc.sdc/SPICLK]

#create_generated_clock -name CLKDiv64_Gen -source [get_pins wallypipelinedsoc/uncore.uncore/sdc.SDC/sd_top/slow_clk_divider/clkMux/I0] -multiply_by 1 -divide_by 1 [get_pins wallypipelinedsoc/uncore.uncore/sdc.SDC/sd_top/slow_clk_divider/clkMux/O]
create_generated_clock -name SPISDCClock -source [get_pins mmcm/clk_out3] -multiply_by 1 -divide_by 1 [get_pins wallypipelinedsoc/uncoregen.uncore/sdc.sdc/SPICLK]
create_generated_clock -name SPISDCClock -source [get_pins mmcm/clk_out3] -multiply_by 1 -divide_by 1 [get_pins wallypipelinedsoc/uncoregen.uncore/sdc.sdc/SPICLK_reg]
create_clock -add -name tck_pin -period 1000 -waveform {0 500} [get_ports {tck}];
#set_clock_groups -asynchronous -group [get_clock ] -group [get_clocks tck_pin]

##### clock #####
set_property PACKAGE_PIN E3 [get_ports default_100mhz_clk]
Expand Down Expand Up @@ -164,6 +168,27 @@ set_output_delay -clock [get_clocks SPISDCClock] 0.000 [get_ports SDCCLK]

set_max_delay -datapath_only -from [get_pins xlnx_ddr3_c0/u_xlnx_ddr3_mig/u_memc_ui_top_axi/mem_intfc0/ddr_phy_top0/u_ddr_calib_top/init_calib_complete_reg/C] -to [get_pins xlnx_proc_sys_reset_0/U0/EXT_LPF/lpf_int_reg/D] 20.000

######################################################################
# JTAG Port
######################################################################
set_property -dict { PACKAGE_PIN G13 IOSTANDARD LVCMOS33 } [get_ports { tck }]; #IO_0_15 Sch=ja[1]
set_property -dict { PACKAGE_PIN B11 IOSTANDARD LVCMOS33 } [get_ports { tdo }]; #IO_L4P_T0_15 Sch=ja[2]
set_property -dict { PACKAGE_PIN A11 IOSTANDARD LVCMOS33 } [get_ports { tms }]; #IO_L4N_T0_15 Sch=ja[3]
set_property -dict { PACKAGE_PIN D12 IOSTANDARD LVCMOS33 } [get_ports { tdi }]; #IO_L6P_T0_15 Sch=ja[4]
#set_property -dict { PACKAGE_PIN D13 IOSTANDARD LVCMOS33 } [get_ports { trst }]; #IO_L6N_T0_VREF_15 Sch=ja[7]
#set_property -dict { PACKAGE_PIN B18 IOSTANDARD LVCMOS33 } [get_ports { ja[8] }]; #IO_L10P_T1_AD11P_15 Sch=ja[8]
#set_property -dict { PACKAGE_PIN A18 IOSTANDARD LVCMOS33 } [get_ports { ja[9] }]; #IO_L10N_T1_AD11N_15 Sch=ja[9]
#set_property -dict { PACKAGE_PIN E15 IOSTANDARD LVCMOS33 } [get_ports { ja[10] }]; #IO_L11P_T1_SRCC_15 Sch=ja[10]

set_input_delay -clock [get_clocks tck_pin] -max 5.0 [get_ports {tms tdi}]
set_input_delay -clock [get_clocks tck_pin] -min 0.0 [get_ports {tms tdi}]

# Issue with tck and implementation - seems to fix (jes)
# Issue related to JTAG tck treating it as a global clock
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets tck_IBUF]
set_false_path -from [get_clocks tck_pin] -to [get_clocks -of_objects [get_pins mmcm/inst/mmcm_adv_inst/CLKOUT2]]
set_false_path -from [get_clocks -of_objects [get_pins mmcm/inst/mmcm_adv_inst/CLKOUT2]] -to [get_clocks tck_pin]

# *********************************
#set_property DCI_CASCADE {64} [get_iobanks 65]
#set_property INTERNAL_VREF 0.9 [get_iobanks 65]
Expand Down
10 changes: 8 additions & 2 deletions fpga/src/fpgaTopArtyA7.sv
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ module fpgaTop #(parameter logic RVVI_SYNTH_SUPPORTED = 0)
output logic [0:0] ddr3_cke,
output logic [0:0] ddr3_cs_n,
output logic [1:0] ddr3_dm,
output logic [0:0] ddr3_odt
output logic [0:0] ddr3_odt,

input logic tck,
input logic tms,
input logic tdi,
output logic tdo
);

// MMCM Signals
Expand Down Expand Up @@ -258,7 +263,8 @@ module fpgaTop #(parameter logic RVVI_SYNTH_SUPPORTED = 0)
.HADDR, .HWDATA, .HWSTRB, .HWRITE, .HSIZE, .HBURST, .HPROT,
.HTRANS, .HMASTLOCK, .HREADY, .TIMECLK(1'b0),
.GPIOIN, .GPIOOUT, .GPIOEN,
.UARTSin, .UARTSout, .SDCIn, .SDCCmd, .SDCCS(SDCCSin), .SDCCLK, .ExternalStall(RVVIStall));
.UARTSin, .UARTSout, .SDCIn, .SDCCmd, .SDCCS(SDCCSin), .SDCCLK, .ExternalStall(RVVIStall),
.tck, .tms, .tdi, .tdo);


// ahb lite to axi bridge
Expand Down
59 changes: 59 additions & 0 deletions sim/questa/wave.do
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ quietly WaveActivateNextPane {} 0
add wave -noupdate /testbench/clk
add wave -noupdate /testbench/reset
add wave -noupdate /testbench/memfilename
add wave -noupdate /testbench/debugger_filename
add wave -noupdate /testbench/dut/core/SATP_REGW
add wave -noupdate /testbench/dut/core/InstrValidM
add wave -noupdate -group HDU -expand -group hazards /testbench/dut/core/hzu/RetM
Expand Down Expand Up @@ -677,6 +678,64 @@ add wave -noupdate /testbench/dut/core/ifu/bus/icache/icache/cachefsm/CacheEn
add wave -noupdate /testbench/dut/core/ifu/bus/icache/icache/cachefsm/FlushStage
add wave -noupdate /testbench/dut/core/lsu/bus/dcache/dcache/vict/cacheLRU/LRUWriteEn
add wave -noupdate /testbench/dut/core/lsu/bus/dcache/dcache/vict/cacheLRU/FlushStage
add wave -noupdate -group Debug -expand -group jtag /testbench/dut/debug/dtm/tck
add wave -noupdate -group Debug -expand -group jtag /testbench/dut/debug/dtm/tms
add wave -noupdate -group Debug -expand -group jtag /testbench/dut/debug/dtm/tdi
add wave -noupdate -group Debug -expand -group jtag /testbench/dut/debug/dtm/tdo
add wave -noupdate -group Debug -expand -group dtm /testbench/dut/debug/dtm/DMIADDR
add wave -noupdate -group Debug -expand -group dtm /testbench/dut/debug/dtm/DMIDATA
add wave -noupdate -group Debug -expand -group dtm /testbench/dut/debug/dtm/DMIOP
add wave -noupdate -group Debug -expand -group dtm /testbench/dut/debug/dtm/DMIREADY
add wave -noupdate -group Debug -expand -group dtm /testbench/dut/debug/dtm/DMIVALID
add wave -noupdate -group Debug -expand -group dtm -group {registers} /testbench/dut/debug/dtm/currentInst
add wave -noupdate -group Debug -expand -group dtm -group {registers} /testbench/dut/debug/dtm/dmi
add wave -noupdate -group Debug -expand -group dtm -group {registers} /testbench/dut/debug/dtm/dtmcs
add wave -noupdate -group Debug -expand -group dm /testbench/dut/debug/debug/DMIRSPDATA
add wave -noupdate -group Debug -expand -group dm /testbench/dut/debug/debug/DMIRSPOP
add wave -noupdate -group Debug -expand -group dm /testbench/dut/debug/debug/DMIRSPREADY
add wave -noupdate -group Debug -expand -group dm /testbench/dut/debug/debug/DMIRSPVALID
add wave -noupdate -group Debug -expand -group dm /testbench/dut/debug/debug/NDMReset
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/DMControl
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/DMStatus
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/Data0
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/Data1
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/AbstractCS
add wave -noupdate -group Debug -expand -group dm -group {Debug Registers} /testbench/dut/debug/debug/Command
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/cause
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/HaltReq
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/ResumeReq
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/DebugMode
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/ResumeReq
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/ResetHaltReq
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/DPC_REGW
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/DCSR_REGW
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/DPCset
add wave -noupdate -group Debug -expand -group csrd /testbench/dut/core/priv/priv/csr/debug/csrd/DebugResume
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/StartCommand
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/ValidCommand
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/ValidSize
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/GPRDebugEnable
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/CSRDebugEnable
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/FPRDebugEnable
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugMode
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugControl
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugRegRDATA
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugRegWDATA
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugRegAddr
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/debug/debug/DebugRegWrite
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/debug.csrd/CSRDReadValM
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/debug.csrd/CSRDWriteM
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/debug.csrd/HaveReset
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/debug.csrd/HaveResetAck
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/CSRAdrM
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/CSRReadValM
add wave -noupdate -group Debug -expand -group abstract /testbench/dut/core/priv/priv/csr/CSRWriteValM






TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 4} {89834 ns} 1} {{Cursor 4} {79055 ns} 1} {{Cursor 3} {89604 ns} 0}
quietly wave cursor active 3
Expand Down
6 changes: 6 additions & 0 deletions src/cvw.sv
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ typedef struct packed {
int DIVBLEN ;
// integer division/remainder constants
int INTDIVb ;

// Debug Specification Variables
logic DEBUG_SUPPORTED;
logic [5:0] ABITS;
int DTM_INSTR_WIDTH;

} cvw_t;

endpackage
Expand Down
48 changes: 48 additions & 0 deletions src/debug/bsr.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
///////////////////////////////////////////
// bsr.sv
//
// Written: Jacob Pease jacobpease@protonmail.com,
// James E. Stine james.stine@okstate.edu
// Created: August 4th, 2025
// Modified:
//
// Purpose: Boundary Scan Register with load on reset
//
// A component of the CORE-V-WALLY configurable RISC-V project.
// https://github.com/openhwgroup/cvw
//
// Copyright (C) 2021-25 Harvey Mudd College & Oklahoma State University
//
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
//
// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file
// except in compliance with the License, or, at your option, the Apache License version 2.0. You
// may obtain a copy of the License at
//
// https://solderpad.org/licenses/SHL-2.1/
//
// Unless required by applicable law or agreed to in writing, any work distributed under the
// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
////////////////////////////////////////////////////////////////////////////////////////////////

module bsr #(parameter WIDTH=8) (
input logic [WIDTH-1:0] DataIn,
input logic ScanIn,
input logic ShiftDR, ClockDR, UpdateDR, Mode,
output logic [WIDTH-1:0] Qout,
output logic ScanOut
);
logic [WIDTH-1:0] shiftreg;
logic [WIDTH-1:0] y;

always @(posedge ClockDR)
shiftreg <= ShiftDR ? {ScanIn, shiftreg[WIDTH-1:1]} : DataIn;

always @(posedge UpdateDR)
y <= shiftreg;

assign Qout = Mode ? y : DataIn;
assign ScanOut = shiftreg[0];
endmodule // bsr
Loading