19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_CONTAINER_SIZE_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_CONTAINER_SIZE_H_
25#include "bf-p4c/phv/phv_fields.h"
26#include "bf-p4c/phv/utils/utils.h"
55 profile_t rv = Inspector::init_apply(root);
56 pa_container_sizes_i.clear();
57 field_layouts_i.clear();
62 bool preorder(
const IR::BFN::Pipe *pipe)
override;
65 void end_apply()
override;
70 void check_and_add_no_split(
PHV::Field *field)
const;
75 : phv_i(phv), container_size_constr(container_size_constr) {}
77 : phv_i(phv), container_size_constr(*(
new ordered_map<
cstring, std::vector<PHV::Size>>)) {}
81 static const char *description;
82 static const char *help;
85 return pa_container_sizes_i;
93 return field_layouts_i;
99 std::optional<PHV::Size> expected_container_size(
const PHV::FieldSlice &fs)
const;
101 bool is_specified(
const PHV::Field *field)
const {
return pa_container_sizes_i.count(field); }
Definition ordered_map.h:32
Definition phv_fields.h:154
Definition phv_fields.h:898
Definition phv_fields.h:1095
Definition pa_container_size.h:39
static const char * name
BFN::Pragma interface.
Definition pa_container_size.h:80
cstring printSizeConstraints(const std::vector< PHV::Size > &sizes) const
Definition phv/pragma/pa_container_size.cpp:266
bool check_and_add_constraint(const PHV::Field *field, std::vector< PHV::Size > sizes)
Definition phv/pragma/pa_container_size.cpp:275
void add_constraint(const PHV::Field *field, std::vector< PHV::Size > sizes)
Definition phv/pragma/pa_container_size.cpp:259
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24