P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model Class Referencefinal
Inheritance diagram for P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model:
[legend]

Public Member Functions

 P4RuntimeArchHandlerV1Model (ReferenceMap *refMap, TypeMap *typeMap, const IR::ToplevelBlock *evaluatedProgram)
 
void addExternFunction (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4info, const P4::ExternFunction *externFunction) override
 
void addTableProperties (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4info, p4configv1::Table *table, const IR::TableBlock *tableBlock) override
 
void collectExternFunction (P4RuntimeSymbolTableIface *symbols, const P4::ExternFunction *externFunction) override
 
- Public Member Functions inherited from P4::ControlPlaneAPI::P4RuntimeArchHandlerIface
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 cstring getControlPlaneName (const IR::Block *block)
 Get control plane name for @block.
 

Static Public Member Functions

static std::optional< DigestgetDigestCall (const P4::ExternFunction *function, ReferenceMap *refMap, P4::TypeMap *typeMap, p4configv1::P4TypeInfo *p4RtTypeInfo)
 
static bool getSupportsTimeout (const IR::P4Table *table)
 

Additional Inherited Members

- Protected Types inherited from P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >
using ArchCounterExtern
 
using ArchMeterExtern
 
using Counter
 
using CounterSpec
 
using CounterTraits
 
using Meter
 
using MeterSpec
 
using MeterTraits
 
- Protected Member Functions inherited from P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >
 P4RuntimeArchHandlerCommon (ReferenceMap *refMap, TypeMap *typeMap, const IR::ToplevelBlock *evaluatedProgram)
 
void addActionProfile (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4Info, const ActionProfile &actionProfile)
 
void addCounter (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4Info, const Helpers::Counterlike< ArchCounterExtern > &counterInstance)
 
void addDigest (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4Info, const Digest &digest)
 
void addExternEntries (const p4::v1::WriteRequest *, const P4RuntimeSymbolTableIface &, const IR::ExternBlock *) override
 This method is called to add target specific extern entries.
 
void addExternFunction (const P4RuntimeSymbolTableIface &, p4configv1::P4Info *, const P4::ExternFunction *) override
 
void addExternInstance (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4info, const IR::ExternBlock *externBlock) override
 
void addMeter (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4Info, const Helpers::Counterlike< ArchMeterExtern > &meterInstance)
 
void addRegister (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4Info, const Register &registerInstance)
 
void addTableProperties (const P4RuntimeSymbolTableIface &symbols, p4configv1::P4Info *p4info, p4configv1::Table *table, const IR::TableBlock *tableBlock) override
 
void collectAssignmentStatement (P4RuntimeSymbolTableIface *, const IR::AssignmentStatement *) override
 Collects architecture-specific used in assignment statements.
 
void collectExternInstance (P4RuntimeSymbolTableIface *symbols, const IR::ExternBlock *externBlock) override
 Collects architecture-specific @externBlock instance in @symbols table.
 
void collectExternMethod (P4RuntimeSymbolTableIface *, const P4::ExternMethod *) override
 Collects architecture-specific @externMethod instance in @symbols table.
 
void collectExtra (P4RuntimeSymbolTableIface *symbols) override
 
void collectTableProperties (P4RuntimeSymbolTableIface *symbols, const IR::TableBlock *tableBlock) override
 
bool filterAnnotations (cstring) override
 called when processing annotations via setPreamble
 
google::protobuf::util::JsonPrintOptions getJsonPrintOptions () override
 Control how JSON is output.
 
void postAdd (const P4RuntimeSymbolTableIface &, ::p4::config::v1::P4Info *) override
 
void postCollect (const P4RuntimeSymbolTableIface &symbols) override
 
void setCounterCommon (const P4RuntimeSymbolTableIface &symbols, Kind *counter, p4rt_id_t id, const Helpers::Counterlike< ArchCounterExtern > &counterInstance)
 Set common fields between Counter and DirectCounter.
 
void setMeterCommon (const P4RuntimeSymbolTableIface &symbols, Kind *meter, p4rt_id_t id, const Helpers::Counterlike< ArchMeterExtern > &meterInstance)
 Set common fields between Meter and DirectMeter.
 
- Static Protected Member Functions inherited from P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >
static std::optional< ActionProfilegetActionProfile (const IR::ExternBlock *instance)
 
static std::optional< ActionProfilegetActionProfile (const IR::P4Table *table, ReferenceMap *refMap, TypeMap *typeMap)
 
static std::optional< ActionProfilegetActionProfile (cstring name, const IR::Type_Extern *type, int64_t size, const IR::IAnnotated *annotations)
 
static const IR::IAnnotated * getTableImplementationAnnotations (const IR::P4Table *table, ReferenceMap *refMap)
 
static std::optional< cstringgetTableImplementationName (const IR::P4Table *table, ReferenceMap *refMap)
 
static const IR::Property * getTableImplementationProperty (const IR::P4Table *table)
 
- Protected Attributes inherited from P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >
std::unordered_map< cstring, std::set< cstring > > actionProfilesRefs
 
const IR::ToplevelBlock * evaluatedProgram
 
google::protobuf::util::JsonPrintOptions jsonPrintOptions
 
ReferenceMaprefMap
 
std::set< p4rt_id_t > serializedInstances
 The extern instances we've serialized so far. Used for deduplication.
 
TypeMaptypeMap
 

Detailed Description

Implements P4RuntimeArchHandlerIface for the v1model architecture. The overridden methods will be called by the @P4RuntimeSerializer to collect and serialize v1model-specific symbols which are exposed to the control-plane.

Member Function Documentation

◆ collectExternFunction()

void P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model::collectExternFunction ( P4RuntimeSymbolTableIface * symbols,
const P4::ExternFunction * externFunction )
inlineoverridevirtual

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

Reimplemented from P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< Arch::V1MODEL >.

◆ getDigestCall()

static std::optional< Digest > P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model::getDigestCall ( const P4::ExternFunction * function,
ReferenceMap * refMap,
P4::TypeMap * typeMap,
p4configv1::P4TypeInfo * p4RtTypeInfo )
inlinestatic
Returns
serialization information for the digest() call represented by @call, or std::nullopt if @call is not a digest() call or is invalid.

◆ getSupportsTimeout()

static bool P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerV1Model::getSupportsTimeout ( const IR::P4Table * table)
inlinestatic
Returns
true if @table's 'support_timeout' property exists and is true. This indicates that @table supports entry ageing.