Currently what we are doing in the top-level bash script p4-traffictool.sh is very weird - we are invoking the backend p4c-bm2-ss first and if it fails then we are invoking the frontend p4c. Ideally speaking we do NOT need to invoke any backend for our purpose. We only need the header and parser definitions as per standard P4_16.
[x] Try and use only the p4c frontend by default. No backends need to be invoked.
[ ] If the above works correctly, then with proper addition of an include path, the p4c frontend should be able to handle code written for any architecture (NetFPGA, Tofino). See how microP4 does it. In fact, Barefoot's proprietary compiler uses the open-source p4c compiler frontend. This should take away a lot of pain in using the tool for programs written for Barefoot Tofino and avoid workarounds like --only-headers.
Currently what we are doing in the top-level bash script
p4-traffictool.sh
is very weird - we are invoking the backendp4c-bm2-ss
first and if it fails then we are invoking the frontendp4c
. Ideally speaking we do NOT need to invoke any backend for our purpose. We only need the header and parser definitions as per standard P4_16.--only-headers
.