[P4-dev] Implementing externs

Mihai Budiu mbudiu at vmware.com
Fri May 5 14:07:18 EDT 2017


Externs are specific to an architecture, so each back-end must know how to handle the externs of its target architecture. On software architectures it makes sense to allow users to extend the space of externs by providing software implementations for new ones, but currently none of the backends in plang/p4c allows that. This should be doable, but nobody worked on this topic. Maybe you can file an issue with the compiler so we have it on our todo list.



Mihai



From: Rui Miguel<mailto:rmiguel at lasige.di.fc.ul.pt>
Sent: Friday, May 5, 2017 10:43 AM
To: p4-dev lists.p4.org<mailto:p4-dev at lists.p4.org>
Subject: [P4-dev] Implementing externs



Greetings!

After briefly analyzing the JSON representation of an extern declaration, I'm wondering where to implement extern functionality. I imagine there's a C++ class that can be extended? Is it plausible to use the v1model.p4 architecture along with an extern block declared in my header definitions file? (I suppose for hardware targets the P4 programmer shouldn't be declaring externs of his own, but is it legit to change v1model?)

This comes after an attempt to study the project files, but for someone who isn't much into C++, compilers or the project itself, things look a tad cryptic overall.

Thanks in advance,
~ Rui Miguel
--




_______________________________________________
P4-dev mailing list
P4-dev at lists.p4.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=oO8cD9N3OzWxmeKyxz_9esu-JnDu8Ez_EzE5XShNHFg&s=V98Ch9BD1R6MZaEHE2_0UxJg6y3lViXJUZvIQ_eG-sg&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170505/96963ddc/attachment-0002.html>


More information about the P4-dev mailing list