18#ifndef BACKENDS_COMMON_PSAPROGRAMSTRUCTURE_H_
19#define BACKENDS_COMMON_PSAPROGRAMSTRUCTURE_H_
21#include "portableProgramStructure.h"
52 return (ptName ==
"psa_ingress_parser_input_metadata_t" ||
53 ptName ==
"psa_egress_parser_input_metadata_t" ||
54 ptName ==
"psa_ingress_input_metadata_t" ||
55 ptName ==
"psa_ingress_output_metadata_t" ||
56 ptName ==
"psa_egress_input_metadata_t" ||
57 ptName ==
"psa_egress_deparser_input_metadata_t" ||
58 ptName ==
"psa_egress_output_metadata_t");
67 CHECK_NULL(structure);
70 void modelError(
const char *format,
const IR::INode *node) {
72 (
cstring(format) +
"\nAre you using an up-to-date 'psa.p4'?").c_str(),
76 bool preorder(
const IR::PackageBlock *block)
override;
77 bool preorder(
const IR::ExternBlock *block)
override;
81 structure->globals.clear();
82 return Inspector::init_apply(root);
93 setName(
"InspectPsaProgram");
96 void postorder(
const IR::P4Parser *p)
override;
97 void postorder(
const IR::P4Control *c)
override;
98 void postorder(
const IR::Declaration_Instance *di)
override;
100 void addTypesAndInstances(
const IR::Type_StructLike *type,
bool meta);
101 void addHeaderType(
const IR::Type_StructLike *st);
102 void addHeaderInstance(
const IR::Type_StructLike *st,
cstring name);
103 bool preorder(
const IR::Declaration_Variable *dv)
override;
104 bool preorder(
const IR::Parameter *parameter)
override;
Definition portableProgramStructure.h:84
Definition psaProgramStructure.h:86
Definition portableProgramStructure.h:79
Definition psaProgramStructure.h:62
Definition portableProgramStructure.h:29
Definition psaProgramStructure.h:36
static bool isCounterMetadata(cstring ptName)
Definition psaProgramStructure.h:47
ordered_map< const IR::Node *, std::pair< psa_gress_t, block_t > > block_type
Architecture related information.
Definition psaProgramStructure.h:39
static bool isStandardMetadata(cstring ptName)
Definition psaProgramStructure.h:51
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 applyOptionsPragmas.cpp:24
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:51