P4C
The P4 Compiler
|
#include <mau_power.h>
Public Types | |
using | PowerLogging = Logging::Power_Schema_Logger |
Public Member Functions | |
bool | are_there_more_tables (gress_t gress, int start_stage) const |
int | compute_pipe_latency (gress_t gress) const |
int | compute_pred_cycle (gress_t gress, int stage) const |
int | compute_stage_latency (gress_t gress, int stage) const |
std::ostream & | emit_dep_asm (std::ostream &out, gress_t g, int stage) const |
mau_dep_t | get_dependency_for_gress_stage (gress_t g, int stage) const |
int | get_max_selector_words (gress_t gress, int stage) const |
void | log_json_stage_characteristics (gress_t g, PowerLogging *logger) const |
void | print_features (std::ostream &out, gress_t gress) const |
void | print_latency (std::ostream &out, gress_t gress) const |
bool | requires_dep_asm (gress_t g, int stage) const |
void | set_dependency_for_gress_stage (gress_t g, int stage, mau_dep_t dep) |
bool | stage_has_chained_feature (gress_t gress, int stage, stage_feature_t feature) const |
bool | stage_has_feature (gress_t gress, int stage, stage_feature_t feature) const |
bool | try_convert_to_match_dep () |
void | update_deps_for_device () |
Public Attributes | |
std::map< UniqueId, bool > | counter_runs_at_eop_ |
bitvec | has_exact_ [kNumberGress] |
bitvec | has_meter_lpf_or_wred_ [kNumberGress] |
bitvec | has_selector_ [kNumberGress] |
bitvec | has_stateful_ [kNumberGress] |
bitvec | has_stats_ [kNumberGress] |
bitvec | has_tcam_ [kNumberGress] |
dyn_vector< int > | max_selector_words_ [kNumberGress] |
std::map< UniqueId, bool > | meter_is_lpf_or_wred_ |
std::map< UniqueId, bool > | meter_runs_at_eop_ |
std::map< UniqueId, int > | selector_group_size_ |
dyn_vector< std::vector< const IR::MAU::Table * > > | stage_to_tables_ [kNumberGress] |
std::map< UniqueId, int > | table_to_stage_ |
std::map< UniqueId, const IR::MAU::Table * > | uid_to_table_ |
Static Public Attributes | |
static const int | kNumberGress = GRESS_T_COUNT |
A class to represent MAU stage characteristics, such as:
bool MauPower::MauFeatures::are_there_more_tables | ( | gress_t | gress, |
int | start_stage ) const |
Returns true if there are tables remaining in a particular gress in the start stage until the last MAU stage.
int MauPower::MauFeatures::compute_pipe_latency | ( | gress_t | gress | ) | const |
gress | The thread of compute. |
int MauPower::MauFeatures::compute_pred_cycle | ( | gress_t | gress, |
int | stage ) const |
gress | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
int MauPower::MauFeatures::compute_stage_latency | ( | gress_t | gress, |
int | stage ) const |
gress | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
std::ostream & MauPower::MauFeatures::emit_dep_asm | ( | std::ostream & | out, |
gress_t | g, | ||
int | stage ) const |
Emits information that needs to be communicated to assembly for register configuration. Currently, this is the MAU stage dependencies.
mau_dep_t MauPower::MauFeatures::get_dependency_for_gress_stage | ( | gress_t | g, |
int | stage ) const |
g | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
int MauPower::MauFeatures::get_max_selector_words | ( | gress_t | gress, |
int | stage ) const |
gress | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
void MauPower::MauFeatures::log_json_stage_characteristics | ( | gress_t | g, |
PowerLogging * | logger ) const |
Produces the power.json output.
void MauPower::MauFeatures::print_features | ( | std::ostream & | out, |
gress_t | gress ) const |
Produces lovely text tables showing features and dependencies.
void MauPower::MauFeatures::print_latency | ( | std::ostream & | out, |
gress_t | gress ) const |
Produces lovely text tables showing latencies and dependencies.
bool MauPower::MauFeatures::requires_dep_asm | ( | gress_t | g, |
int | stage ) const |
Return true if some asm code is required for the stage for correct behavior, even if no tables are present
bool MauPower::MauFeatures::stage_has_chained_feature | ( | gress_t | gress, |
int | stage, | ||
stage_feature_t | feature ) const |
gress | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
feature | The MAU feature. |
bool MauPower::MauFeatures::stage_has_feature | ( | gress_t | gress, |
int | stage, | ||
stage_feature_t | feature ) const |
gress | The thread of compute. |
stage | The MAU stage number, running 0 to n-1. |
feature | The MAU feature. |
bool MauPower::MauFeatures::try_convert_to_match_dep | ( | ) |
Attempts to convert a MAU stage dependency to match dependent. If a stage can be changed, the change is performed and this function returns true. Otherwise, it returns false.
void MauPower::MauFeatures::update_deps_for_device | ( | ) |
Removes concurrent dependency type if dealing with Tofino2 or later.