diff options
author | Andrew Waterman <andrew@sifive.com> | 2020-03-29 16:17:53 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2020-04-05 22:40:13 -0700 |
commit | 05bc9c016c709374ab1a6d8518220020e60004d6 (patch) | |
tree | bbf5b77959751fe3640947a0cb96a73ce7ef00b4 /fesvr | |
parent | 049ff59a36fc8ca4adaa928adb4b696c6d8bf114 (diff) | |
download | spike-05bc9c016c709374ab1a6d8518220020e60004d6.zip spike-05bc9c016c709374ab1a6d8518220020e60004d6.tar.gz spike-05bc9c016c709374ab1a6d8518220020e60004d6.tar.bz2 |
When enabling the debug module, poll til it's really enabled
Resolves #435
Diffstat (limited to 'fesvr')
-rw-r--r-- | fesvr/dtm.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fesvr/dtm.cc b/fesvr/dtm.cc index 6e4952f..993011d 100644 --- a/fesvr/dtm.cc +++ b/fesvr/dtm.cc @@ -560,6 +560,8 @@ void dtm_t::producer_thread() // Enable the debugger. write(DMI_DMCONTROL, DMI_DMCONTROL_DMACTIVE); + // Poll until the debugger agrees it's enabled. + while ((read(DMI_DMCONTROL) & DMI_DMCONTROL_DMACTIVE) == 0) ; // These are checked every time we run an abstract command. uint32_t abstractcs = read(DMI_ABSTRACTCS); |