P4C
The P4 Compiler
|
#include <allocate_phv.h>
Public Types | |
using | ContainerAllocStatus = PHV::Allocation::ContainerAllocStatus |
using | IsBetterFunc = std::function<bool(const AllocScore &left, const AllocScore &right)> |
IsBetterFunc returns true if left is better than right. | |
typedef cstring | MetricName |
type of the name of a metric. | |
Public Member Functions | |
AllocScore (const PHV::Transaction &alloc, const PhvInfo &phv, const ClotInfo &clot, const PhvUse &uses, const MapFieldToParserStates &field_to_parser_states, const CalcParserCriticalPath &parser_critical_path, const TableFieldPackOptimization &tablePackOpt, FieldPackingOpportunity *packing, const int bitmasks) | |
AllocScore | operator- (const AllocScore &other) const |
AllocScore & | operator= (const AllocScore &other)=default |
Static Public Member Functions | |
static AllocScore | make_lowest () |
Public Attributes | |
ordered_map< PHV::Kind, ordered_map< MetricName, int > > | by_kind |
ordered_map< MetricName, int > | general |
Static Public Attributes | |
static const std::vector< MetricName > | g_by_kind_metrics |
container-kind-specific scores. | |
static const std::vector< MetricName > | g_general_metrics |
general metrics | |
The score of an Allocation .
This score is used in 3 places where decisions have to be made. From bottom to top, they are:
AllocScore::AllocScore | ( | const PHV::Transaction & | alloc, |
const PhvInfo & | phv, | ||
const ClotInfo & | clot, | ||
const PhvUse & | uses, | ||
const MapFieldToParserStates & | field_to_parser_states, | ||
const CalcParserCriticalPath & | parser_critical_path, | ||
const TableFieldPackOptimization & | tablePackOpt, | ||
FieldPackingOpportunity * | packing_opportunities, | ||
const int | bitmasks ) |
Construct a score from a Transaction.
alloc:
new allocation group:
the container group where allocations were made to.
The metrics are calculated:
group
.
|
static |
container-kind-specific scores.
|
static |
general metrics