[P4-dev] extern function return in backend

Mihai Budiu mbudiu at vmware.com
Fri Oct 20 12:05:27 EDT 2017


Did you try the combination of flags -v --topP4 pass?
It will dump the program representation including the IR as comments.

Mihai

From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of hemant at mnkcg.com
Sent: Friday, October 20, 2017 8:58 AM
To: 'p4-dev' <p4-dev at lists.p4.org>
Subject: [P4-dev] extern function return in backend

The extern below has a function returning bool.  The args of the function are not relevant to my question and thus are replaced with ellipses.

extern myExtern {
       myExtern();
       bool compare(...);
};

I know args to an extern function are obtained by backend software as follows, such as getting the first arg:

method->expr->arguments->at(0);

How does one get the bool returned from the function in backend to see if the frontend P4 program used "!extvar.compare()" or "extvar.compare()"?

Hemant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171020/d49a0721/attachment-0002.html>


More information about the P4-dev mailing list