P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::ArchSpec Class Reference

Specifies a canonical representation of the target pipeline as documented in P4 code. More...

#include <arch_spec.h>

Classes

struct  ArchMember
 An ArchMember represents a construct in the pipe. It has a name and parameters. More...
 

Public Member Functions

 ArchSpec (cstring packageName, const std::vector< ArchMember > &archVectorInput)
 
const ArchMembergetArchMember (size_t blockIndex) const
 
size_t getArchVectorSize () const
 
size_t getBlockIndex (cstring blockName) const
 
cstring getPackageName () const
 
cstring getParamName (cstring blockName, size_t paramIndex) const
 
cstring getParamName (size_t blockIndex, size_t paramIndex) const
 

Detailed Description

Specifies a canonical representation of the target pipeline as documented in P4 code.


Class Documentation

◆ P4::P4Tools::ArchSpec::ArchMember

struct P4::P4Tools::ArchSpec::ArchMember

An ArchMember represents a construct in the pipe. It has a name and parameters.

Class Members
cstring blockName
vector< cstring > blockParams

Member Function Documentation

◆ getArchMember()

const ArchSpec::ArchMember * ArchSpec::getArchMember ( size_t blockIndex) const
nodiscard
Returns
the architecture member that corresponds to the given index in this architecture specification. A bug is thrown if the index does not exist.

◆ getArchVectorSize()

size_t ArchSpec::getArchVectorSize ( ) const
nodiscard
Returns
the size of the architecture specification vector.

◆ getBlockIndex()

size_t ArchSpec::getBlockIndex ( cstring blockName) const
nodiscard
Returns
the index that corresponds to the given name in this architecture specification. A bug is thrown if the index does not exist.

◆ getPackageName()

cstring ArchSpec::getPackageName ( ) const
nodiscard
Returns
the label of the architecture specification.

◆ getParamName() [1/2]

cstring ArchSpec::getParamName ( cstring blockName,
size_t paramIndex ) const
nodiscard
Returns
name of the parameter for the given block label and parameter index in this architecture specification. A bug is thrown if the index is out of range or the block label does not exist.

◆ getParamName() [2/2]

cstring ArchSpec::getParamName ( size_t blockIndex,
size_t paramIndex ) const
nodiscard
Returns
name of the parameter for the given block and parameter index in this architecture specification. A bug is thrown if the indices are out of range.