Add cmdline option to host <file.bin> [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.
This commit is contained in:
Toby Jaffey 2025-12-08 20:36:00 +00:00
parent bbf5ccafb6
commit ee2ba56423

View file

@ -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 uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter) {
uint32_t num_instr = 0; 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) { if (vmst->status != UVM32_STATUS_PAUSED) {
setStatusErr(vmst, UVM32_ERR_NOTREADY); setStatusErr(vmst, UVM32_ERR_NOTREADY);