19#ifndef BACKENDS_TOFINO_BF_P4C_ARCH_PSA_PROGRAMSTRUCTURE_H_
20#define BACKENDS_TOFINO_BF_P4C_ARCH_PSA_PROGRAMSTRUCTURE_H_
22#include "bf-p4c/arch/program_structure.h"
23#include "bf-p4c/arch/psa/psa_model.h"
24#include "bf-p4c/ir/gress.h"
25#include "bf-p4c/midend/path_linearizer.h"
26#include "bf-p4c/midend/type_categories.h"
27#include "frontends/common/resolveReferences/resolveReferences.h"
28#include "frontends/p4/evaluator/evaluator.h"
30#include "ir/namemap.h"
31#include "lib/ordered_set.h"
32#include "midend/eliminateSerEnums.h"
61 const IR::Type *structType =
nullptr;
68 const IR::IfStatement *ifStatement =
nullptr;
92static const cstring INP_INTR_MD =
"__psa_inp_intrinsic_md__"_cs;
93static const cstring OUT_INTR_MD =
"__psa_out_intrinsic_md__"_cs;
94static const cstring IG_INP_INTR_MD_TYPE =
"psa_ingress_input_metadata_t"_cs;
95static const cstring EG_INP_INTR_MD_TYPE =
"psa_egress_input_metadata_t"_cs;
96static const cstring IG_OUT_INTR_MD_TYPE =
"psa_ingress_output_metadata_t"_cs;
97static const cstring EG_OUT_INTR_MD_TYPE =
"psa_egress_output_metadata_t"_cs;
100 cstring type_params[PSA_TOTAL_TYPES];
106 const IR::Type *metadataType =
nullptr;
121 void createParsers()
override;
122 void createControls()
override;
123 void createMain()
override;
124 void createPipeline();
125 std::map<cstring, int> error_to_constant;
127 std::map<gress_t, std::map<cstring, const IR::MethodCallExpression *>> state_to_verify;
131 std::vector<IR::AssignmentStatement *> bridgeFieldAssignments;
132 const IR::P4Program *create(
const IR::P4Program *program)
override;
Definition psa_model.h:449
Definition backends/common/programStructure.h:32
Definition ordered_map.h:32
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:39
ordered_map< cstring, cstring > dstParams
Map arch-defined param name to user-defined name in dest block.
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:56
cstring paramNameInDeparser
The name of the metadata in egress deparser param.
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:44
bool exists
If packet path exists.
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:50
ordered_map< cstring, cstring > srcParams
Map user-defined name to arch-defined param name in source block.
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:53
cstring generatedName
name in compiler_generated_meta
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:47
const IR::Type * p4Type
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:60
cstring paramNameInParser
The name of the metadata in ingress parser param.
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:41
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:99
Definition backends/tofino/bf-p4c/arch/psa/programStructure.h:75