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

Refactor code and add fixes for binary point edge cases #6

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

konda-x1
Copy link
Collaborator

@konda-x1 konda-x1 commented Sep 14, 2023

  • Some FixedPoint methods have been rewritten to be more comprehensible.
  • Fixed a bug that resulted in negative-width fixed-points during connect when the binary point difference between sink and source is larger than the source's data width.
  • Ensured that width and binary point don't change in methods floor, ceil, and round, particularly when binary point is greater than or equal to width.
  • Negative binary points are now disallowed inside FixedPoint.
  • Added some tests that verify that things work properly when binary point is greater than or equal to width.

* Replace pattern matching with function calls where sensible
* Remove superfluous use of asSInt
* Minimize the use of _inferredBinaryPoint
* Add source info to asFixedPoint
* Disallow negative binary point
* Ensure that floor, ceil, and round don't change width or binary point
* Don't force width in setBinaryPoint since binary point difference can be greater than data width
* Add test cases for when binary point is greater than or equal to width
@konda-x1 konda-x1 changed the title Code refactoring and fixes for binary point edge cases Refactor code and add fixes for binary point edge cases Sep 14, 2023
@milovanovic milovanovic merged commit cb42069 into ucb-bar:master Sep 14, 2023
1 check passed
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.

2 participants