VexRiscv
VexRiscv copied to clipboard
Exit cycle accurate simulation
Hi,
Is there a way to exit the verilator simulation from the C code whose hex is getting executed using RUN_HEX. For some reason, certain C codes are exiting but others are not. I do not know the exact reason why it executes all instructions and gets stuck at the end of main. By default (hello_world), it falls in infinite loop. But on changing crt.S to include
li x2, 0xF00FFF20
sw x0, 0(x2)
few codes come out of simulation, printing cycles. But as I mentioned this fix didn't work for certain C codes. Is there a way to exit simulation through C code?
Thank you