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

Antonin Bas antonin at barefootnetworks.com
Wed Nov 2 12:39:37 EDT 2016


Hi Jahandad,

For follow-up questions, please use the existing thread started by Hemant
or start your own thread. Do not use the digest thread.
Regarding your question, pragmas attached to top-level P4 objects can be
accessed using the _pragmas attribute of the corresponding Python HLIR
object.

For example, if my P4 code is as follows:
@pragma p1
@pragma p2 v
table t1 {
    actions { a1; }
    default_action : a1(9);
}

I can access t1's pragmas with: h.p4_tables['t1']._pragmas
which in this case will return me the following Python set: set(['p2 v',
'p1'])

Best,

Antonin

On Wed, Nov 2, 2016 at 9:04 AM, Jahandad Khan <jehandad at vt.edu> wrote:

> 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
>



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


More information about the P4-dev mailing list