-
Notifications
You must be signed in to change notification settings - Fork 933
ice40_dsp: fix const handling #4992
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
base: main
Are you sure you want to change the base?
Conversation
Please add a regression test. If you have the time, can you check |
I tried to copy xilinx code, but it(and microchip_dsp.pmg) seems to fail on the same issue. Also I mistaken this bug for const-only, turns out this is an issue with handling all unsigned signals (for example |
Also I want to note that in first example, the issue was not just with |
The previous commit did not optimize unsigned zero-leading signals unlike the original code. But it also differs from original when handling signals like |
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.
I'm pretty sure the old behavior wasn't right. You can't unextend an unsigned 110
into a 10
, for example. The current version looks good. There are other DSP PMG passes where an unextend function is cobbled together but let's consider that out of scope for this PR and moved into #5059
What are the reasons/motivation for this change?
ice40_dsp seems to incorrectly handle unsigned consts. The issue seems to be with unextend function. By searching previous issues I could find this one #2648.
Explain how this is achieved.
Now unextend is called only on non constant inputs.
If applicable, please suggest to reviewers how they can test the change.
Gives two different connect \B values in \SB_MAC16 cell on pre-PR code, and the same value on post-PR code.