[P4-design] Diagram of where P4_16 language constructs can be used

Mihai Budiu mbudiu at vmware.com
Wed Apr 5 17:53:21 EDT 2017


It may be worthwhile to write a script to generate all these negative test cases and then to save them as negative tests for the compiler.

Since many of these programs may have a lot of boilerplate in common maybe we can just have a common #include file for the boilerplate.

Mihai

From: P4-design [mailto:p4-design-bounces at lists.p4.org] On Behalf Of Andy Fingerhut (jafinger)
Sent: Wednesday, April 5, 2017 9:15 AM
To: p4-design at lists.p4.org
Subject: Re: [P4-design] Diagram of where P4_16 language constructs can be used

I still don’t have package instantiations mentioned anywhere, nor extern function calls, but I think everything else is there now.

I also have a text file version, which is a little more compact and easier to open in an editor:

https://github.com/jafingerhut/p4-guide/blob/master/p4-16-allowed-constructs.txt<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jafingerhut_p4-2Dguide_blob_master_p4-2D16-2Dallowed-2Dconstructs.txt&d=DwMGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=o3XrPrJm7YD8DPPbgLLAmtRnYgiC204Em5kbngxnNFQ&s=kx3vJW-ZvQTp0qCNIdBo2zMobCskbD-uueNohL0B42w&e=>

I also happen to have a horribly ugly P4 program that exercises all of the allowed things at least once, plus hundreds of lines of commented-out things that cause the compiler to give errors.  The positive test case for supported things I can see as being useful, but the number of individual negative test cases here really is quite a lot, and I’d think if one wanted such things for the compiler, it is probably easier to auto-generate them with a program from some kind of template.

Andy


From: P4-design <p4-design-bounces at lists.p4.org<mailto:p4-design-bounces at lists.p4.org>> on behalf of "Andy Fingerhut (jafinger)" <jafinger at cisco.com<mailto:jafinger at cisco.com>>
Date: Sunday, April 2, 2017 at 1:52 PM
To: "p4-design at lists.p4.org<mailto:p4-design at lists.p4.org>" <p4-design at lists.p4.org<mailto:p4-design at lists.p4.org>>
Subject: [P4-design] Diagram of where P4_16 language constructs can be used

It isn’t complete, e.g. I haven’t included where parser/control/extern instantiations and method calls can go, and it doesn’t mention enum, tuple, and a few other type definitions, but it does meet my original goal of showing where most of the language constructs can be used in a P4_16 program relative to each other.

https://github.com/jafingerhut/p4-guide/blob/master/p4-16-allowed-constructs.pdf<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jafingerhut_p4-2Dguide_blob_master_p4-2D16-2Dallowed-2Dconstructs.pdf&d=DwMGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=o3XrPrJm7YD8DPPbgLLAmtRnYgiC204Em5kbngxnNFQ&s=cd4-2Yu0wf2aZH3bW0HKt7RrZrh_d9w3oKvCwicvwn8&e=>
https://github.com/jafingerhut/p4-guide/blob/master/p4-16-allowed-constructs.png<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jafingerhut_p4-2Dguide_blob_master_p4-2D16-2Dallowed-2Dconstructs.png&d=DwMGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=o3XrPrJm7YD8DPPbgLLAmtRnYgiC204Em5kbngxnNFQ&s=CZiBP_QxabMiFpP4OYiw9WaEvtHM8sKpN7sPym48Zss&e=>

GraphViz dot input file used to generate the figures here:

https://github.com/jafingerhut/p4-guide/blob/master/p4-16-allowed-constructs.dot<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jafingerhut_p4-2Dguide_blob_master_p4-2D16-2Dallowed-2Dconstructs.dot&d=DwMGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=o3XrPrJm7YD8DPPbgLLAmtRnYgiC204Em5kbngxnNFQ&s=tg3jPR8IHnuZd7iCLBv0t2lMg2yvIMcQcgtk2V0z9GU&e=>

Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-design_lists.p4.org/attachments/20170405/30d87da7/attachment-0002.html>


More information about the P4-design mailing list