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
Update width-inference.md #3809
base: main
Are you sure you want to change the base?
Conversation
Fix the computation for Fill width and clarify what is meant by maxNum. Clean up formatting
| `z = Cat(x, y)` | `w(z) = w(x) + w(y)` | | ||
| `z = Fill(n, x)` | `w(z) = w(x) * n` | | ||
|
||
>where for instance `w(z)` is the bit width of wire `z`, `maxNum(n)` is the maximum number representable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define minNum
while visiting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n
for these shifts must be unsigned, is that right? Curious if minNum(n)
is ever non-zero.
If n
is 5 is maxNum(n)
5 or is it 7 (largest 3-bit number, where 3 is width of n
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If n is 5 is maxNum(n) 5 or is it 7 (largest 3-bit number, where 3 is width of n)?
Is there a way to check this? Cause I think when using Fill(6, 1.U)
, I saw a width of z
to be 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @dtzSiFive comment I think we should use a different thing for the last number in Fill, as there it's an Int n not a UInt-that-has-a-width n
@@ -16,22 +16,22 @@ The width of a conditionally valid expression is the width of its input expressi | |||
|
|||
Hardware operators have output widths as defined by the following set of rules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PDF link above for firrtl spec is a 404, just noting since noticed 👍 .
Fix the computation for Fill width and clarify what is meant by maxNum. Clean up formatting
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Clarify width inference documentation.
Reviewer Checklist (only modified by reviewer)
3.6.x
,5.x
, or6.x
depending on impact, API modification or big change:7.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.