-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add log_msg extern function to pna.p4 include file? #66
Comments
TODO Andy: Discussing this with Cristian Dumitrescu on precisely how these would be implemented on DPDK. Note that they are already implemented on BMv2 for the v1model architecture. The PSA implementation for BMv2 is only partial as of 2022-Oct, with no one that I know of currently actively working to finish it. Similarly, I do not know of anyone working on BMv2 implementation of PNA architecture at this time. |
Consider adding log_msg to both PSA and PNA, not only PNA. |
+1 for me. |
This is more question of how |
I think the BMv2 implementation of this is fairly bare-bones, where each {} in the format string corresponds to the next value to be printed, and there is no variation supported in the format, e.g. no choice of decimal/hex/binary/etc. If you have an Ubuntu system where you are willing to install p4c/behavioral-model/etc. open source dev tools, and write little v1model programs to try out different types of values to log_msg to see what it does today, it shouldn't take long, but I can hack up something over the weekend to show some examples too. |
I have updated the comments in the p4c test program issue2201-bmv2.p4 with this PR, so that the comments are up to date with the latest behavioral-model/BMv2 simple_switch behavior of its implementation of the log_msg extern function: p4lang/p4c#3637 Note: There is no spec defining its behavior. It was an implementation created by someone for BMv2, and I'd say does something fairly expedient but useful. I do not know how many people rely on its current precise behavior. I would guess not many, but for all I know someone has created automated test scripts that parse the output of simple_switch to recognize these messages and check their contents :-) |
This exists in the v1model.p4 include file, here: https://github.com/p4lang/p4c/blob/main/p4include/v1model.p4#L705-L711
You can find a few examples of its use in this v1model architecture program that runs on BMv2 simple_switch/simple_switch_grpc here: https://github.com/jafingerhut/p4-guide/blob/7b60e42d8aa3e7afe11d630d7f3357bff3064bb9/ptf-tests/registeraccess/registeraccess.p4
Like assert and assume (see #65 ) it is useful for testing and development on software switch environments, and would typically be treated as no-op when compiling to hardware targets.
The text was updated successfully, but these errors were encountered: