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

Fixes and improvements related to shifts #412

Merged
merged 7 commits into from
Sep 19, 2023
Merged

Conversation

mkorbel1
Copy link
Contributor

@mkorbel1 mkorbel1 commented Sep 18, 2023

Description & Motivation

This PR is primarily focused on making sure shifts (left, right, and right arithmetic) perform without error and correctly for any input. It also includes some additional improvements that are related to fixing this.

  • Fix shifting bugs related to signed numbers and numbers that could be interpreted as signed (or not signed)
  • Fix shifting of invalid values to properly shift in 0s or Xs rather than assume the whole bus is X
  • Add capability to construct a LogicValue by inferring the width (using ofInferWidth) of positive numbers
  • Allow shifting by "huge" amounts to give the right answer (e.g. >width, > max width, > int max)
  • Allow toInt on LogicValues with big widths but that can be properly represented by an int
  • Allow shift of constants to infer the width of non-LogicValue constants
  • Added new exception type for unsupported types
  • Added checks against constructing LogicValues with invalid strings
  • Improved messages in some exceptions and some comments in the code
  • Upgraded SimCompare utilities to support BigInts
  • Updated maps storing masks to a more efficient structure
  • Lots of new tests covering all this, especially that shift works correctly in different situations

Related Issue(s)

Fix #404
Fix #110

Testing

Extensive new testing for all changes and bug fixes

Backwards-compatibility

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

No, unless someone was relying on buggy behavior

Documentation

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

Updated API docs

@mkorbel1 mkorbel1 merged commit b7612ba into intel:main Sep 19, 2023
2 checks passed
@mkorbel1 mkorbel1 deleted the shifts branch September 19, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant