From ee2ba564231918897987c0b7db531026627ae82f Mon Sep 17 00:00:00 2001 From: Toby Jaffey Date: Mon, 8 Dec 2025 20:36:00 +0000 Subject: [PATCH] Add cmdline option to host [max_instrs_to_run], to set instruction meter. Allow a host to continue after a hung error, if it wants to. So, a program with while(1) {} can be run indefinitely. --- uvm32/uvm32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uvm32/uvm32.c b/uvm32/uvm32.c index 2443b6b..689a8d5 100644 --- a/uvm32/uvm32.c +++ b/uvm32/uvm32.c @@ -103,7 +103,12 @@ static void get_safeptr(uvm32_state_t *vmst, uint32_t addr, uint32_t len, uvm32_ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter) { uint32_t num_instr = 0; -// uvm32_evt_syscall_buf_t b; + + if (vmst->status == UVM32_STATUS_ERROR) { + // vm is in an error state, but user wants to continue + // most likely after UVM32_ERR_HUNG + vmst->status = UVM32_STATUS_PAUSED; + } if (vmst->status != UVM32_STATUS_PAUSED) { setStatusErr(vmst, UVM32_ERR_NOTREADY);