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

Remove unnecessary matches for loads/stores #477

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

Timmmm
Copy link
Collaborator

@Timmmm Timmmm commented May 15, 2024

Simplify the load/store code by removing the unnecessary matches on the access size. I have not done it for float loads/stores because that requires a separate change to make the float code generic over size.

Note, the first commit is #468 - only review the second.

model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_insts_fext.sail Outdated Show resolved Hide resolved
model/riscv_insts_fext.sail Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@Timmmm Timmmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

model/riscv_addr_checks.sail Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_insts_fext.sail Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
@Timmmm Timmmm force-pushed the user/timh/silly_switch branch 2 times, most recently from 21dddfb to 5688986 Compare May 16, 2024 14:52
Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with the vector parts but the rest looks like a very nice cleanup.

Copy link

github-actions bot commented May 21, 2024

Test Results

712 tests  ±0   712 ✅ ±0   0s ⏱️ ±0s
  6 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a6b656d. ± Comparison against base commit b15c0d3.

♻️ This comment has been updated with latest results.

@Timmmm
Copy link
Collaborator Author

Timmmm commented May 21, 2024

This is ready now - I rebased it and fixed a small bug (mixing up vaddr and addr - see #434 ).

billmcspadden-riscv pushed a commit that referenced this pull request May 24, 2024
Add a way to exclude tests by specifying an exclusion file
@Timmmm Timmmm added the tgmm-agenda Tagged for the next Golden Model meeting agenda. label May 28, 2024
@Timmmm Timmmm mentioned this pull request May 28, 2024
@Timmmm
Copy link
Collaborator Author

Timmmm commented Jun 3, 2024

@billmcspadden-riscv I resolved the threads but I think we should merge #468 first (which is just the first commit from this PR) and then I'll rebase this and we can merge it. Hope that makes sense!

Simplify the load/store code by removing the unnecessary matches on the access size. I have not done it for float loads/stores because that requires a separate change to make the float code generic over size.

This also simplifies the AMO operation by not extending and truncating the values so many times, and removing the use of to_bits.
@Timmmm
Copy link
Collaborator Author

Timmmm commented Jun 3, 2024

Ok this is rebased and ready to merge.

@rmn30
Copy link
Collaborator

rmn30 commented Jun 4, 2024

IIRC those matches exist because previous Sail versions had trouble with monomorphisation of this code when generating theorem prover definitions. No idea if that is still the case.

@Timmmm
Copy link
Collaborator Author

Timmmm commented Jun 4, 2024

Ah interesting. @Alasdair do you know if that is still true?

@bacam
Copy link
Collaborator

bacam commented Jun 4, 2024

I don't think any of the output that's currently produced requires monomorphisation (because the Lem/Isabelle output is currently using bit lists). If I remember correctly, this part of the spec isn't a problem anyway at the moment, but the vector specifications need some tweaks.

@billmcspadden-riscv billmcspadden-riscv merged commit 7ff6d94 into riscv:master Jun 4, 2024
2 checks passed
@billmcspadden-riscv billmcspadden-riscv removed the tgmm-agenda Tagged for the next Golden Model meeting agenda. label Jun 4, 2024
@Timmmm Timmmm deleted the user/timh/silly_switch branch June 12, 2024 10:13
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.

6 participants