-
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
Question: Are runtime_data and local types synonymous in bmv2 JSON config file? #680
Comments
when the argument to an action primitive is a simple expression, like a field value or a runtime-provided value (
and
Note that |
|
that's correct, I opened a PR for this: https://github.com/p4lang/behavioral-model/pull/383/files |
Thanks for the explanation. Are there any plans to use |
The only other use that comes to mind is the P4_14 Python compiler using it to handle variable-length field extraction. There, locals are fields in the header being extracted. |
Thanks for the answers, and for adding to the bmv2 JSON config file documentation. Closing this issue. |
I can create an example if necessary, but it might be easy to determine why this is happening from perusal of the bmv2 back end.
I have a bmv2 JSON config file where in some cases, a primitive of an action will reference an action parameter using a JSON object with key "type" and value "runtime_data", and key "value" being an integer index into the array of action parameters.
In other cases, it appears that the same action parameters are being referenced via a JSON object with key "type" and value "local", and the same "value" as for "runtime_data" above.
Is there any semantic difference between these? If so, what? If not, should they all use the same value for "type"?
It appears that occurrences of type "local" are created here in the code: https://github.com/p4lang/p4c/blob/master/backends/bmv2/expression.cpp#L312
Occurences of type "runtime_data" are created here: https://github.com/p4lang/p4c/blob/master/backends/bmv2/expression.cpp#L427
The text was updated successfully, but these errors were encountered: