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
0-width bitstrings #931
0-width bitstrings #931
Conversation
p4-16/spec/P4-16-spec.mdk
Outdated
positive integer greater than 0. When using an expression for the | ||
size they must be parenthesized. | ||
positive integer greater or equal to 0. When using an expression for | ||
the size they must be parenthesized. Bitstrings with width 0 are |
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.
"expression" is singular, so "they" should be "it".
Implement this check in the compiler. |
I realized that |
The compiler supports this now in p4lang/p4c#2724 |
If I can get a review on this PR we can probably merge it as well. |
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.
Looks great. Thanks!
p4-16/spec/P4-16-spec.mdk
Outdated
@@ -2038,7 +2040,7 @@ values, P4 provides a special bit-string type whose size is set at | |||
runtime, called a `varbit`. | |||
|
|||
The type `varbit<W>` denotes a bit-string with a width of at most `W` | |||
bits, where `W` must be a positive integer that is a compile-time | |||
bits, where `W` must be a positive or zero integer that is a compile-time |
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.
"non-negative"?
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.
weird, I was pretty sure I had made this change.
Personnel
Design
Implementation
p4-spec
: 0-width bitstrings #931p4c
: Support for 0-width bit and varbit p4c#2724Process
p4-spec
:p4c
: