P4C
The P4 Compiler
|
#include <utils.h>
Public Types | |
using | SliceList = std::list<PHV::FieldSlice> |
Public Member Functions | |
SuperCluster (ordered_set< const PHV::RotationalCluster * > clusters, ordered_set< SliceList * > slice_lists) | |
size_t | aggregate_size () const override |
const AlignedCluster & | aligned_cluster (const PHV::FieldSlice &slice) const |
bool | all_of_fieldslices (const std::function< bool(const PHV::FieldSlice &)> func) const |
Apply func on all field slices in this super cluster. | |
bool | any_of_fieldslices (const std::function< bool(const PHV::FieldSlice &)> func) const |
void | calc_pack_conflicts () |
calculates the value of num_pack_conflicts_i (to be performed after PackConflicts analysis) | |
const RotationalCluster & | cluster (const PHV::FieldSlice &slice) const |
const ordered_set< const RotationalCluster * > & | clusters () const |
bool | contains (const PHV::Field *f) const override |
bool | contains (const PHV::FieldSlice &slice) const override |
bool | deparsed () const override |
int | exact_containers () const override |
SuperCluster::SliceList * | findLinkedWideArithSliceList (const SuperCluster::SliceList *sl) const |
void | forall_fieldslices (const std::function< void(const PHV::FieldSlice &)> func) const |
Apply func on all field slices in this super cluster. | |
gress_t | gress () const override |
bool | is_deparser_zero_candidate () const |
int | max_width () const override |
SuperCluster * | merge (const SuperCluster *sc1) |
SuperCluster * | merge (const SuperCluster *sc1) const |
return the merged supercluster. | |
SuperCluster * | mergeAndSortBasedOnWideArith (const SuperCluster *sc1) const |
bool | needsStridedAlloc () const |
void | needsStridedAlloc (bool val) |
bool | needToMergeForWideArith (const SuperCluster *sc) const |
int | num_constraints () const override |
size_t | num_pack_conflicts () const |
bool | okIn (PHV::Kind kind) const override |
bool | operator== (const SuperCluster &other) const |
Semantic equality. | |
const ordered_set< const SliceList * > & | slice_list (const PHV::FieldSlice &slice) const |
const ordered_set< SliceList * > & | slice_lists () const |
ordered_set< PHV::FieldSlice > | slices () const |
Public Member Functions inherited from PHV::ClusterStats |
Static Public Member Functions | |
static bool | is_well_formed (const SuperCluster *sc, PHV::Error *err=new PHV::Error()) |
static std::vector< le_bitrange > | slice_list_exact_containers (const SliceList &list) |
static bool | slice_list_has_exact_containers (const SliceList &list) |
static std::vector< SuperCluster::SliceList * > | slice_list_split_by_byte (const SuperCluster::SliceList &sl) |
static int | slice_list_total_bits (const SliceList &list) |
Additional Inherited Members | |
Public Attributes inherited from PHV::ClusterStats | |
int | uid = nextId++ |
A group of rotational clusters that must be placed in the same MAU group of PHV containers.
Invariants on membership:
Any attempt to place a SuperCluster into a container group will fail if:
Slicing a SuperCluster can fail if:
no_split
property.no_split
property.Note that slice lists are formed from lists of header fields (among other things). In this case, the order of slices in the slice list is in little Endian, but headers are often written in big Endian order, and so the order in the slice list will appear reversed.
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
|
inline |
slice
. slice
is not in any cluster in this group; all slices in every slice list are guaranteed to be present in exactly one cluster.
|
inline |
func
is true on a fieldslice.
|
inline |
slice
. slice
is not in any cluster in this group; all slices in every slice list are guaranteed to be present in exactly one cluster.
|
inline |
|
overridevirtual |
f
. Implements PHV::ClusterStats.
|
overridevirtual |
slice
. Implements PHV::ClusterStats.
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
PHV::SuperCluster::SliceList * PHV::SuperCluster::findLinkedWideArithSliceList | ( | const SuperCluster::SliceList * | sl | ) | const |
Given a SliceList within a SuperCluster, find its linked wide arithmetic SliceList.
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
bool PHV::SuperCluster::is_deparser_zero_candidate | ( | ) | const |
|
static |
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
|
inline |
PHV::SuperCluster * PHV::SuperCluster::mergeAndSortBasedOnWideArith | ( | const SuperCluster * | sc1 | ) | const |
Merge this SuperCluster with the input SuperCluster, and return a new SuperCluster. This function is only intended to be called when the two SuperClusters are linked by wide arithmetic allocation requirements. This function merges the slice lists such that slice lists that are paired by wide arithmetic requirements are adjacent in the list, and the slice list destined for an even container (the lo slice) appears before the slice list destined for an odd container (the hi slice).
|
inline |
bool PHV::SuperCluster::needToMergeForWideArith | ( | const SuperCluster * | sc | ) | const |
|
inlineoverridevirtual |
Implements PHV::ClusterStats.
|
inline |
|
overridevirtual |
kind
. Implements PHV::ClusterStats.
const ordered_set< const PHV::SuperCluster::SliceList * > & PHV::SuperCluster::slice_list | ( | const PHV::FieldSlice & | slice | ) | const |
slice
.
|
static |
|
static |
|
static |
|
static |
list
paramter
|
inline |
ordered_set< PHV::FieldSlice > PHV::SuperCluster::slices | ( | ) | const |