19#ifndef BF_P4C_PHV_V2_GREEDY_TX_SCORE_H_
20#define BF_P4C_PHV_V2_GREEDY_TX_SCORE_H_
22#include "backends/tofino/bf-p4c/phv/v2/kind_size_indexed_map.h"
23#include "backends/tofino/bf-p4c/phv/v2/phv_kit.h"
24#include "backends/tofino/bf-p4c/phv/v2/tx_score.h"
30using ContainerByte = std::pair<Container, int>;
84 int bits_supply(
const PHV::Kind &k)
const;
85 bool has_more_than_enough(
const PHV::Kind &k)
const {
90std::ostream &operator<<(std::ostream &,
const ContainerByte &);
91std::ostream &operator<<(std::ostream &,
const Vision &);
98 std::set<const Field *> table_key_with_ranges;
101 friend std::ostream &operator<<(std::ostream &,
const Vision &);
105 const std::list<SuperCluster *> &sorted_clusters,
143 int used_L1_bits()
const;
146 int used_L2_bits()
const;
177 int n_size_overflow = 0;
187 int n_max_overflowed = 0;
191 int n_tphv_on_phv_bits = 0;
194 int n_inc_used_tphv_collection = 0;
198 int n_pov_deparser_read_bits = 0;
202 int n_deparser_read_learning_bytes = 0;
207 int n_table_new_ixbar_bytes = 0;
212 int n_stage_new_ixbar_bytes = 0;
215 int n_table_ixbar_imbalanced_alignments = 0;
220 int n_overloaded_stage_ixbar_imbalanced_alignments = 0;
224 int n_range_match_nibbles_occupied = 0;
233 std::string
str()
const override;
Definition ordered_map.h:32
Definition ordered_set.h:32
Definition phv/utils/utils.h:506
Definition phv/utils/utils.h:1049
Definition phv/utils/utils.h:561
GreedyTxScore is the default allocation heuristics.
Definition greedy_tx_score.h:136
std::string str() const override
Definition phv/v2/greedy_tx_score.cpp:634
bool has_mismatch_gress() const
Definition phv/v2/greedy_tx_score.cpp:630
bool better_than(const TxScore *other) const override
Definition phv/v2/greedy_tx_score.cpp:565
Definition greedy_tx_score.h:93
KindSizeIndexedMap record_deallocation(const SuperCluster *sc, const ConcreteAllocation &curr_alloc, const ordered_set< AllocSlice > &slices)
Definition phv/v2/greedy_tx_score.cpp:239
static int ixbar_imbalanced_alignment(const ordered_set< ContainerByte > &cont_bytes)
Definition phv/v2/greedy_tx_score.cpp:145
void record_commit(const Transaction &tx, const SuperCluster *presliced_sc)
update vision_i.
Definition phv/v2/greedy_tx_score.cpp:210
TxScore is the interface of an allocation score.
Definition tx_score.h:28
TxScoreMaker is the interface of the factory class of TxScore.
Definition tx_score.h:35
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
Definition kind_size_indexed_map.h:30
Definition greedy_tx_score.h:39
TableIxbarContBytesMap table_ixbar_cont_bytes
maps table to allocated match key positions.
Definition greedy_tx_score.h:74
ordered_map< ContGress, KindSizeIndexedMap > cont_available
Definition greedy_tx_score.h:55
StageIxbarContBytesMap stage_sram_ixbar_cont_bytes
Definition greedy_tx_score.h:77
ContGress
ContGress represents the hardware gress constraint of a container.
Definition greedy_tx_score.h:41
ordered_map< const SuperCluster *, KindSizeIndexedMap > sc_cont_required
Definition greedy_tx_score.h:49
ordered_map< gress_t, KindSizeIndexedMap > cont_required
Definition greedy_tx_score.h:52
StageIxbarContBytesMap stage_tcam_ixbar_cont_bytes
Definition greedy_tx_score.h:80
int bits_demand(const PHV::Kind &k) const
supply vs demand in terms of bits.
Definition phv/v2/greedy_tx_score.cpp:123