[P4-dev] Article on P4 code generation

hemant at mnkcg.com hemant at mnkcg.com
Thu Feb 6 23:27:10 EST 2020


Andy,



Good start.  Regarding pcube, there are slides one can refer to as well.



https://p4.org/assets/P4WE_2018/Rinku_Shah.pdf



I prefer using Lisp over Bison and Flex.  I find Lisp easy to use to generate 
code.  If the code generation gets more complex, we could add some formal 
verification.



For Other Topics, consider the following:



Timestamp using integers vs. floating point numbers as another paragraph.



Hemant



From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Andy Fingerhut
Sent: Thursday, February 06, 2020 10:10 PM
To: p4-dev <p4-dev at lists.p4.org>
Subject: [P4-dev] Article on P4 code generation



A few times people have asked questions on this list, where a suggestion was 
given to use another small program to generate P4 code, then compile that.



Some may view this as working around limitations in the language.  In some 
cases, I simply see it as "getting the job at hand done".



The code examples in the article were ones that arose in this email list, so 
nothing new if you have been following along for a couple of years, but 
perhaps having the article in its somewhat more fleshed-out form like this can 
be useful to provide a link for interested parties to read, when the topic 
arises:



https://github.com/jafingerhut/p4-guide/tree/master/code-generation



Comments, questions, corrections all welcome.



Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20200206/a213ba45/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1594 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20200206/a213ba45/attachment.p7s>


More information about the P4-dev mailing list