[P4-dev] P4-dev Digest, Vol 15, Issue 4

Antonin Bas antonin at barefootnetworks.com
Wed Nov 2 12:35:27 EDT 2016


Hi Pavel,

Your answer is correct. Would you mind replying directly to the thread
started by Hemant, instead of the digest thread here? It will make the
answer easier to find in the future.

Thanks

On Wed, Nov 2, 2016 at 9:28 AM, Pavel Chuprikov <pschuprikov at gmail.com>
wrote:

> The PP directives are lost on a very early stage
> <https://github.com/p4lang/p4-hlir/blob/master/p4_hlir/frontend/preprocessor.py#L48>
> when the input is fed to *gcc*.
>
> If those directives are actually used in p4 code, I can suggest to query
> the p4 object that depends on those directives, e.g., whether some
> conditionally compiled action is present or, if you have something like *field_name
> : SOME_MACRO*, what is the width of the field.
>
> Regards,
> Pavel
>
>
> ср, 2 нояб. 2016 г. в 17:05, Jahandad Khan <jehandad at vt.edu>:
>
> Hi,
>
> Following up on Hemant's question, alternatively if there is a #pragma
> used, can it be queried in the HLIR. Currently, there is not support for
> such a feature in HLIR document.
>
> Regards,
> Jehandad
>
> On Wed, Nov 2, 2016 at 12:00 PM <p4-dev-request at lists.p4.org> wrote:
>
> Send P4-dev mailing list submissions to
>         p4-dev at lists.p4.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
> or, via email, send a message with subject or body 'help' to
>         p4-dev-request at lists.p4.org
>
> You can reach the person managing the list at
>         p4-dev-owner at lists.p4.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of P4-dev digest..."
>
>
> Today's Topics:
>
>    1. preprocessor support in HLIR? (hemant at mnkcg.com)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 2 Nov 2016 10:59:34 -0400
> From: <hemant at mnkcg.com>
> To: <p4-dev at lists.p4.org>
> Subject: [P4-dev] preprocessor support in HLIR?
> Message-ID: <002b01d23519$b99d6440$2cd82cc0$@mnkcg.com>
> Content-Type: text/plain; charset="utf-8"
>
> If one adds a C  ?#define VAR_FOO 1? in P4 code, does HLIR generate an IR
> for it?  One needs the defines in the back-end compiler.
>
>
>
> Thanks,
>
>
>
> Hemant
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/
> attachments/20161102/01419270/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at p4.org
> Listinfo - http://mail.p4.org/mailman/listinfo/p4-dev_p4.org
> Archives - http://mail.p4.org/pipermail/p4-dev_p4.org/
>
>
> ------------------------------
>
> End of P4-dev Digest, Vol 15, Issue 4
> *************************************
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161102/ae55bec6/attachment-0002.html>


More information about the P4-dev mailing list