P4C
The P4 Compiler
|
Namespaces | |
namespace | P4::ControlPlaneAPI |
TODO(antonin): High level goals of the generator go here!! | |
P4RuntimeAPI P4::generateP4Runtime | ( | const IR::P4Program * | program, |
cstring | arch = "v1model"_cs ) |
Calls P4RuntimeSerializer::generateP4Runtime on the P4RuntimeSerializer singleton.
P4RuntimeAPI P4::P4RuntimeSerializer::generateP4Runtime | ( | const IR::P4Program * | program, |
cstring | arch ) |
Generate a P4Runtime control-plane API for the provided program and architecture.
API generation never fails, but if errors are encountered in the program some constructs may be excluded from the API. In this case, a program error will be reported.
program | The program to construct the control-plane API from. All frontend passes must have already run. |
|
static |
void P4::P4RuntimeAPI::serializeEntriesTo | ( | std::ostream * | destination, |
P4RuntimeFormat | format ) const |
Serialize the WriteRequest message containing all the table entries to the @destination stream in the requested protobuf serialization @format.
void P4::P4RuntimeAPI::serializeP4InfoTo | ( | std::ostream * | destination, |
P4RuntimeFormat | format ) const |
Serialize this control-plane API to the provided output stream, using the given serialization format.
void P4::P4RuntimeSerializer::serializeP4RuntimeIfRequired | ( | const IR::P4Program * | program, |
const CompilerOptions & | options ) |
A convenience wrapper for P4::generateP4Runtime() which generates the P4RuntimeAPI structure for the provided program and serializes it according to the provided command-line options.
program | The program to construct the control-plane API from. All frontend passes must have already run. |
options | The command-line options used to invoke the compiler. |
void P4::P4RuntimeSerializer::serializeP4RuntimeIfRequired | ( | const P4RuntimeAPI & | p4Runtime, |
const CompilerOptions & | options ) |
Serializes an existing P4RuntimeAPI structure generated by P4::generateP4Runtime(), according to the provided command-line options.
program | The program to construct the control-plane API from. All frontend passes must have already run. |
options | The command-line options used to invoke the compiler. |
void P4::serializeP4RuntimeIfRequired | ( | const IR::P4Program * | program, |
const CompilerOptions & | options ) |
Calls P4RuntimeSerializer::serializeP4RuntimeIfRequired on the P4RuntimeSerializer singleton.