P4C
The P4 Compiler
|
#include <phv_kit.h>
Public Member Functions | |
PhvKit (const PhvInfo &phv, const ClotInfo &clot, const Clustering &clustering, const PhvUse &uses, const FieldDefUse &defuse, const ActionPhvConstraints &actions, const MapFieldToParserStates &field_to_parser_states, const CalcParserCriticalPath &parser_critical_path, const CollectParserInfo &parser_info, const CollectStridedHeaders &strided_headers, const FieldSliceLiveRangeDB &physical_liverange_db, const ActionSourceTracker &source_tracker, const CollectTableKeys &tb_keys, const TablesMutuallyExclusive &table_mutex, const DependencyGraph &deps, std::set< PHV::FieldRange > &mauInitFields, const Pragmas &pragmas, const AllocSetting &settings, const MauBacktracker &mau) | |
bool | can_logical_liverange_be_overlaid (const PHV::AllocSlice &a, const PHV::AllocSlice &b) const |
bool | can_physical_liverange_be_overlaid (const PHV::AllocSlice &a, const PHV::AllocSlice &b) const |
HasPackConflict | get_has_pack_conflict () const |
bool | has_pack_conflict (const PHV::FieldSlice &fs1, const PHV::FieldSlice &fs2) const |
bool | is_referenced (const PHV::Field *f) const |
PHV::Slicing::IteratorInterface * | make_slicing_ctx (const PHV::SuperCluster *sc) const |
std::list< PHV::SuperCluster * > | make_superclusters () const |
const SymBitMatrix & | mutex () const |
Static Public Member Functions | |
static void | bind_slices (const PHV::ConcreteAllocation &alloc, PhvInfo &phv) |
static void | clear_slices (PhvInfo &phv) |
clear alloc_slices allocated in phv , if any. | |
static std::list< PHV::SuperCluster * > | create_strided_clusters (const CollectStridedHeaders &strided_headers, const std::list< PHV::SuperCluster * > &cluster_groups) |
static bool | is_clot_allocated (const ClotInfo &clots, const PHV::SuperCluster &sc) |
static bool | is_ternary (const IR::MAU::Table *tbl) |
static std::list< PHV::ContainerGroup * > | make_device_container_groups () |
static std::list< PHV::SuperCluster * > | remove_clot_allocated_clusters (const ClotInfo &clot, std::list< PHV::SuperCluster * > clusters) |
static std::list< PHV::SuperCluster * > | remove_singleton_metadata_slicelist (const std::list< PHV::SuperCluster * > &cluster_groups) |
static std::list< PHV::SuperCluster * > | remove_unref_clusters (const PhvUse &uses, const std::list< PHV::SuperCluster * > &cluster_groups_input) |
static void | sort_and_merge_alloc_slices (PhvInfo &phv) |
Public Attributes | |
const ActionPhvConstraints & | actions |
const ClotInfo & | clot |
const Clustering & | clustering |
const FieldDefUse & | defuse |
const DependencyGraph & | deps |
const MapFieldToParserStates & | field_to_parser_states |
const MauBacktracker & | mau |
std::set< PHV::FieldRange > & | mauInitFields |
const ActionPackingValidator * | packing_validator |
const CalcParserCriticalPath & | parser_critical_path |
const CollectParserInfo & | parser_info |
const ParserPackingValidator * | parser_packing_validator |
parser packing validator checks whether a packing would break parser constraints. | |
const PhvInfo & | phv |
const PHV::FieldSliceLiveRangeDB & | physical_liverange_db |
const PHV::Pragmas & | pragmas |
const AllocSetting & | settings |
const ActionSourceTracker & | source_tracker |
const CollectStridedHeaders & | strided_headers |
const TablesMutuallyExclusive & | table_mutex |
const CollectTableKeys & | tb_keys |
const PhvUse & | uses |
PhvKit is a collection of const references to misc passes that PHV allocation depends on. It also provides some helper methods.
|
static |
Translate each AllocSlice in alloc
into a PHV::Field::alloc_slice and attach it to the PHV::Field it slices.
|
static |
Check if the supercluster has field slice that requires strided allocation. Merge all related stride superclusters.
|
static |
|
static |
tbl
is a ternary match.
|
static |
|
inline |
|
static |
clusters
.
|
static |
remove singleton metadata slice list. This was introduced because some metadata fields are placed in a slice list, but they do not need to be. Removing them from slice list allows allocator to try more possible starting positions. TODO: we should fix this in make_clusters and remove this function.
|
static |
Remove unreferenced clusters from cluster_groups_input
. For example, a singleton super cluster with only one padding field.
|
static |
Merge Adjacent AllocSlices of the same field into one AllocSlice. MUST run this after allocation because later passes assume that phv alloc info is sorted in field bit order, msb first.