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

ara_dispatcher handling of continuous Configuration-Setting Instructions (vsetvli/vsetivli/vsetvl) is not perfect. #240

Open
WEIhabi opened this issue Aug 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@WEIhabi
Copy link

WEIhabi commented Aug 23, 2023

Enter two Config instructions in ara_dispatcher, as follows

  1. vsetvl x0, x16, e8, m8, tu, mu (32'h8038_7057) # SEW= 8, LMUL=8
  2. vsetvli x0, x0, e16, m1, tu, ma (32'h3880_7057) # SEW= 16, LMUL=1

This sets LMUL=1 and vl=1040 (from rs1 in the vsetvl instruction) for subsequent instructions, causing subsequent instructions to be written to destination registers where they should not be.

The reason is that ara_dispatcher violates the rule that the original vl value cannot be preserved when VLMAX and vl change due to a new SEW/LMUL ratio, which is currently preserved, and the implementation should go to set vill or VL set to VLMAX due to the AVL > VLMAX (RVV SPEC 6.3 3. vl = VLMAX if AVL ≥ (2 * VLMAX) ).

If the development team wants to be compatible with spike, there is also a treatment for this in the implementation of spike, which selects the value of min.

The following diagram shows the relevant waveforms:
You can see the final change of the vslideup instruction from the original vd=v9 to v17.

image
image
image
image

@WEIhabi WEIhabi changed the title ara_dispatcher handling of Configuration-Setting Instructions (vsetvli/vsetivli/vsetvl) is not perfect. ara_dispatcher handling of continuous Configuration-Setting Instructions (vsetvli/vsetivli/vsetvl) is not perfect. Aug 23, 2023
@mp-17 mp-17 added the bug Something isn't working label Sep 6, 2023
@mp-17
Copy link
Collaborator

mp-17 commented Sep 6, 2023

Hello @WEIhabi, thanks a lot for reporting!! :-)
I will fix this asap in the next round of bug fixes.

Best,
Matteo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants