P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo Class Reference
Inheritance diagram for P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo:
[legend]

Public Member Functions

 EBPFProgramInfo (const TestgenCompilerResult &compilerResult, ordered_map< cstring, const IR::Type_Declaration * > inputBlocks)
 
 DECLARE_TYPEINFO (EBPFProgramInfo, ProgramInfo)
 
const IR::Expression * dropIsActive () const override
 
const ArchSpecgetArchSpec () const override
 
const IR::Type_Bits * getParserErrorType () const override
 
const ordered_map< cstring, const IR::Type_Declaration * > * getProgrammableBlocks () const
 
const IR::StateVariable & getTargetInputPortVar () const override
 
const IR::StateVariable & getTargetOutputPortVar () const override
 
- Public Member Functions inherited from P4::P4Tools::P4Testgen::ProgramInfo
 ProgramInfo (const ProgramInfo &)=default
 
 ProgramInfo (ProgramInfo &&)=default
 
virtual const IR::Expression * createTargetUninitialized (const IR::Type *type, bool forceTaint) const
 
 DECLARE_TYPEINFO (ProgramInfo)
 
const NodesCallGraphgetCallGraph () const
 
cstring getCanonicalBlockName (cstring programBlockName) const
 
virtual const TestgenCompilerResultgetCompilerResult () const
 
const ConcolicMethodImplsgetConcolicMethodImpls () const
 
const P4::Coverage::CoverageSetgetCoverableNodes () const
 Getter to access coverableNodes.
 
const IR::P4Program & getP4Program () const
 
const std::vector< Continuation::Command > * getPipelineSequence () const
 
std::optional< const IR::Expression * > getTargetConstraints () const
 
ProgramInfooperator= (const ProgramInfo &)=default
 
ProgramInfooperator= (ProgramInfo &&)=default
 
void produceCopyInOutCall (const IR::Parameter *param, size_t paramIdx, const ArchSpec::ArchMember *archMember, std::vector< Continuation::Command > *copyIns, std::vector< Continuation::Command > *copyOuts) const
 
- Public Member Functions inherited from P4::ICastable
template<typename T >
T & as ()
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
const T & as () const
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
T * checkedTo ()
 Performs a checked cast. A BUG occurs if the cast fails.
 
template<typename T >
const T * checkedTo () const
 Performs a checked cast. A BUG occurs if the cast fails.
 
- Public Member Functions inherited from P4::RTTI::Base
template<typename T >
bool is () const noexcept
 
virtual bool isA (TypeId typeId) const noexcept=0
 
template<typename T >
const T * to () const noexcept
 Same as to, but returns const pointer to T.
 
template<typename T >
T * to () noexcept
 
virtual TypeId typeId () const noexcept=0
 

Static Public Attributes

static const ArchSpec ARCH_SPEC
 

Additional Inherited Members

- Protected Member Functions inherited from P4::P4Tools::P4Testgen::ProgramInfo
 ProgramInfo (const TestgenCompilerResult &compilerResult)
 
- Protected Member Functions inherited from P4::RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 
- Protected Attributes inherited from P4::P4Tools::P4Testgen::ProgramInfo
ordered_map< cstring, cstringblockMap
 Maps the programmable blocks in the P4 program to their canonical counterpart.
 
ConcolicMethodImpls concolicMethodImpls
 
std::vector< Continuation::Command > pipelineSequence
 The execution sequence of the P4 program.
 
std::optional< const IR::Expression * > targetConstraints = std::nullopt
 The constraints imposed by the target.
 

Constructor & Destructor Documentation

◆ EBPFProgramInfo()

P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::EBPFProgramInfo ( const TestgenCompilerResult & compilerResult,
ordered_map< cstring, const IR::Type_Declaration * > inputBlocks )

Compute the series of nodes corresponding to the in-order execution of top-level pipeline-component instantiations. For a standard ebpf_model, this produces the parser and the filter. This sequence also includes nodes that handle transitions between the individual component instantiations.

Member Function Documentation

◆ dropIsActive()

const IR::Expression * P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::dropIsActive ( ) const
nodiscardoverridevirtual
Returns
an expression that checks whether the packet is to be dropped. The computation is target specific.

Implements P4::P4Tools::P4Testgen::ProgramInfo.

◆ getArchSpec()

const ArchSpec & P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::getArchSpec ( ) const
nodiscardoverridevirtual
See also
ProgramInfo::getArchSpec

Implements P4::P4Tools::P4Testgen::ProgramInfo.

◆ getParserErrorType()

const IR::Type_Bits * P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::getParserErrorType ( ) const
nodiscardoverridevirtual

◆ getProgrammableBlocks()

const ordered_map< cstring, const IR::Type_Declaration * > * P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::getProgrammableBlocks ( ) const
nodiscard
Returns
the programmable blocks of the program. Should be 6.

◆ getTargetInputPortVar()

const IR::StateVariable & P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::getTargetInputPortVar ( ) const
nodiscardoverridevirtual
Returns
the metadata member corresponding to the ingress port

Implements P4::P4Tools::P4Testgen::ProgramInfo.

◆ getTargetOutputPortVar()

const IR::StateVariable & P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::getTargetOutputPortVar ( ) const
nodiscardoverridevirtual
Returns
the metadata member corresponding to the final output port

Implements P4::P4Tools::P4Testgen::ProgramInfo.

Member Data Documentation

◆ ARCH_SPEC

const ArchSpec P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo::ARCH_SPEC
static
Initial value:
=
ArchSpec("ebpfFilter"_cs, {
{"parse"_cs, {nullptr, "*hdr"_cs}},
{"filter"_cs, {"*hdr"_cs, "*accept"_cs}}})
See also
ProgramInfo::getArchSpec