17#ifndef BACKENDS_BMV2_PNA_NIC_PNAPROGRAMSTRUCTURE_H_
18#define BACKENDS_BMV2_PNA_NIC_PNAPROGRAMSTRUCTURE_H_
20#include "backends/common/portableProgramStructure.h"
47 return ptName ==
"pna_main_parser_input_metadata_t" ||
48 ptName ==
"pna_main_input_metadata_t" || ptName ==
"pna_main_output_metadata_t";
57 CHECK_NULL(structure);
60 void modelError(
const char *format,
const IR::INode *node) {
62 (
cstring(format) +
"\nAre you using an up-to-date 'pna.p4'?").c_str(),
66 bool preorder(
const IR::PackageBlock *block)
override;
67 bool preorder(
const IR::ExternBlock *block)
override;
71 structure->globals.clear();
72 return Inspector::init_apply(root);
83 setName(
"InspectPnaProgram");
86 void postorder(
const IR::P4Parser *p)
override;
87 void postorder(
const IR::P4Control *c)
override;
88 void postorder(
const IR::Declaration_Instance *di)
override;
90 void addTypesAndInstances(
const IR::Type_StructLike *type,
bool meta);
91 void addHeaderType(
const IR::Type_StructLike *st);
92 void addHeaderInstance(
const IR::Type_StructLike *st,
cstring name);
93 bool preorder(
const IR::Declaration_Variable *dv)
override;
94 bool preorder(
const IR::Parameter *parameter)
override;
Definition bmv2/pna_nic/pnaProgramStructure.h:76
Definition bmv2/pna_nic/pnaProgramStructure.h:52
Definition bmv2/pna_nic/pnaProgramStructure.h:31
ordered_map< const IR::Node *, pna_block_t > block_type
Architecture related information.
Definition bmv2/pna_nic/pnaProgramStructure.h:34
static bool isStandardMetadata(cstring ptName)
Definition bmv2/pna_nic/pnaProgramStructure.h:46
static bool isCounterMetadata(cstring ptName)
Definition bmv2/pna_nic/pnaProgramStructure.h:42
Definition portableProgramStructure.h:84
Definition portableProgramStructure.h:79
Definition portableProgramStructure.h:29
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition ordered_map.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition action.cpp:21
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:51