[P4-dev] Convert HLIR or JSON back to P4 source code
dmwu0506 at gmail.com
Thu Oct 18 01:42:38 EDT 2018
Got it. Thank you Antonin.
On Wed, Oct 17, 2018 at 3:20 PM Antonin Bas <antonin at barefootnetworks.com>
> Some HLIR objects have a dump_to_p4 method but I'm pretty sure it's
> missing for most, so you would have to write that code yourself. p4-hlir is
> in maintenance mode and we do not add new features anymore. I recommend
> that you look at the new p4c compiler (https://github.com/p4lang/p4c)
> which supports both P4_14 and P4_16. It has its own C++ IR and is in active
> On Wed, Oct 17, 2018 at 2:29 PM Dingming Wu <dmwu0506 at gmail.com> wrote:
>> 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 code.
>> 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
>> P4-dev mailing list
>> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev