19#ifndef BF_P4C_PHV_TABLE_PHV_CONSTRAINTS_H_
20#define BF_P4C_PHV_TABLE_PHV_CONSTRAINTS_H_
22#include "bf-p4c/mau/mau_visitor.h"
23#include "bf-p4c/phv/action_phv_constraints.h"
24#include "bf-p4c/phv/analysis/pack_conflicts.h"
25#include "bf-p4c/phv/phv_fields.h"
26#include "bf-p4c/phv/pragma/pa_container_size.h"
27#include "bf-p4c/phv/utils/slice_alloc.h"
42 static constexpr unsigned BITS_IN_BYTE = 8;
43 static constexpr unsigned TERNARY_MATCH_KEY_BITS_THRESHOLD = 64;
44 static constexpr unsigned MAX_EXACT_MATCH_KEY_BYTES = 128;
45 static constexpr size_t MAX_TERNARY_MATCH_KEY_BITS = (44 * 12) - 4;
50 bool preorder(IR::MAU::Table *tbl)
override;
51 void end_apply()
override;
53 bool isATCAM(IR::MAU::Table *tbl)
const;
54 bool isTernary(IR::MAU::Table *tbl)
const;
56 void calculateTernaryMatchKeyConstraints(
const IR::MAU::Table *tbl)
const;
68 bool preorder(
const IR::MAU::Action *action)
override;
73 : phv(p), actions(a), pack(c) {}
104 void end_apply()
override;
105 bool preorder(
const IR::MAU::Table *tbl)
override;
106 int getNumberOfEntriesInTable(
const IR::MAU::Table *tbl);
Definition action_phv_constraints.h:107
Definition mau_visitor.h:29
Definition mau_visitor.h:45
Definition ir/pass_manager.h:40
Definition ordered_map.h:32
Definition ordered_set.h:32
Definition slice_alloc.h:136
Definition phv_fields.h:898
Definition pack_conflicts.h:36
Definition phv_fields.h:1095
Definition table_phv_constraints.h:97
int getPackScore(const ordered_set< PHV::AllocSlice > &parent, const ordered_set< PHV::AllocSlice > &slices) const
Definition table_phv_constraints.cpp:272
std::list< PHV::FieldSlice > getPackCandidate(const PHV::FieldSlice &fs) const
Definition table_phv_constraints.cpp:308
Definition table_phv_constraints.h:80
Definition table_phv_constraints.h:40