![]() |
P4C
The P4 Compiler
|
Public Member Functions | |
| void | addAction (const IR::P4Action *actionDeclaration) |
| void | addControllerHeader (const IR::Type_Header *type) |
| void | addExtern (const IR::ExternBlock *externBlock) |
| void | addPkgInfo (const IR::ToplevelBlock *evaluatedProgram, cstring arch) const |
| void | addTable (const IR::TableBlock *tableBlock) |
| void | addValueSet (const IR::P4ValueSet *inst) |
| void | analyzeControl (const IR::ControlBlock *controlBlock) |
| void | postAdd () const |
Static Public Member Functions | |
| static P4RuntimeAPI | analyze (const IR::P4Program *program, const IR::ToplevelBlock *evaluatedProgram, ReferenceMap *refMap, TypeMap *typeMap, P4RuntimeArchHandlerIface *archHandler, cstring arch) |
An analyzer which translates the information available in the P4 IR into a representation of the control plane API which is consumed by P4Runtime.
|
inline |
Sets the pkg_info field of the P4Info message, using the annotations on the P4 program package.
|
inline |
Look for a @match annotation on the struct field and set the match type of the match field appropriately.
|
static |
Analyze a P4 program and generate a P4Runtime control plane API.
| program | The P4 program to analyze. |
| evaluatedProgram | An up-to-date evaluated version of the program. |
| refMap | An up-to-date reference map. |
| refMap | An up-to-date type map. |
| archHandler | An implementation of P4RuntimeArchHandlerIface which handles architecture-specific constructs (e.g. externs). |
| arch | The name of the P4_16 architecture the program was written against. |
|
inline |
To be called after all objects have been added to P4Info. Calls the architecture-specific postAdd method for post-processing.