-
Notifications
You must be signed in to change notification settings - Fork 204
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
Atomic extension LR/SC tests and coverpoints #439
base: dev
Are you sure you want to change the base?
Atomic extension LR/SC tests and coverpoints #439
Conversation
Signed-off-by: muhammad-maarij-zeeshan <[email protected]>
@allenjbaum please review this PR when you are free. It is completed from our side but it has been stalled for a few weeks |
A few thoughts reviewing the PR visually. I don't see these tests writing to signature memory. How do we know if they failed or succeeded? There are no lr.w and sc.w instructions tested on RV64, even though the ISA should support these. Many of the tests try to write a 0 value to memory to prove that memory changed. 0 is special number and might have been written by an incorrect implementation. Would it be safer to write a random number rather than 0? |
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.
As with all test that involve storing to memory, the write to memory should either be directly to the signature area, or should be re-read from whereever it is stored and written to the signature region. Storing directly to the signature area is the preferred method.
In addition, the store conditional updates a destination register, and that must be stored into the signature as well. The RVTEST_SIGUPD macro should be used (unless you are storing non contiguous addresses)
These tests only load/store from the data region, which isn't acceptable. Storing a changing value (rather than zero) is preferred (e.g. an incrementing value is fine).
A constrained loop must " exclude loads, stores, backward jumps, taken backward branches, JALR, FENCE, and SYSTEM instructions" and the compressed extension equivalents. Because we can't predict whether an implementation will pass or fail with an unconstrained loop, we are forced to only test with those constraints .These tests will need to be rewritten to exclude those and also be 16 instructions long ( I think those 16 instructions include both the LR and the SC, and any backwards branch for retry - and we shouldn't test anything longer than that because implementations are allowed to succeed. Also, we shouldn't expect that SCs to a different address or length (in the same reservation set) will fail - they are allowed to succeed, so can't test those either.
Note that after each loop, the SC should attempt to store into a different signature word, as should the Rd register. I think this means that if the loop contains a store to something outside the reservation set, we don't know if will pass or fail, so we can't test that - but we can test something that is to the same reservation set and see that it fails.
Let's meet and talk about these tests
Description
Related Issues
Ratified/Unratified Extensions
List Extensions
Reference Model Used
Mandatory Checklist:
Optional Checklist: