[P4-dev] Convert HLIR or JSON back to P4 source code

Dingming Wu dmwu0506 at gmail.com
Wed Oct 17 17:28:44 EDT 2018

Hi All,

The standard P4 compiler frontend will generate a HLIR object from the P4
source. I was wondering whether there is  a tool/methodology to convert
this HLIR object back into a p4 source file?

Basically, what I want to do is to modify the HLIR object, e.g., change
some table properties or add new tables/actions. It is desirable for us to
do this modifications  without touching the original P4 source code.
If switch targets do not consume P4 program in the HLIR format (does tofino
accept that? Not sure), we will then have to convert HLIR back to source

Similarly, can we generate the JSON file from a source file, do some
modifications to the JSON file and then convert it back into source code?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20181017/5fb41ec8/attachment.html>

More information about the P4-dev mailing list