[P4-dev] p4c compiler output in .p4i

Mihai Budiu mbudiu at vmware.com
Thu Jun 8 16:56:25 EDT 2017


If the user does not ask for the preprocessor output it probably should not be persisted.

Mihai

From: Han Wang<mailto:hw342 at cornell.edu>
Sent: Thursday, June 8, 2017 1:50 PM
To: hemant at mnkcg.com<mailto:hemant at mnkcg.com>
Cc: p4-dev<mailto:p4-dev at lists.p4.org>
Subject: Re: [P4-dev] p4c compiler output in .p4i

Hi Hemant,

p4c is a compiler driver that invokes the other components of the p4 tool chain to process a p4 program. Specifically, for bmv2, the compiler driver invokes preprocessor and p4c-bm2-ss to generate the output json configuration for bmv2.

You can use the -### flag or --test-only flag to find out which commands are invoked by p4c compiler driver.

In this case, the .p4i file is the output of the preprocessor step.

Han

On Jun 8, 2017, at 1:40 PM, hemant at mnkcg.com<mailto:hemant at mnkcg.com> wrote:

The compiler-design slides included with the docs for the p4c compiler do not include some details.  Thus a question:

When I use p4c to compile P4-16 code in a .p4 file, the compiler outputs a .p4i file.  Looking at this file, it looks like IR (Intermediate Representation) to me – am I correct?   It would be good to describe this output file in the docs.

Thanks,

Hemant

_______________________________________________
P4-dev mailing list
P4-dev at lists.p4.org<mailto:P4-dev at lists.p4.org>
http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=mxVqcKO0_YNv9fvsa51x2sIe5FqLSahhehaWAkitOIM&s=p2vE4hySDr0X7wNi0pY_j0ni2cjpJWKI-Ycuoaj4aUY&e=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170608/52cf5f72/attachment-0002.html>


More information about the P4-dev mailing list