Minimum width on serializer's counter - Fix for issue 166#284
Open
joserochh wants to merge 3 commits intointel:mainfrom
Open
Minimum width on serializer's counter - Fix for issue 166#284joserochh wants to merge 3 commits intointel:mainfrom
joserochh wants to merge 3 commits intointel:mainfrom
Conversation
Contributor
|
Looks great! Will merge soon. |
Author
I found other cases where this log2ceil is used, without this fix, or with this very same fix already. So maybe we can have a new function that ensures minimum width, but not sure how to call it. Maybe widthFor(val), or bitsNeeded like chisel. Or less creative, log2ceilMin1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & Motivation
Ensuring a minimum width on serializer's counter.
Related Issue(s)
#166
Testing
The test creates a Serializer with a 1-element LogicArray([1], 8) and asserts count.width >= 1 (the invariant fixed by max(1, ...)).
Then verifies the module builds and drives serialized = 42 with done = true on the first active clock cycle.
Backwards-compatibility
No
Documentation
No