Skip to content

Correcting the use of the compiler #24

@rhl-bthr

Description

@rhl-bthr

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions