-
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
Allow usage of a typedef type in parameters of a parser for p4c-bm2-ss #3118
Allow usage of a typedef type in parameters of a parser for p4c-bm2-ss #3118
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.
Don't we have a pass to eliminate all typedefs from the program?
In that case behavioral-model crashed for few examples. *** Test failed But everything is correct in p4c side. |
@@ -181,6 +181,8 @@ set (XFAIL_TESTS | |||
testdata/p4_16_samples/issue1882-bmv2.p4 | |||
testdata/p4_16_samples/issue1882-1-bmv2.p4 | |||
testdata/p4_16_samples/issue2664-bmv2.p4 | |||
# typedef type as a parameters of a parser | |||
testdata/p4_16_samples/strength-simple.p4 |
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.
why is this test failing?
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 think that, It happens because of these two things:
- typedef my_headers_t
headers_t
; - parser parser_impl(...,out
headers_t
hdr,...)
Doesn't #3123 solve this problem? |
Implemented in #3123 |
If we try to get a type of a header from
refMap
forType_Name
then It could be represented asType_Typedef
type which contains type of a header in one of it's filed.Please, run the following command to demonstrate the problem:
./p4c-bm2-ss -o ./tmp/strength-simple.p4.json ../testdata/p4_16_samples/strength-simple.p4