aboutsummaryrefslogtreecommitdiff
path: root/fesvr
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2022-04-06 10:07:02 -0700
committerAndrew Waterman <andrew@sifive.com>2022-04-06 10:08:31 -0700
commit1767a27ad4cf8f9eb1a30d9d9a2495477071339f (patch)
treeb3392024b9b8f1fb953e836583be181bb9984c18 /fesvr
parent4b1597498d9f2eed20019b45e839f6971bb38d37 (diff)
downloadspike-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.zip
spike-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.tar.gz
spike-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.tar.bz2
Tick devices even when tohost != 0
Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84 Resolves #964
Diffstat (limited to 'fesvr')
-rw-r--r--fesvr/htif.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/fesvr/htif.cc b/fesvr/htif.cc
index f81878d..ead309c 100644
--- a/fesvr/htif.cc
+++ b/fesvr/htif.cc
@@ -241,18 +241,19 @@ int htif_t::run()
bad_address("accessing tohost", t.get_tval());
}
- if (tohost != 0) {
- try {
+ try {
+ if (tohost != 0) {
command_t cmd(mem, tohost, fromhost_callback);
device_list.handle_command(cmd);
- device_list.tick();
- } catch (mem_trap_t& t) {
- std::stringstream tohost_hex;
- tohost_hex << std::hex << tohost;
- bad_address("host was accessing memory on behalf of target (tohost = 0x" + tohost_hex.str() + ")", t.get_tval());
+ } else {
+ idle();
}
- } else {
- idle();
+
+ device_list.tick();
+ } catch (mem_trap_t& t) {
+ std::stringstream tohost_hex;
+ tohost_hex << std::hex << tohost;
+ bad_address("host was accessing memory on behalf of target (tohost = 0x" + tohost_hex.str() + ")", t.get_tval());
}
try {