P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::ClusterStats Class Referenceabstract

An interface for gathering statistics common across each kind of cluster. More...

#include <utils.h>

Inheritance diagram for PHV::ClusterStats:
[legend]

Public Member Functions

virtual size_t aggregate_size () const =0
 
virtual bool contains (const PHV::Field *f) const =0
 
virtual bool contains (const PHV::FieldSlice &slice) const =0
 
virtual bool deparsed () const =0
 
virtual int exact_containers () const =0
 
virtual gress_t gress () const =0
 
virtual int max_width () const =0
 
virtual int num_constraints () const =0
 
virtual bool okIn (PHV::Kind kind) const =0
 

Public Attributes

int uid = nextId++
 

Detailed Description

An interface for gathering statistics common across each kind of cluster.

Member Function Documentation

◆ aggregate_size()

virtual size_t PHV::ClusterStats::aggregate_size ( ) const
pure virtual
Returns
the sum of the widths of slices in this cluster.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ contains() [1/2]

virtual bool PHV::ClusterStats::contains ( const PHV::Field * f) const
pure virtual
Returns
true if this cluster contains f.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ contains() [2/2]

virtual bool PHV::ClusterStats::contains ( const PHV::FieldSlice & slice) const
pure virtual
Returns
true if this cluster contains slice.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ deparsed()

virtual bool PHV::ClusterStats::deparsed ( ) const
pure virtual
Returns
true if any slice in the cluster is deparsed (either to the wire or the TM).

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ exact_containers()

virtual int PHV::ClusterStats::exact_containers ( ) const
pure virtual
Returns
the number of slices in this container with the exact_containers constraint.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ gress()

virtual gress_t PHV::ClusterStats::gress ( ) const
pure virtual
Returns
the gress requiremnt of this cluster.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ max_width()

virtual int PHV::ClusterStats::max_width ( ) const
pure virtual
Returns
the width of the widest slice in this cluster.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ num_constraints()

virtual int PHV::ClusterStats::num_constraints ( ) const
pure virtual
Returns
the total number of constraints summed over all slices in this cluster.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.

◆ okIn()

virtual bool PHV::ClusterStats::okIn ( PHV::Kind kind) const
pure virtual
Returns
true if this cluster can be assigned to containers of kind kind.

Implemented in PHV::AlignedCluster, PHV::RotationalCluster, and PHV::SuperCluster.