[P4-dev] control-plane API generation

Antonin Bas antonin at barefootnetworks.com
Mon Sep 10 10:08:31 EDT 2018


This is a hard rule as far as I'm concerned. We actually worked hard to
ensure that API generation happens right after the frontend and does not
depend on the backend (or the midend passes that this backend chooses to
use). The generated P4Info message should be exactly the same independently
of which backend you are using.
What we can do though is invoke midend passes independently of the backend
in the P4Info generation code (https://github.com/p4lang/
p4c/blob/master/control-plane/p4RuntimeSerializer.cpp#L1328). I believe
that usually it is best avoided: you want the P4Info message / the runtime
APIs to match exactly the contents of the P4 program.

On Wed, Sep 5, 2018 at 1:33 PM, <hemant at mnkcg.com> wrote:

> In the bmv2 backend, I see that P4Runtime/control-plane API generation is
> called in p4c/backends/bmv2/simple_switch/main.cpp after
> frontend.run().   Is this a hard rule or can one move the API generation,
> for example, to be after midend.process()?
>
>
>
> Thanks in advance.
>
>
>
> Hemant
>
>
>
> MNK Consulting
>
> http://mnkcg.com
>
>
>
> _______________________________________________
> 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/20180910/1633d9a5/attachment.html>


More information about the P4-dev mailing list