19#ifndef BF_P4C_PHV_V2_PHV_KIT_H_
20#define BF_P4C_PHV_V2_PHV_KIT_H_
22#include "backends/tofino/bf-p4c/common/field_defuse.h"
23#include "backends/tofino/bf-p4c/mau/table_mutex.h"
24#include "backends/tofino/bf-p4c/parde/clot/clot_info.h"
25#include "backends/tofino/bf-p4c/phv/action_phv_constraints.h"
26#include "backends/tofino/bf-p4c/phv/action_source_tracker.h"
27#include "backends/tofino/bf-p4c/phv/alloc_setting.h"
28#include "backends/tofino/bf-p4c/phv/analysis/critical_path_clusters.h"
29#include "backends/tofino/bf-p4c/phv/collect_strided_headers.h"
30#include "backends/tofino/bf-p4c/phv/collect_table_keys.h"
31#include "backends/tofino/bf-p4c/phv/fieldslice_live_range.h"
32#include "backends/tofino/bf-p4c/phv/make_clusters.h"
33#include "backends/tofino/bf-p4c/phv/phv.h"
34#include "backends/tofino/bf-p4c/phv/phv_fields.h"
35#include "backends/tofino/bf-p4c/phv/phv_parde_mau_use.h"
36#include "backends/tofino/bf-p4c/phv/pragma/phv_pragmas.h"
37#include "backends/tofino/bf-p4c/phv/slicing/types.h"
38#include "backends/tofino/bf-p4c/phv/v2/action_packing_validator.h"
39#include "backends/tofino/bf-p4c/phv/v2/parser_packing_validator.h"
71 std::set<PHV::FieldRange> &mauInitFields;
102 std::set<PHV::FieldRange> &mauInitFields,
const Pragmas &pragmas,
106 clustering(clustering),
110 source_tracker(source_tracker),
112 table_mutex(table_mutex),
115 mauInitFields(mauInitFields),
118 pragmas.pa_no_init(), mauInitFields)),
119 field_to_parser_states(field_to_parser_states),
120 parser_critical_path(parser_critical_path),
121 parser_info(parser_info),
122 strided_headers(strided_headers),
123 physical_liverange_db(physical_liverange_db),
128 const SymBitMatrix &mutex()
const {
return phv.field_mutex(); }
134 HasPackConflict get_has_pack_conflict()
const {
136 return this->has_pack_conflict(fs1, fs2);
189 const std::list<PHV::SuperCluster *> &cluster_groups);
194 const PhvUse &uses,
const std::list<PHV::SuperCluster *> &cluster_groups_input);
198 const ClotInfo &clot, std::list<PHV::SuperCluster *> clusters);
204 const std::list<PHV::SuperCluster *> &cluster_groups);
207 static bool is_ternary(
const IR::MAU::Table *tbl);
Definition action_phv_constraints.h:107
Definition parser_critical_path.h:131
Definition clot_info.h:41
Builds "clusters" of field slices that must be placed in the same group.
Definition make_clusters.h:67
const std::list< PHV::SuperCluster * > & cluster_groups() const
Definition make_clusters.h:548
Definition mau_backtracker.h:29
Definition symbitmatrix.h:27
ActionSourceTracker collects all source-to-destination for all field slices.
Definition action_source_tracker.h:49
Definition slice_alloc.h:136
Definition collect_table_keys.h:27
Definition phv/utils/utils.h:506
Definition phv_fields.h:154
bool padding
True if this Field is a padding field.
Definition phv_fields.h:222
Definition phv_fields.h:898
Definition fieldslice_live_range.h:152
Definition phv_pragmas.h:46
The interface that the iterator must satisfy.
Definition slicing/types.h:108
Definition phv/utils/utils.h:1049
Definition action_packing_validator.h:34
Definition parser_packing_validator.h:42
bool is_referenced(const PHV::Field *f) const
Definition phv_parde_mau_use.cpp:179
Definition phv_fields.h:1095
Definition phv_parde_mau_use.h:154
Definition mau/table_mutex.h:110
Definition field_defuse.h:77
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
Definition alloc_setting.h:25
Definition table_dependency_graph.h:52
Map field to the parser states in which they are extracted or assigned from checksums.
Definition phv_fields.h:1755
static std::list< PHV::SuperCluster * > remove_unref_clusters(const PhvUse &uses, const std::list< PHV::SuperCluster * > &cluster_groups_input)
Definition phv_kit.cpp:244
const ParserPackingValidator * parser_packing_validator
parser packing validator checks whether a packing would break parser constraints.
Definition phv_kit.h:74
std::list< PHV::SuperCluster * > make_superclusters() const
Definition phv_kit.h:144
static void sort_and_merge_alloc_slices(PhvInfo &phv)
Definition phv_kit.cpp:359
static bool is_ternary(const IR::MAU::Table *tbl)
Definition phv_kit.cpp:391
static std::list< PHV::SuperCluster * > create_strided_clusters(const CollectStridedHeaders &strided_headers, const std::list< PHV::SuperCluster * > &cluster_groups)
Definition phv_kit.cpp:315
static void clear_slices(PhvInfo &phv)
clear alloc_slices allocated in phv, if any.
Definition phv_kit.cpp:300
static bool is_clot_allocated(const ClotInfo &clots, const PHV::SuperCluster &sc)
Definition phv_kit.cpp:176
static void bind_slices(const PHV::ConcreteAllocation &alloc, PhvInfo &phv)
Definition phv_kit.cpp:305
static std::list< PHV::SuperCluster * > remove_singleton_metadata_slicelist(const std::list< PHV::SuperCluster * > &cluster_groups)
Definition phv_kit.cpp:205
static std::list< PHV::ContainerGroup * > make_device_container_groups()
Definition phv_kit.cpp:267
static std::list< PHV::SuperCluster * > remove_clot_allocated_clusters(const ClotInfo &clot, std::list< PHV::SuperCluster * > clusters)
Definition phv_kit.cpp:258