P4C
The P4 Compiler
|
#include <p4RuntimeArchHandler.h>
Public Member Functions | |
virtual void | addExternEntries (const p4::v1::WriteRequest *entries, const P4RuntimeSymbolTableIface &symbols, const IR::ExternBlock *externBlock)=0 |
This method is called to add target specific extern entries. | |
virtual void | addExternFunction (const P4RuntimeSymbolTableIface &symbols, ::p4::config::v1::P4Info *p4info, const P4::ExternFunction *externFunction)=0 |
virtual void | addExternInstance (const P4RuntimeSymbolTableIface &symbols, ::p4::config::v1::P4Info *p4info, const IR::ExternBlock *externBlock)=0 |
virtual void | addTableProperties (const P4RuntimeSymbolTableIface &symbols, ::p4::config::v1::P4Info *p4info, ::p4::config::v1::Table *table, const IR::TableBlock *tableBlock)=0 |
virtual void | collectAssignmentStatement (P4RuntimeSymbolTableIface *symbols, const IR::AssignmentStatement *assign)=0 |
Collects architecture-specific used in assignment statements. | |
virtual void | collectExternFunction (P4RuntimeSymbolTableIface *symbols, const P4::ExternFunction *externFunction)=0 |
virtual void | collectExternInstance (P4RuntimeSymbolTableIface *symbols, const IR::ExternBlock *externBlock)=0 |
Collects architecture-specific @externBlock instance in @symbols table. | |
virtual void | collectExternMethod (P4RuntimeSymbolTableIface *symbols, const P4::ExternMethod *externMethod)=0 |
Collects architecture-specific @externMethod instance in @symbols table. | |
virtual void | collectExtra (P4RuntimeSymbolTableIface *symbols)=0 |
virtual void | collectTableProperties (P4RuntimeSymbolTableIface *symbols, const IR::TableBlock *tableBlock)=0 |
virtual bool | filterAnnotations (cstring anno)=0 |
called when processing annotations via setPreamble | |
virtual cstring | getControlPlaneName (const IR::Block *block) |
Get control plane name for @block. | |
virtual google::protobuf::util::JsonPrintOptions | getJsonPrintOptions ()=0 |
Control how JSON is output. | |
virtual void | postAdd (const P4RuntimeSymbolTableIface &symbols, ::p4::config::v1::P4Info *p4info)=0 |
virtual void | postCollect (const P4RuntimeSymbolTableIface &symbols)=0 |
The interface for defining the P4Info serialization logic for a specific P4 architecture. The goal is to reduce code duplication between architectures. The P4RuntimeSerializer will call these methods when generating the P4Info message to handle architecture-specific parts. P4RuntimeSerializer generates the P4Info in two passes: first it collects all the control-plane visible symbols from the program into the symbol table, then it builds the P4Info message by adding each collected entity to the Protobuf message. The collect* methods are called in the first pass, the add* methods are called in the second pass.
|
pure virtual |
This method is called to add target specific extern entries.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
Adds relevant information about @externFunction method call - if it needs to be exposed to the control-plane - to @p4info message.
|
pure virtual |
Adds relevant information about @externBlock instance to the @p4info message.
|
pure virtual |
Adds architecture-specific properties for @tableBlock to the @table Protobuf message.
|
pure virtual |
Collects architecture-specific used in assignment statements.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
Collects extern method call @externFunction in @symbols table in case it needs to be exposed to the control-plane (e.g. digest call for v1model).
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model.
|
pure virtual |
Collects architecture-specific @externBlock instance in @symbols table.
Implemented in P4::ControlPlaneAPI::Standard::BFRuntimeArchHandler< arch >, P4::ControlPlaneAPI::Standard::BFRuntimeArchHandler< Arch::PNA >, P4::ControlPlaneAPI::Standard::BFRuntimeArchHandler< Arch::PSA >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerPSAPNA< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerPSAPNA< Arch::PNA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerPSAPNA< Arch::PSA >.
|
pure virtual |
Collects architecture-specific @externMethod instance in @symbols table.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
Collects any extra symbols you may want to include in the symbol table and that are not covered by the above collection methods.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
Collects architecture-specific properties for @tableBlock in @symbols table.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
called when processing annotations via setPreamble
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
|
pure virtual |
This method is called after the add pass in case the architecture requires some logic to be performed then.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.
|
pure virtual |
This method is called between the two passes (collect and add) in case the architecture requires some logic to be performed then.
Implemented in P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >, P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::PSA >, and P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.