-
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
Fixing bug in parserUnroll #3503
Conversation
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.
I am approving, but please make these small changes.
@VolodymyrPeschanenkoLitSoft @mbudiu-vmw After this PR, the following parser IR:
is transformed into:
Is this expected, and if it is, could you please help me understand why this is desirable? Thanks. |
Also, could you please explain in a bit more detail what this PR is trying to achieve? I don't see any changes to expectations in the unit tests, so wasn't sure exactly what bug this PR is attempting to fix. |
Loop unrolling attempts to rewrite a parser with cycles in the state graph into a parser without cycles. |
In this case though, isn't the transformed parser IR semantically different than the original IR? With the original parser, the following is a possible path through the states: |
It does look wrong, perhaps the code treats h6 as a 1-element stack. |
You should file an issue with a full P4 program that can be used to reproduce this issue. |
@kfcripps, If such a path is possible then it looks like a bug. If you attach the full example to a new issue. I'll check it tomorrow morning in Ukrainian time. |
Will do, just wanted to make sure that I wasn't misunderstanding something before opening an issue. Thanks for checking! |
opened #3537 |
These changes allow to unroll loops in the following examples: issue692-bmv2, issue2090, gauntlet_parser_test2, gautlet_parser_test4, spec-ex19.
To check, please, run the following command:
./backends/p4test/p4test -I "./p4include" --target bmv2 --std p4-16 --loopsUnroll --arch v1model "../testdata/p4_16_samples/example_name.p4"