You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bit = Bits(8, 12)
left = Bits(16, 0)
right = Bits(16, 8)
bit [ left : right ]
Then in Bits.py line 296, "ones = (1 << nbits) - 1" will raise an error because nbits should be an integer.
The semantics are to capture bit [ 0 : 8 ], but the type of nbits ("nbits = stop - start" in line 284) after this subtraction is still Bits.
I think it is useful to cast nbits to integer here because in some circumstances programmers may get the left and right range from an input port and may forget to cast Bits to integer.
The text was updated successfully, but these errors were encountered:
jsn1993
changed the title
Some minor bugs (or functional extensions) of range select
A minor bug (or functional extensions) of range select
Sep 18, 2015
See this code fragment:
Then in Bits.py line 296, "ones = (1 << nbits) - 1" will raise an error because nbits should be an integer.
The semantics are to capture bit [ 0 : 8 ], but the type of nbits ("nbits = stop - start" in line 284) after this subtraction is still Bits.
I think it is useful to cast nbits to integer here because in some circumstances programmers may get the left and right range from an input port and may forget to cast Bits to integer.
Suggestion: nbits = stop - start --> nbits= (int)(stop-start)
The text was updated successfully, but these errors were encountered: