diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-04-06 10:07:02 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-04-06 10:08:31 -0700 |
commit | 1767a27ad4cf8f9eb1a30d9d9a2495477071339f (patch) | |
tree | b3392024b9b8f1fb953e836583be181bb9984c18 | |
parent | 4b1597498d9f2eed20019b45e839f6971bb38d37 (diff) | |
download | riscv-isa-sim-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.zip riscv-isa-sim-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.tar.gz riscv-isa-sim-1767a27ad4cf8f9eb1a30d9d9a2495477071339f.tar.bz2 |
Tick devices even when tohost != 0
Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84
Resolves #964
-rw-r--r-- | fesvr/htif.cc | 19 |
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 { |