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

Improve store-conditional speculative failures and exception priority #681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Timmmm
Copy link
Collaborator

@Timmmm Timmmm commented Jan 10, 2025

  1. Move speculate_conditional() to the same place as match_reservation(). I am not 100% sure about this change because I'm not sure what rmem is (and it has a comment about allowing it to fail very early), but it doesn't make sense to me that SC could spuriously fail in a place where it shouldn't be allowed in the sequential model.

Codasip uses speculate_conditional() to force spurious SC failures into the model (so it matches the DUT), and this is the right place for that use.

  1. Do an explicit access check before checking the reservation. Without this you never get an access fault for accesses to memory that doesn't exist or doesn't support LR/SC.

  2. Move cancel_reservation() to the end of the function. This doesn't change any functionality, I think it's just clearer and makes it obvious that the omission of cancel_reservation() in the MemException(e) branch was not a mistake.

@Timmmm
Copy link
Collaborator Author

Timmmm commented Jan 10, 2025

@Alasdair if you could shed any light on what rmem is expecting here that would be great!

Copy link

github-actions bot commented Jan 10, 2025

Test Results

392 tests  ±0   392 ✅ ±0   1m 20s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b4f342a. ± Comparison against base commit c650166.

♻️ This comment has been updated with latest results.

@Timmmm Timmmm force-pushed the user/timh/store_conditional_tweak branch from 55e8a23 to e2f1189 Compare January 10, 2025 15:47
@Timmmm Timmmm force-pushed the user/timh/store_conditional_tweak branch 2 times, most recently from 551485c to 1e52b56 Compare January 13, 2025 14:06
@Timmmm Timmmm force-pushed the user/timh/store_conditional_tweak branch from 1e52b56 to c87f45a Compare January 27, 2025 10:16
1. Move `speculate_conditional()` to the same place as `match_reservation()`. I am not 100% sure about this change because I'm not sure what rmem is (and it has a comment about allowing it to fail very early), but it doesn't make sense to me that SC could spuriously fail in a place where it shouldn't be allowed in the sequential model.

Codasip uses `speculate_conditional()` to force spurious SC failures into the model (so it matches the DUT), and this is the right place for that use.

2. Do an explicit access check before checking the reservation. Without this you never get an access fault for accesses to memory that doesn't exist or doesn't support LR/SC.

3. Move `cancel_reservation()` to the end of the function. This doesn't change any functionality, I think it's just clearer and makes it obvious that the omission of `cancel_reservation()` in the `MemException(e)` branch was not a mistake.
@Timmmm Timmmm force-pushed the user/timh/store_conditional_tweak branch from c87f45a to b4f342a Compare February 17, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants