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

Wrong operand for vwmacc(u|us|su).vx #102

Open
moimfeld opened this issue Aug 11, 2022 · 0 comments
Open

Wrong operand for vwmacc(u|us|su).vx #102

moimfeld opened this issue Aug 11, 2022 · 0 comments

Comments

@moimfeld
Copy link
Contributor

Hi @michael-platzer

A vector widening multiply accumulate instruction does a SEW * SEW multiplication and adds the product to a 2*SEW value. The result will have a width of 2*SEW.

Issue

If I understand the execution of vwmacc(u|us|su) instructions in Vicuna correctly, both multiplicands are first sign- or zero-extended to 2*SEW. After that the multiplication and the addition are all done on values with a 2*SEW width. In general this approach is correct, but for the vector-scalar version of these instruction there is an issue with the sign/zero-extension. In fact, no extension is done for the scalar source operand, instead a 2*SEW value is directly taken from the scalar source operand.

In the screenshot below you can see such a "non-extended" scalar source operand. The values in the screenshot are mostly taken from the multiply unit. SEW=8 for the duration of this screenshot.

issue_102

On the top left of the wave window one can see the value that is passed to Vicuna as the source operand for the vwmacc(u|us|su).vx instructions (rs1=0x3784F1C6). At the yellow cursor one can see that the op1 for the multiply unit is 0xF1C6_F1C6_F1C6_F1C6_F1C6_F1C6_F1C6_F1C6 instead of 0xFFC6_FFC6_FFC6_FFC6_FFC6_FFC6_FFC6_FFC6 (i.e. the values are not zero/sign extended but instead directly a 2*SEW value is taken from the scalar source operand.

How to reproduce

You can reproduce this issue by running the cvxif_test_direct_issue_102 in the UVM verification environment.

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

No branches or pull requests

1 participant