From 1767a27ad4cf8f9eb1a30d9d9a2495477071339f Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 6 Apr 2022 10:07:02 -0700 Subject: Tick devices even when tohost != 0 Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84 Resolves #964 --- fesvr/htif.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'fesvr') 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 { -- cgit v1.1