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 assert and assume extern functions to PNA include file? #65

Open
jfingerh opened this issue Oct 27, 2022 · 4 comments
Open

Add assert and assume extern functions to PNA include file? #65

jfingerh opened this issue Oct 27, 2022 · 4 comments

Comments

@jfingerh
Copy link
Contributor

They have recently been added to the PSA include file with this commit: https://github.com/p4lang/p4-spec/blob/main/p4-16/psa/psa.p4#L340-L403

Do we want these added to pna.p4 include file as well? They can be very useful in testing of P4 code on software-based devices, e.g. BMv2 and DPDK. Typically they would be compiled as no-ops on hardware targets.

@jfingerh
Copy link
Contributor Author

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.

@apinski-cavium
Copy link
Contributor

+1 from me.

@thomascalvert-xlnx
Copy link
Member

Is the architecture include file the right place for defining these methods? It seems to me like they would be better placed in an orthogonal header (e.g. core.p4), as there is really nothing architecture-specific about these 2 methods.

@jnfoster
Copy link
Contributor

@thomascalvert-xlnx in general, we are conservative about adding types and primitives to core.p4 as they must be implemented by every architecture (and therefore every compiler backend). So for assert and assume we first added them to V1Model. The idea was always that if they were useful, and there was a push to use them in more architectures, then we would consider them as candidates for addition to core.p4 instead. Maybe now is the time to have that discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants