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

Q extension #445

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

Q extension #445

wants to merge 1 commit into from

Conversation

jordancarlin
Copy link
Collaborator

@jordancarlin jordancarlin commented Apr 5, 2024

Adds support for all Q extension instructions plus Q related Zfh and Zfa instructions. size_enc is also updated to have a 3 bit version (size_enc_wide) that supports QUAD word widths.

Fixes #187 from @LiuTaowen-Tony. There were lots of merge conflicts from the past 2 years. This resolves them and updates the changes that were made to comply with current conventions (removes effects, compatibility with existing Zfh and Zfa extensions that were added since the original version was written). It also changes the core soft-float interface to use two 64 bit values to avoid the need to create MPZ variables as was done in #187.

@jordancarlin jordancarlin marked this pull request as draft April 5, 2024 07:58
model/riscv_types.sail Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Apr 9, 2024

Test Results

396 tests  ±0   396 ✅ ±0   0s ⏱️ ±0s
  4 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 77a4ff4. ± Comparison against base commit 70edcb0.

♻️ This comment has been updated with latest results.

@jordancarlin jordancarlin force-pushed the quads branch 4 times, most recently from 24150d7 to df7ae02 Compare April 17, 2024 04:25
@jordancarlin jordancarlin marked this pull request as ready for review April 17, 2024 04:54
Copy link
Collaborator

@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.

Haven't read it all but I skimmed some of it and it mostly looks reasonable. You may want to wait for #448 which will remove at least some of the changes needed. It's waiting for a new version of the Sail compiler to be released.

model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_types.sail Outdated Show resolved Hide resolved
model/riscv_types.sail Outdated Show resolved Hide resolved
model/riscv_types.sail Outdated Show resolved Hide resolved
model/riscv_sys_control.sail Outdated Show resolved Hide resolved
model/riscv_insts_base.sail Outdated Show resolved Hide resolved
c_emulator/riscv_softfloat.c Outdated Show resolved Hide resolved
c_emulator/riscv_softfloat.c Outdated Show resolved Hide resolved
model/riscv_insts_aext.sail Outdated Show resolved Hide resolved
model/riscv_insts_base.sail Outdated Show resolved Hide resolved
@jordancarlin
Copy link
Collaborator Author

jordancarlin commented Apr 21, 2024

You may want to wait for #448 which will remove at least some of the changes needed. It's waiting for a new version of the Sail compiler to be released.

@Timmmm It seems like the changes needed to either PR based on each other should be relatively minor, so it probably doesn't matter the order they are merged.

@jordancarlin jordancarlin requested a review from Timmmm April 22, 2024 15:09
@jordancarlin jordancarlin force-pushed the quads branch 4 times, most recently from 0fee98f to d054ef7 Compare May 2, 2024 03:32
@jordancarlin
Copy link
Collaborator Author

@Timmmm Thanks for all your earlier comments. I believe I’ve taken care of all of them at this point. I’d appreciate it if you could give this another look. Aside from more rigorous testing (which is being worked on) I think this PR is ready.

Makefile Outdated Show resolved Hide resolved
if (sizeof(flen) == 32)
then 0x_FFFF @ val_16b
else 0x_FFFF_FFFF_FFFF @ val_16b
match (sizeof(flen)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These boxing/unboxing functions can at least be generic, as in my other commit.

However, unless you are in a hurry for this I kind of feel like it would still be worth:

  1. Waiting for the new float support in the Sail standard library.
  2. Update my other MR to use that & make the code more generic.
  3. Then update this.

That may take a while I'm afraid but I guess you'd noticed that's pretty normal for this project! (Also I'm not the boss here so feel free to seek a second opinion!)

I think we should re-evaluate when there's a new Sail compiler release, which I imagine shouldn't be too long.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know there is work being done on quad tests for riscv-arch-test which will want to use the sail model to generate signatures. If those are completed before we get all of the floating point updates into the Sail standard library and make the code more generic, then we may want to revisit merging this sooner but otherwise, I agree.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jordancarlin Do you know if anyone is planning to make and tape-out a real chip that implements the Q extension?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@martinberger The OpenHW Core-V-Wally processor (https://github.com/openhwgroup/cvw) implements the Q extension in some of its configurations. There is an upcoming tape-out planned for it very soon. I'm double checking which configuration is planned for that, but it sounds like it might include Q.

Complete Q extension implementation including Zfa instructions

Based on original work by 'LiuTaowen-Tony' in riscv#187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Adds support for a RISC-V extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants