-
Notifications
You must be signed in to change notification settings - Fork 663
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
sc.w Instruction Returns 0 When Operated on Different Memory Addresses, Indicating Incorrect Success Status #3846
Comments
This is allowed in ISA, maybe reservation set size is different in NEMU. |
Thank you for your prompt response and clarification! I will now close this issue. Could you please remove the "bug report" label? Thanks again!😄 |
I am not very familiar with NEMU. We can discuss whether NEMU should follow this behaviour. |
In NEMU, only the address is compared, which means the reservation set size in NEMU is only one byte? // should check overlapping instead of equality
int success = (cpu.lr_addr == *src1) && cpu.lr_valid; Do you know how this is handled in XiangShan? |
Not sure, but very likely to be a cacheline-wide reservation set. Maybe @huxuan0307 can have a look. |
Seems to be a 64B aligned reservation set. |
Thanks! Perhaps we should configure NEMU and XiangShan to use the same size for the reservation set. I can submit a PR of NEMU to make this adjustment. |
I believe this PR can resolve this inconsistency issue. |
Before start
Describe the bug
In xiangshan, when
lr.w
andsc.w
operate on different memory addresses (i.e. lr.w uses address0x80010024
, while sc.w uses address0x80010028
),sc.w
still returns0
, indicating that the operation is successful. This behavior is inconsistent with the reference modelnemu
Expected behavior
To Reproduce
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: