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

Fix #295, signed arithmetic shift right #296

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Conversation

mkorbel1
Copy link
Contributor

@mkorbel1 mkorbel1 commented Mar 2, 2023

Description & Motivation

Shift-right arithmetic (SRA) is broken in generated SystemVerilog if an unsigned operation is applied to the result (see #295)

This fix maintains that the SystemVerilog still uses >>> so that it is similar to the original implementation but adds an additional set of {} around the result to guarantee safety.

Thank you to @saw235 for the implementation suggestion in #295 (comment)

Related Issue(s)

Fix #295

Testing

Added a new test that failed before the fix.

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

No

@mkorbel1 mkorbel1 merged commit 59a5af3 into intel:main Mar 8, 2023
@mkorbel1 mkorbel1 deleted the srasigned branch March 8, 2023 23:58
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

Successfully merging this pull request may close these issues.

Arithmetic shift-right generated SV can be ineffective depending on nearby logic
1 participant