aboutsummaryrefslogtreecommitdiff
path: root/fesvr
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2020-02-11 12:35:51 -0800
committerChih-Min Chao <chihmin.chao@sifive.com>2020-04-05 22:39:46 -0700
commit049ff59a36fc8ca4adaa928adb4b696c6d8bf114 (patch)
treef495278e6fefb550a609aa7a7e6fa0a3fd19b4f3 /fesvr
parent414cf9ae675e5c437528abfcb758f1b127d86dce (diff)
downloadspike-049ff59a36fc8ca4adaa928adb4b696c6d8bf114.zip
spike-049ff59a36fc8ca4adaa928adb4b696c6d8bf114.tar.gz
spike-049ff59a36fc8ca4adaa928adb4b696c6d8bf114.tar.bz2
FESVR: ensure dmactive is 1 before reading debug module registers
Diffstat (limited to 'fesvr')
-rw-r--r--fesvr/dtm.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/fesvr/dtm.cc b/fesvr/dtm.cc
index 46032c3..6e4952f 100644
--- a/fesvr/dtm.cc
+++ b/fesvr/dtm.cc
@@ -558,6 +558,9 @@ void dtm_t::producer_thread()
// Learn about the Debug Module and assert things we
// depend on in this code.
+ // Enable the debugger.
+ write(DMI_DMCONTROL, DMI_DMCONTROL_DMACTIVE);
+
// These are checked every time we run an abstract command.
uint32_t abstractcs = read(DMI_ABSTRACTCS);
ram_words = get_field(abstractcs, DMI_ABSTRACTCS_PROGSIZE);
@@ -571,9 +574,6 @@ void dtm_t::producer_thread()
assert(get_field(hartinfo, DMI_HARTINFO_DATAACCESS));
data_base = get_field(hartinfo, DMI_HARTINFO_DATAADDR);
-
- // Enable the debugger.
- write(DMI_DMCONTROL, DMI_DMCONTROL_DMACTIVE);
num_harts = enumerate_harts();
halt(0);