-
Notifications
You must be signed in to change notification settings - Fork 670
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
feat(Backend, MemBlock): add support for Zacas extension #3958
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NewPaulWalker
force-pushed
the
feat-zacas
branch
from
December 5, 2024 03:15
04ce255
to
cb82b76
Compare
linjuanZ
force-pushed
the
feat-zacas
branch
2 times, most recently
from
December 6, 2024 02:34
f73e10d
to
f19d2a9
Compare
NewPaulWalker
force-pushed
the
feat-zacas
branch
3 times, most recently
from
December 9, 2024 03:41
2dd4a60
to
907f8cc
Compare
linjuanZ
requested review from
cz4e,
good-circle,
happy-lx and
bosscharlie
as code owners
December 9, 2024 08:35
bosscharlie
approved these changes
Dec 9, 2024
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.
DCache part LGTM.
cz4e
approved these changes
Dec 9, 2024
NewPaulWalker
force-pushed
the
feat-zacas
branch
from
December 9, 2024 10:53
a0c8867
to
e2f1a10
Compare
misc: remove assert temporarily
fix(AtomicsUnit, MemBlock): fix loss of multiple stds In the previous design, AtomicsUnit receives stds from StdExeUnit and arbitrate at most one std uop for one cycle. This works fine on most of the AMOs and LR/SC because they require only one std uop. However AMOCAS requires at least two std uops, which may be issued from two separate issue queues at the same time, leading to the loss of std uops. This commit fixes this by taking all the outputs of the StdExeUnits into account with arbitration logics. fix(AtomicsUnit): DCache req can only be sent at `s_cache_req` fix(AtomicsUnit, difftest): fix difftest io for atomic events fix(MainPipe): fix precedence of `&` and `=/=` operator fix(MainPipe): AMOCAS should not wait for AMOALU fix(MemBlock): remove unnecessary assertion fix(MainPipe): only CAS instruction can assert `s3_cas_fail` fix(AtomicsUnit): fix bug in data select logic submodule(difftest): bump difftest
* spike commit: 9ab4cebc0caf121695b77f78ca6d2481fe9b182f * spike config: CPU=XIANGSHAN Including: * feat(Zacas): enable Zacas entension. * NEMU commit: bf877e0b34092517c909afc9c58ebc803dd8cf3f * NEMU configs: * riscv64-xs-ref_defconfig * riscv64-dual-xs-ref_defconfig Including: * config(Zacas): enable Zacas entension. * submodule(ready-to-run): Bump spike ref in ready-to-run * ci: add ci tests for Zacas extension.
[Generated by IPC robot]
master branch:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements Zacas extension for atomic Compare-and-Swap (CAS) instructions. For RV64, AMOCAS.W / AMOCAS.D / AMOCAS.Q atomically loads 32 / 64 / 128-bits of a data value from rs1, compares the loaded value to register rd (for AMOCAS.Q, a register pair consisting of rd and rd+1), and if the comparison is bitwise equal, then stores the value held in rs2 (for AMOCAS.Q, a register pair consisting of rs2 and rs2+1) to the original address in rs1.
This pull request re-uses the existing AtomicsUnit design. However, an AMOCAS instruction may consume more than 1 std and even more than 1 sta in the new design. As far as stds,
As for stas, AMOCAS.Q has extra require for the number of sta uops, which is also the number of sta uops' write-back,
Besides, this pr removes the write-back of atomic stds.