P4C
The P4 Compiler
Loading...
Searching...
No Matches
BFN::ProgramStructure Struct Referenceabstract

Public Member Functions

void addMetadata (gress_t gress, MetadataField src, MetadataField dst)
 
void addMetadata (MetadataField src, MetadataField dst)
 
virtual const IR::P4Program * create (const IR::P4Program *program)=0
 
void createActions ()
 
virtual void createControls ()=0
 
void createErrors ()
 replace with preorder pass
 
virtual void createMain ()=0
 
virtual void createParsers ()=0
 
void createTofinoArch ()
 
void createTypes ()
 
cstring getBlockName (cstring name)
 
void include (cstring filename, IR::Vector< IR::Node > *decls)
 
bool isEgress (const IR::P4Control *control)
 
bool isEgressDeparser (const IR::P4Control *control)
 
bool isEgressParser (const IR::P4Parser *parser)
 
bool isIngress (const IR::P4Control *control)
 
bool isIngressDeparser (const IR::P4Control *control)
 
bool isIngressParser (const IR::P4Parser *parser)
 

Public Attributes

ordered_map< const IR::Node *, const IR::Node * > _map
 the translation map.
 
std::vector< const IR::Type_Action * > action_types
 
ordered_map< cstring, cstringblockNames
 
ordered_map< cstring, const IR::P4Control * > controls
 
IR::IndexedVector< IR::Nodedeclarations
 
std::vector< const IR::Declaration * > egressDeclarations
 
std::vector< const IR::Declaration * > egressDeparserDeclarations
 
std::vector< const IR::StatOrDecl * > egressDeparserStatements
 
std::map< MetadataField, MetadataFieldegressMetadataNameMap
 
std::vector< const IR::Declaration * > egressParserDeclarations
 
ordered_map< cstring, std::vector< const IR::StatOrDecl * > > egressParserStatements
 
std::vector< const IR::StatOrDecl * > egressStatements
 
ordered_map< cstring, const IR::Type_Enum * > enums
 
ordered_set< cstringerrors
 target architecture types
 
ordered_map< cstring, const IR::Declaration_Instance * > global_instances
 
std::vector< const IR::Declaration * > ingressDeclarations
 
std::vector< const IR::Declaration * > ingressDeparserDeclarations
 
std::vector< const IR::StatOrDecl * > ingressDeparserStatements
 
std::map< MetadataField, MetadataFieldingressMetadataNameMap
 
std::vector< const IR::Declaration * > ingressParserDeclarations
 
ordered_map< cstring, std::vector< const IR::StatOrDecl * > > ingressParserStatements
 
std::vector< const IR::StatOrDecl * > ingressStatements
 
ordered_map< const IR::Member *, const IR::Member * > membersToDo
 
NodeNameMap nameMap
 
ordered_map< cstring, const IR::P4Parser * > parsers
 
ordered_map< const IR::Member *, gress_t > pathsThread
 
ordered_map< const IR::Member *, const IR::Member * > pathsToDo
 maintain the paths to translate and their thread info
 
ordered_map< cstring, const IR::Type_SerEnum * > ser_enums
 
std::set< MetadataFieldtargetMetadataSet
 
IR::Vector< IR::NodetargetTypes
 
const IR::ToplevelBlock * toplevel
 program control block names from P14
 
ordered_map< cstring, const IR::Type_Declaration * > type_declarations
 
ordered_map< const IR::Member *, const IR::Member * > typeNamesToDo
 
std::set< cstringunique_names = {"checksum"_cs, "hash"_cs, "random"_cs}
 all unique names in the program
 

Static Public Attributes

static const cstring EGRESS = "egress"_cs
 
static const cstring EGRESS_DEPARSER = "egress_deparser"_cs
 
static const cstring EGRESS_PARSER = "egress_parser"_cs
 
static const cstring INGRESS = "ingress"_cs
 
static const cstring INGRESS_DEPARSER = "ingress_deparser"_cs
 
static const cstring INGRESS_PARSER = "ingress_parser"_cs
 

Member Function Documentation

◆ include()

void BFN::ProgramStructure::include ( cstring filename,
IR::Vector< IR::Node > * decls )

read architecture definition in 'filename', output a list of IR::Node in 'decl'

Member Data Documentation

◆ blockNames

ordered_map<cstring, cstring> BFN::ProgramStructure::blockNames

map standard parser and control block name to arbitrary name assigned by user.

◆ controls

ordered_map<cstring, const IR::P4Control *> BFN::ProgramStructure::controls

replace with preorder pass maintain program declarations to reprint a valid P16 program

◆ ingressMetadataNameMap

std::map<MetadataField, MetadataField> BFN::ProgramStructure::ingressMetadataNameMap

Map from pre-translation metadata fields to post-translation metadata fields. The mapping may be different for each thread.