Update width-inference.md#3809
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.
Can we define minNum while visiting?
There was a problem hiding this comment.
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.
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.
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.
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.xdepending 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.