-
Notifications
You must be signed in to change notification settings - Fork 547
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
Various DV fixes #2183
Various DV fixes #2183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sensible, but there are a couple of slight tidy-ups that I think are worth doing.
I also notice that Verible claims some over-long lines (not caused by this PR). Are you happy to address those in a separate PR?
Where an access is unaligned Ibex splits it into two transactions, each of which undergoes a PMP check. It is possible for the first half to fail a PMP check and the second to succeed and hence produce a request on the memory interface. In Spike it accesses memory byte by byte and if it encounters a PMP error for a particular byte it won't try any further bytes. This results in a mis-match between Ibex and spike when an unaligned transaction is split across two PMP regions, one of which allows the access and the other doesn't. Ibex generates a transaction and spike doesn't producing an error. This adds a fixup into the co-simulation environment. It detects when we have an access that fails PMP that is misaligned. Where this has resulted in Ibex producing a memory request that spike would not we remove it from the list of memory requests to check after checking that the request passes PMP within spike.
The 'pre_val' MIP addresses the scenario where MIP changes as an instruction is excuting, this means a CSR instruction can observe a different MIP from the one that decides whether or not that instruction will be interrupted.
The cosimulation environment does not know if a memory access from spike is due to an instruction fetch or a data memory access. It uses a heuristic to differentiate the two. Any access between the PC and the PC + 8 is considered an instruction fetch. This heuristic did not correctly handle addresses at the top of the range where the PC + 8 calculation overflows. This commit fixes the top of range handling.
When an interrupt is raised the Ibex controller will move from the DECODE state to the IRQ_TAKEN state when it chooses to handle the interrupt. When in IRQ_TAKEN it's possible for the interrupt state to change again which aborts the interrupt entry. This leads to mis-matches against cosim. This change adds a warning to flag up cases where this has occurred to enable quick triage of failures related to this scenario.
fa53ff4
to
f94cf96
Compare
f94cf96
to
d5d3f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks.
As part of my deep dive regression triage I've been fixing up a few things.
With this set of fixes we can hit 95 - 96% pass rate
They require an updated spike, PR is here: lowRISC/riscv-isa-sim#25.
Once that's merged I can kick off a binary build in CI and then update the cosim version we point to which will allow CI to pass on this commit.