Skip to content
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 ExactMap and TernaryMap extern definitions to pna.p4 #52

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Add a note about control plane API generation for ExactMap and Ternar…
…yMap
jafingerhut committed Nov 30, 2022
commit 7759270a3a10b783652665ca209c3e7310656433
7 changes: 7 additions & 0 deletions examples/pna-example-exactmap-ternarymap.p4
Original file line number Diff line number Diff line change
@@ -116,6 +116,13 @@ control MainControlImpl(
actions = { lookup; }
default_action = lookup(42);
}

Note that as of 2022-Nov, the open source p4c front end gives a
compile time error if there is a table and an extern instance
defined within a control that have the same name as each other.
Thus we can generate control plane API files, e.g. P4Info files,
assuming that extern instances of ExactMap and TernaryMap will
never have the same names as any P4 tables in the same control.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamescchoi See the paragraph comment I just added earlier today (2022-Nov-29) following up on a question in a meeting we had earlier today.

*/
ExactMap<emap1_key, bit<16>>(
size = 1024,