diff --git a/precompiled/self.bin b/precompiled/self.bin index 9c5e19c..b59ef39 100755 Binary files a/precompiled/self.bin and b/precompiled/self.bin differ diff --git a/uvm32/mini-rv32ima.h b/uvm32/mini-rv32ima.h index d063c89..f437550 100644 --- a/uvm32/mini-rv32ima.h +++ b/uvm32/mini-rv32ima.h @@ -103,7 +103,11 @@ struct MiniRV32IMAState }; #ifndef MINIRV32_STEPPROTO -MINIRV32_DECORATE int32_t MiniRV32IMAStep(void *userdata, struct MiniRV32IMAState * state, uint8_t * image, uint32_t vProcAddress, uint32_t elapsedUs, int count ); +MINIRV32_DECORATE int32_t MiniRV32IMAStep(void *userdata, struct MiniRV32IMAState * state, uint8_t * image, uint32_t vProcAddress, +#ifndef MINIRV32_NO_TIMERS_NO_CYCLES +uint32_t elapsedUs, +#endif +int count ); #endif #ifdef MINIRV32_IMPLEMENTATION @@ -116,7 +120,11 @@ MINIRV32_DECORATE int32_t MiniRV32IMAStep(void *userdata, struct MiniRV32IMAStat #endif #ifndef MINIRV32_STEPPROTO -MINIRV32_DECORATE int32_t MiniRV32IMAStep(void *userdata, struct MiniRV32IMAState * state, uint8_t * image, uint32_t vProcAddress, uint32_t elapsedUs, int count ) +MINIRV32_DECORATE int32_t MiniRV32IMAStep(void *userdata, struct MiniRV32IMAState * state, uint8_t * image, uint32_t vProcAddress, +#ifndef MINIRV32_NO_TIMERS_NO_CYCLES +uint32_t elapsedUs, +#endif +int count ) #else MINIRV32_STEPPROTO #endif @@ -436,6 +444,7 @@ MINIRV32_STEPPROTO case 0: trap = ( CSR( extraflags ) & 3) ? (11+1) : (8+1); // ECALL; 8 = "Environment call from U-mode"; 11 = "Environment call from M-mode" break; +#ifndef MINIRV32_NO_BREAKPOINT_NO_INTERRUPTS case 1: trap = (3+1); break; // EBREAK 3 = "Breakpoint" case 0x105: //WFI (Wait for interrupts) @@ -443,6 +452,7 @@ MINIRV32_STEPPROTO CSR( extraflags ) |= 4; //Infor environment we want to go to sleep. SETCSR( pc, pc + 4 ); return 1; +#endif default: trap = (2+1); break; // Illegal opcode. } diff --git a/uvm32/uvm32.c b/uvm32/uvm32.c index 8766213..7b982e4 100644 --- a/uvm32/uvm32.c +++ b/uvm32/uvm32.c @@ -254,7 +254,7 @@ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter) while(vmst->_status == UVM32_STATUS_RUNNING && instr_meter > 0) { uint64_t elapsedUs = 1; uint32_t ret; - ret = MiniRV32IMAStep(vmst, &vmst->_core, vmst->_memory, 0, elapsedUs, 1); + ret = MiniRV32IMAStep(vmst, &vmst->_core, vmst->_memory, elapsedUs, 1); instr_meter--; switch(ret) { diff --git a/uvm32/uvm32.h b/uvm32/uvm32.h index 0f8b323..e33613b 100644 --- a/uvm32/uvm32.h +++ b/uvm32/uvm32.h @@ -44,6 +44,7 @@ SOFTWARE. #define MINIRV32_NO_TIMERS_NO_CYCLES #define MINIRV32_NO_ZICSR #define MINIRV32_NO_ATOMICS +#define MINIRV32_NO_BREAKPOINT_NO_INTERRUPTS #define MINI_RV32_RAM_SIZE UVM32_MEMORY_SIZE #define MINIRV32_POSTEXEC(pc, ir, retval) {if (retval > 0) return retval;} uint32_t _uvm32_extramLoad(void *userdata, uint32_t addr, uint32_t accessTyp);