Skip to content
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

[cosim] Sort out error/pmp failure behaviour on unaligned accesses #1948

Open
GregAC opened this issue Nov 17, 2022 · 1 comment
Open

[cosim] Sort out error/pmp failure behaviour on unaligned accesses #1948

GregAC opened this issue Nov 17, 2022 · 1 comment
Labels
Component:DV Design verification (DV) or testing issue Priority:P3
Milestone

Comments

@GregAC
Copy link
Collaborator

GregAC commented Nov 17, 2022

When spike encounters an unaligned access it splits it into single byte accesses. If one of these sees a bus error or a PMP failure it immediately causes an exception. In Ibex unaligned accesses are split in two and both accesses are tried regardless of bus errors and PMP failures of the other access.

This leads to co-sim mismatches in cases where unaligned accesses cross PMP boundaries (the co-sim framework can currently handle the difference in behaviour for bus errors). What Ibex does is architectural permissible so we should modify spike to match. I have a PR for this: lowRISC/riscv-isa-sim#23 though it also needs some changes on the co-sim side, as it currently removes outstanding unaligned accesses from the pending memory access queue on an error to help deal with the mismatch.

We can remove the co-sim behaviour that removes accesses for the pending memory access queue, that you can see at

// TODO: How to check BE? May need length of transaction?
// Remove the top pending access now so both the first and second DUT
// accesses for this misaligned access are removed.
pending_dside_accesses.erase(pending_dside_accesses.begin());
}
// For any misaligned access that sees an error immediately indicate to
// spike the error has occured, so ensure the top pending access gets
// removed.
pending_access_done = true;

However this causes other errors.

This needs to be resolve, though can be done post V2. I've observed PMP tests correctly dealing with cross PMP region accesses so we have confidence this issue is not hiding a real RTL bug behind it.

estimate 4

@GregAC GregAC added the Component:DV Design verification (DV) or testing issue label Nov 17, 2022
@GregAC GregAC added this to the V3 milestone Nov 17, 2022
@GregAC GregAC modified the milestones: V3, OT-M2.5 Feb 27, 2023
@GregAC
Copy link
Collaborator Author

GregAC commented Mar 23, 2023

estimate range: 2 - 4

@GregAC GregAC modified the milestones: OT-M2.5, V3 Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV Design verification (DV) or testing issue Priority:P3
Projects
None yet
Development

No branches or pull requests

1 participant