aboutsummaryrefslogtreecommitdiff
path: root/riscv/debug_module.cc
AgeCommit message (Collapse)AuthorFilesLines
2024-10-02fix typosYang Hau1-2/+2
2023-12-08Remove cfg_arg_t from cfg_tJerry Zhao1-3/+3
Argument parsing should be scoped to the code which constucts cfg_t
2023-12-01Add SBA write delay.Tim Newsome1-6/+25
This is helpful to test OpenOCD behavior when sbbusyerror is set.
2023-12-01Add SBA read delay.Tim Newsome1-31/+87
This is helpful to test OpenOCD behavior when sbbusyerror is set.
2023-09-28debug: Abstract commands fail on unavailable harts.Tim Newsome1-0/+4
2023-09-28debug: Halted harts can also be unavailable.Tim Newsome1-5/+5
2023-07-05Let debugger control hart availabilityTim Newsome1-8/+37
This change lets me test OpenOCD's behavior when harts become available. It only affects how things look to the debugger. Harts that are "unavailable" still execute code as usual. Control is implemented through the 2 LSBs of the DMCUSTOM register in the Debug Module.
2023-06-21Merge pull request #1338 from aap-sc/aap-sc/sb_read_write_fixupAndrew Waterman1-12/+16
fixup sb_write/sb_read to handle exceptions
2023-06-20debug: Remove debug_module_t::add_device, its redundantJerry Zhao1-4/+0
2023-04-24fixup sb_write/sb_read to handle exceptions properlyParshintsev Anatoly1-12/+16
system bus read/write operations could lead to a variety of memory-related exceptions. Before this patch not every memory exception was handled. This could lead to simulator crashes: an example is when debugger (like OpenOCD) issues non-aligned memory read. Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
2023-03-09Switch debug_module to use simif_t instead of sim_tScott Johnson1-2/+3
In keeping with the spirit of simif_t.
2023-02-27Make debug module tolerant of discontiguous hart IDsAndrew Waterman1-76/+56
The general strategy is to avoid iterating over the ID space.
2022-12-15Print better error message when requesting >1024 hartsAndrew Waterman1-1/+6
The debug module imposes this restriction and was enforcing it with an assertion. But assertions should be used for internal checks only, not for input validation.
2022-10-19Template-ize storesAndrew Waterman1-4/+4
2022-10-19Template-ize loadsAndrew Waterman1-4/+4
2022-10-07Add --dm-no-abstract-fpr option.Tim Newsome1-1/+1
Previously FPRs could always be accessed using abstract commands. I need this to get coverage of some OpenOCD code that I broke. (See https://github.com/riscv/riscv-openocd/pull/745)
2022-08-10Add space between if/while/switch and '('Weiwei Li1-1/+1
Add space between ')' and '{'
2022-08-10Fix code indentation in processor.cc, interactive.cc, debug_module.h/ccWeiwei Li1-29/+29
execute.cc, entropy_source.h and v_ext_macros.h
2022-07-25Pay attention to dmcs2.grouptype. (#1049)Tim Newsome1-1/+3
2022-03-07Update debug_defines.h (#942)Tim Newsome1-116/+116
I'll need it for some trigger work.
2022-01-09Changes to be cleaner wrt. -WextraAndrew Waterman1-5/+5
h/t @jerinjoy See #901
2022-01-06Don't say "master" (#898)Tim Newsome1-14/+14
Requested by "LfX Security - Non Inclusive Language Alerts"
2021-08-03declare socket properties in sim_tElmar Melcher1-1/+1
2020-12-13Preserve abstract s0 write if progbuf excepts. (#615)Tim Newsome1-0/+11
When a single abstract command writes s0 and executes a program buffer that leads to an exception, the value of s0 should still persist. The fact that it did not masked the following bug in OpenOCD: https://github.com/riscv/riscv-openocd/issues/559
2020-08-20Fix debug tests failing with impebreak enabled. (#530)Tim Newsome1-1/+1
Introduced in #527.
2020-08-11Add option to dissable implicit ebreak in program bufferSamuel Obuch1-6/+9
2020-05-26Report haltgroup halt cause, per the debug spec. (#473)Tim Newsome1-3/+3
2020-04-09op: update CSRChih-Min Chao1-6/+6
1. add new hypervisor csr 2. add debug module csr 3. add some new high part register for rv32 Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2020-03-30Assert that debug_module is initialized correctly. (#437)Tim Newsome1-0/+1
This would have prevented the regression in #409.
2020-03-05Make debug printfs only show in debug builds. (#414)Andrew Waterman1-6/+6
2020-02-21Initialize some uninitialized stateAndrew Waterman1-1/+2
2019-07-16Writing non-existent CSRs, access FPRs with mstatus.FS=0 (#311)Tim Newsome1-2/+32
* Don't corrupt s0 when abstract CSR write fails. * Support abstract FPR access then mstatus.FS=0 Discussion on the spec list leans towards this being a requirement. Certainly users want their debugger to be able to access all registers regardless of target state.
2019-05-14Clean up debug module options. (#299)Tim Newsome1-38/+31
* Clean up debug module options. 1. Instead of passing each one a few levels deep, create debug_module_config_t which contains them all. 2. Rename all those command line options so they start with --dm for debug module. 3. Add --dm-no-halt-groups to disable halt group support. * Update changelog.
2019-04-04Add --debug-no-abstract-csr (#267)Tim Newsome1-7/+4
This is used to make sure that OpenOCD can work on targets that don't support abstract access to CSR registers. It replaces a simpler hack, which caused #266.
2019-04-02Implement debug hasel support (#287)Tim Newsome1-60/+114
* Implement hasel/hawindow support. This should allow simultaneous resume and halt to work. * Fix anyrunning/anyhalted bits. * Add --without-hasel argument for testing. * Make halt/resume times more equal. Switching threads after every instruction executed in debug mode leads to a lot of extra instructions being executed on the "other" thread when both are really supposed to halt/resume near-simultaneously. Fixed that by adding wfi to debug_rom.S, and implementing it to switch to the other hart as well as check for JTAG input. When resuming, write the hart ID to the debug ROM so that the DM knows which hart actually resumed. (Before simultaneous resume it just assumed the current one.) Also got rid of resume symbol in debug_rom.S since it had no purpose. * Preserve Debug ROM entry points. * Make sure minstret is correct when wfi happens.
2019-03-04Implement halt groups (#280)Tim Newsome1-17/+59
* Update debug_defines from latest spec. * Implement halt groups. This lets the debugger halt multiple harts near simultaneously. * Revert encoding, which I updated accidentally.
2019-01-09Merge pull request #265 from riscv/debug_testTim Newsome1-2/+15
Add --dmi-rti and --abstract-rti to test OpenOCD.
2018-12-13Add --dmi-rti and --abstract-rti to test OpenOCD.Tim Newsome1-2/+15
Optionally make spike behave more like real hardware, to automatically test OpenOCD's handling of such hardware.
2018-12-03Correct address autoincrement calls. (#263)Tim Newsome1-2/+5
Now we do what the spec says we should do. This ended up not having any effect on the current way OpenOCD performs system bus accesses.
2018-09-05Fix cut-and-paste bug in 64-bit SBA loads.Tim Newsome1-1/+1
Fixes #234.
2018-08-23Add dummy custom debug registers, to test OpenOCD. (#233)Tim Newsome1-0/+15
2018-06-11Update debug_defines.hTim Newsome1-4/+7
Add support for hartselhi parsing, but other parts of the debug code still don't support more than 1024 harts.
2018-05-31Put simif_t declaration in its own file. (#209)Andy Wright1-0/+1
By separating the simif_t declaration from the sim_t declaration, the simif_t declaration no longer depends on fesvr header files. This simplifies compilation of custom sim class implementations that don't depend on fesvr.
2018-03-16Implement debug havereset bitsTim Newsome1-0/+14
2018-03-07Merge pull request #177 from riscv/debug_authTim Newsome1-2/+28
Add debug module authentication.
2018-03-06Fix install of a missed header from debug_rom.Prashanth Mundkur1-1/+1
The installed header files from the riscv subproject were incomplete, since processor.h includes debug_rom_defines.h, and the latter was not installed. Fix by moving it into riscv/, add it to the riscv subproject header list, which ensures it will get installed. While here, also add a missed dependency of debug_rom on riscv/encoding.h to debug_rom/Makefile.
2018-02-27Add debug module authentication.Tim Newsome1-2/+28
Off by default, enabled with --debug-auth. The protocol is very simple (definitely not secure) to allow debuggers to test their authentication feature. To authenticate a debugger must: 1. Read authdata 2. Write to authdata the value that it just read, plus 1
2018-02-19Passes smoke tests with --progsize=0Tim Newsome1-15/+82
2018-02-19WIP. Doesn't work.Tim Newsome1-39/+35
2018-02-01Add --debug-sba optionTim Newsome1-47/+38
This lets the user control whether the system bus access implements bus mastering.