-
Notifications
You must be signed in to change notification settings - Fork 466
[bmv2]: allow BoolLiteral in ternary table entry #5199
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
[bmv2]: allow BoolLiteral in ternary table entry #5199
Conversation
Allow use of BoolLiteral (true/false) in a table const entry in ternary field. Signed-off-by: Glen Gibb <gleng@ai-fabrics.com>
I don't recall anything that this would violate in the language spec. If you wanted a const entry that was wildcard on the Boolean field, it isn't clear to me how one would specify that, but the lack of such a capability need not block this change. It appears that for P4Info file generation, table match keys with type boolean are represented as |
This is already supported by placing an underscore ( |
Unfortunately a couple of the other backends don't support this:
I had hoped that by including |
I am not sure, but one of the failures looked like it was because it could not find a .txtpb expected output file in the testdata/p4_16_samples_outputs directory to compare against. Maybe try generating and adding those files to the PR? |
Signed-off-by: Glen Gibb <gleng@ai-fabrics.com>
Yes, upon further investigation, it was just the missing test outputs. So an easy fix 🙂 |
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.
LGTM
Allow use of BoolLiteral (true/false) in a table const entry in ternary field.
Example (from test case):
@fruffy / @jafingerhut : Please let me know if this is in violation of the P4 spec. AFAIK, it should be fine.