48 using PowerLogging = Logging::Power_Schema_Logger;
49 bool preorder(
const IR::MAU::Table *t)
override;
52 const bool &exceeds_stages,
53 const std::map<UniqueId, PowerMemoryAccess> &table_memory_access,
55 std::map<gress_t, MprSettings *> &mpr_settings)
56 : next_table_properties_(next_table_properties),
58 exceeds_stages_(exceeds_stages),
60 table_memory_access_(table_memory_access),
61 mau_features_(mau_features),
62 mpr_settings_(mpr_settings) {
63 disable_mpr_config_ = options.disable_mpr_config;
64 if (Device::currentDevice() != Device::TOFINO) {
74 const bool &exceeds_stages_;
76 const std::map<UniqueId, PowerMemoryAccess> &table_memory_access_;
79 std::map<gress_t, MprSettings *> &mpr_settings_;
81 PowerLogging *logger_ =
nullptr;
83 bool disable_mpr_config_ =
false;
87 std::map<gress_t, double> gress_powers_real_ = {};
92 std::map<gress_t, double> gress_powers_ = {};
97 std::map<UniqueId, bool> on_critical_path_ = {};
103 std::map<UniqueId, bool> always_powered_on_ = {};
108 std::map<UniqueId, bool> always_powered_on_latency_ = {};
112 std::map<UniqueId, cstring> external_names_ = {};
116 std::map<UniqueId, int> stages_ = {};
120 std::map<UniqueId, gress_t> gress_map_ = {};
124 size_t longest_table_name_ = 0;
132 void clear_mpr_settings();
134 bool check_mpr_conflict();
138 double estimate_power();
142 double estimate_power_tofino();
146 double estimate_power_non_tofino();
154 bool is_mpr_powered_on(gress_t g,
int stage,
const IR::MAU::Table *t)
const;
159 double traffic_limit_scaling(
double pwr)
const;
164 void create_mau_power_json(
const IR::Node *root);
165 void produce_json_tables();
166 void produce_json_total_power(
int pipe_id);
167 void produce_json_total_latency(
int pipe_id);
168 void produce_json_stage_characteristics();
173 void create_mau_power_log(
const IR::Node *root)
const;
174 void print_features(std::ofstream &out)
const;
175 void print_latency(std::ofstream &out)
const;
176 void print_mpr_settings(std::ofstream &out)
const;
177 void print_worst_power(std::ofstream &out)
const;