Skip to content

Minimum width on serializer's counter - Fix for issue 166#284

Open
joserochh wants to merge 3 commits intointel:mainfrom
joserochh:joserochh/fix_issue_166
Open

Minimum width on serializer's counter - Fix for issue 166#284
joserochh wants to merge 3 commits intointel:mainfrom
joserochh:joserochh/fix_issue_166

Conversation

@joserochh
Copy link
Copy Markdown

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

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

@joserochh joserochh changed the title Joserochh/fix issue 166 Minimum width on serializer's counter - Fix for issue 166 Mar 20, 2026
@desmonddak
Copy link
Copy Markdown
Contributor

Looks great! Will merge soon.

@joserochh
Copy link
Copy Markdown
Author

joserochh commented Mar 31, 2026

Looks great! Will merge soon.

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

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