aboutsummaryrefslogtreecommitdiff
path: root/spike_main
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-04-02 11:05:19 -0700
committerGitHub <noreply@github.com>2019-04-02 11:05:19 -0700
commit3e79495c38bf58df9c7b389205032b2eb3f45fb7 (patch)
tree4f14f114747d367e7d34e8edadd2f3597cae07a5 /spike_main
parent994c07cb23dfd9f85d5e6d92aeeaece58bbb4183 (diff)
downloadspike-3e79495c38bf58df9c7b389205032b2eb3f45fb7.zip
spike-3e79495c38bf58df9c7b389205032b2eb3f45fb7.tar.gz
spike-3e79495c38bf58df9c7b389205032b2eb3f45fb7.tar.bz2
Implement debug hasel support (#287)
* 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.
Diffstat (limited to 'spike_main')
-rw-r--r--spike_main/spike.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/spike_main/spike.cc b/spike_main/spike.cc
index 6d8d88a..2bf8d28 100644
--- a/spike_main/spike.cc
+++ b/spike_main/spike.cc
@@ -48,6 +48,7 @@ static void help(int exit_code = 1)
"required for a DMI access [default 0]\n");
fprintf(stderr, " --abstract-rti=<n> Number of Run-Test/Idle cycles "
"required for an abstract command to execute [default 0]\n");
+ fprintf(stderr, " --without-hasel Debug module supports hasel\n");
exit(exit_code);
}
@@ -113,6 +114,7 @@ int main(int argc, char** argv)
bool require_authentication = false;
unsigned dmi_rti = 0;
unsigned abstract_rti = 0;
+ bool support_hasel = true;
std::vector<int> hartids;
auto const hartids_parser = [&](const char *s) {
@@ -164,6 +166,8 @@ int main(int argc, char** argv)
[&](const char* s){dmi_rti = atoi(s);});
parser.option(0, "abstract-rti", 1,
[&](const char* s){abstract_rti = atoi(s);});
+ parser.option(0, "without-hasel", 0,
+ [&](const char* s){support_hasel = false;});
auto argv1 = parser.parse(argv);
std::vector<std::string> htif_args(argv1, (const char*const*)argv + argc);
@@ -175,7 +179,7 @@ int main(int argc, char** argv)
sim_t s(isa, nprocs, halted, start_pc, mems, htif_args, std::move(hartids),
progsize, max_bus_master_bits, require_authentication,
- abstract_rti);
+ abstract_rti, support_hasel);
std::unique_ptr<remote_bitbang_t> remote_bitbang((remote_bitbang_t *) NULL);
std::unique_ptr<jtag_dtm_t> jtag_dtm(
new jtag_dtm_t(&s.debug_module, dmi_rti));