New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verilator generating incorrect instructions #13134
Comments
I see this for a range of other instructions as well, for example
becomes
When run on Verilator and
becomes
but only if I make PMP changes, otherwise it's
|
@arunthomas not sure how we should tag this issue. |
It seems related to ePMP. It seems to happen after changing some ePMP addresses, even if the instructions are still in the allowed read/write/exec region by the new PMP configs. I also see similar failures on the FPGA, so it doesn't seem to be completely isolated to Verilator. |
@cfrantz was planning to look into the Tock ePMP issues |
Is this bug still present? |
CC @GregAC |
I believe this is a flaw in the way our instruction tracer works. It uses the RVFI interface to observe retired instructions and when one sees an exception we prevent it from writing to the register file, which on the RVFI interface just means setting the write register to 0. Hence in this case with the faulting load it reports as a load to x0 rather than x10. So no instruction memory changes or other faults in instruction memory read happening here, just an awkward instruction trace. I'll file an issue in Ibex to note we should improve it but it's not a high priority |
Ibex issue here: lowRISC/ibex#2099 and closing this issue |
I'm seeing failures when running Tock on the latest-ish (c83a36c) Verilator build.
When setting the PMP configuration there is a code segment like this:
Looking at the Verilator instruction log, I can see that the first 31 times this is run it looks like this:
Then on the 32nd time I see this
Notice that the instruction decoding at address
0x2001572e
changes fromc.lw x10,0(x10)
toc.lw x0,0(x10)
which generates a fault and the next instruction is the trap handlerIt doesn't look like the instruction in memory has changed, it's always
0x4108
, just the decoding has changed. The failure seems to be related to enabling ePMP and the MML bit as well, although the area in memory is accessibleThe text was updated successfully, but these errors were encountered: