YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.3k stars 860 forks source link

rtlil: Fix `addShiftx` for signed shifts #4467

Closed povik closed 4 days ago

povik commented 1 week ago

What are the reasons/motivation for this change?

This fixes the helper creating invalid RTLIL when called with is_signed set to true.

See here from the commit message:

Only the B input (the shift amount) can be marked as signed on a $shiftx cell. Adapt the helper accordingly and prevent it from creating invalid RTLIL when called with is_signed set. Previously it would mark both A and B as signed.

If applicable, please suggest to reviewers how they can test the change.

There's no way to test this without writing external code, I think.