P4C
The P4 Compiler
|
Stores target-specific information about a P4 program. More...
#include <program_info.h>
Public Member Functions | |
ProgramInfo (const ProgramInfo &)=default | |
ProgramInfo (ProgramInfo &&)=default | |
virtual const IR::Expression * | createTargetUninitialized (const IR::Type *type, bool forceTaint) const |
DECLARE_TYPEINFO (ProgramInfo) | |
virtual const IR::Expression * | dropIsActive () const =0 |
virtual const ArchSpec & | getArchSpec () const =0 |
const NodesCallGraph & | getCallGraph () const |
cstring | getCanonicalBlockName (cstring programBlockName) const |
virtual const TestgenCompilerResult & | getCompilerResult () const |
const ConcolicMethodImpls * | getConcolicMethodImpls () const |
const P4::Coverage::CoverageSet & | getCoverableNodes () const |
Getter to access coverableNodes. | |
const IR::P4Program & | getP4Program () const |
virtual const IR::Type_Bits * | getParserErrorType () const =0 |
const std::vector< Continuation::Command > * | getPipelineSequence () const |
std::optional< const IR::Expression * > | getTargetConstraints () const |
virtual const IR::StateVariable & | getTargetInputPortVar () const =0 |
virtual const IR::StateVariable & | getTargetOutputPortVar () const =0 |
ProgramInfo & | operator= (const ProgramInfo &)=default |
ProgramInfo & | operator= (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 |
Protected Member Functions | |
ProgramInfo (const TestgenCompilerResult &compilerResult) | |
Protected Member Functions inherited from P4::RTTI::Base | |
virtual const void * | toImpl (TypeId typeId) const noexcept=0 |
Protected Attributes | |
ordered_map< cstring, cstring > | blockMap |
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. | |
Stores target-specific information about a P4 program.
|
virtual |
forceTaint | is active, this function always returns a taint variable. |
|
nodiscardpure virtual |
Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelProgramInfo, P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo, and P4::P4Tools::P4Testgen::Pna::SharedPnaProgramInfo.
|
nodiscardpure virtual |
A vector that maps the architecture parameters of each pipe to the corresponding global architecture variables. For example, this map specifies which parameter of each pipe refers to the input header.
Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelProgramInfo, P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo, and P4::P4Tools::P4Testgen::Pna::PnaDpdkProgramInfo.
|
nodiscard |
|
nodiscard |
|
nodiscardvirtual |
Reimplemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelProgramInfo.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscardpure virtual |
Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelProgramInfo, P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo, and P4::P4Tools::P4Testgen::Pna::SharedPnaProgramInfo.
|
nodiscardpure virtual |
Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelProgramInfo, P4::P4Tools::P4Testgen::EBPF::EBPFProgramInfo, and P4::P4Tools::P4Testgen::Pna::SharedPnaProgramInfo.
void P4::P4Tools::P4Testgen::ProgramInfo::produceCopyInOutCall | ( | const IR::Parameter * | param, |
size_t | paramIdx, | ||
const ArchSpec::ArchMember * | archMember, | ||
std::vector< Continuation::Command > * | copyIns, | ||
std::vector< Continuation::Command > * | copyOuts ) const |
Helper function to produce copy-in and copy-out helper calls. Copy-in and copy-out is needed to correctly model the value changes of data when it is copied in and out of a programmable block. In many cases, data is reset here or not even copied. TODO: Find a more efficient way to implement copy-in/copy-out. These functions are very expensive.
|
protected |
The list of concolic methods implemented by the target. This list is assembled during initialization.