17#ifndef BACKENDS_BMV2_PNA_NIC_PNAPROGRAMSTRUCTURE_H_
18#define BACKENDS_BMV2_PNA_NIC_PNAPROGRAMSTRUCTURE_H_
20#include "backends/common/portableProgramStructure.h"
47 return (!strcmp(ptName,
"pna_main_parser_input_metadata_t") ||
48 !strcmp(ptName,
"pna_main_input_metadata_t") ||
49 !strcmp(ptName,
"pna_main_output_metadata_t"));
58 CHECK_NULL(structure);
61 void modelError(
const char *format,
const IR::INode *node) {
63 (
cstring(format) +
"\nAre you using an up-to-date 'pna.p4'?").c_str(),
67 bool preorder(
const IR::PackageBlock *block)
override;
68 bool preorder(
const IR::ExternBlock *block)
override;
72 structure->globals.clear();
73 return Inspector::init_apply(root);
84 setName(
"InspectPnaProgram");
87 void postorder(
const IR::P4Parser *p)
override;
88 void postorder(
const IR::P4Control *c)
override;
89 void postorder(
const IR::Declaration_Instance *di)
override;
91 void addTypesAndInstances(
const IR::Type_StructLike *type,
bool meta);
92 void addHeaderType(
const IR::Type_StructLike *st);
93 void addHeaderInstance(
const IR::Type_StructLike *st,
cstring name);
94 bool preorder(
const IR::Declaration_Variable *dv)
override;
95 bool preorder(
const IR::Parameter *parameter)
override;
Definition bmv2/pna_nic/pnaProgramStructure.h:77
Definition bmv2/pna_nic/pnaProgramStructure.h:53
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