-
Notifications
You must be signed in to change notification settings - Fork 445
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
Small quality of life enhancement proposals #585
Comments
I would suggest filing separate issues for each problem; this makes it much simpler to solve them one by one. The first one is a duplicate of #47. The second one is trickier, since you would have to define what the log is for non-powers of two and for negative numbers. In general you should define a macro for the log and compute the number of ports:
For the third one the spec requires that the size of the shifted operand to be specified, unless both operands are infinite-precision. Remember that shift will discard bits, and it is not clear how wide is your 1. If you replace 1 with 5w1 it will work. In your example b evaluates to a constant, but in general you need to know how wide the 1 if you evaluate this at run-time. Another possibility is to declare b as |
So I don't really know if there is anything to fix for this issue. |
Thank you for responding, Mihai :-) |
1.1 - Constant conjunction
It would be interesting to be able to do the following:
The compiler accepts this, but if I write
bit<TOTAL_OUTPUT_LENGTH> var
it forbids it:1.2 - Logarithms and powers
And to use power or logarithm base 2 functions.
2.1 - Shift operator
The text was updated successfully, but these errors were encountered: