P4C
The P4 Compiler
|
#include <mau_power.h>
Public Member Functions | |
MprSettings (gress_t gress, MauFeatures &) | |
std::ostream & | emit_stage_asm (std::ostream &out, int stage) const |
int | get_mpr_always_run_for_stage (int stage) const |
int | get_mpr_bus_dep_glob_exec (int stage) const |
int | get_mpr_bus_dep_long_brch (int stage) const |
int | get_mpr_global_exec (int stage, int exec_bit) const |
int | get_mpr_long_branch (int stage, int tag_id) const |
int | get_mpr_next_table (int stage, int logical_id) const |
int | get_mpr_stage (int stage) const |
bool | need_to_emit (lut_t type, int stage) const |
void | set_mpr_always_run (int stage, int id_vector) |
void | set_mpr_bus_dep_glob_exec (int stage, int id_vector) |
void | set_mpr_bus_dep_long_brch (int stage, int id_vector) |
void | set_mpr_global_exec (int stage, int exec_bit, int id_vector) |
void | set_mpr_long_branch (int stage, int tag_id, int id_vector) |
void | set_mpr_next_table (int stage, int logical_id, int id_vector) |
void | set_mpr_stage (int stage, int mpr_stage) |
void | set_or_mpr_always_run (int stage, int id_vector) |
void | set_or_mpr_bus_dep_glob_exec (int stage, int id_vector) |
void | set_or_mpr_bus_dep_long_brch (int stage, int id_vector) |
void | set_or_mpr_global_exec (int stage, int exec_bit, int id_vector) |
void | set_or_mpr_long_branch (int stage, int tag_id, int id_vector) |
void | set_or_mpr_next_table (int stage, int logical_id, int id_vector) |
Public Attributes | |
dyn_vector< int > | glob_exec_use |
const gress_t | gress_ |
dyn_vector< int > | long_branch_use |
MauFeatures & | mau_features_ |
Friends | |
std::ostream & | operator<< (std::ostream &out, const MprSettings &m) |
A class to represent the match-power reduction (MPR) settings that will need to be passed to assembly for register configuration. This is only relevant for Tofino2 and beyond. A separate MprSettings object is created for each gress, so stage parameters in this class run 0 to n-1. They do not use the encoding mentioned above.
bool MauPower::MprSettings::need_to_emit | ( | lut_t | type, |
int | stage ) const |
type | The type of look-up table (LUT). |
stage | The MAU stage number where the configuration will be written. |
void MauPower::MprSettings::set_mpr_always_run | ( | int | stage, |
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage are always power on. |
void MauPower::MprSettings::set_mpr_bus_dep_glob_exec | ( | int | stage, |
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
id_vector | A 16-bit vector indicating if the following stage is action dependent for the given global execute activation bit. A value of '1' indicates that the input global execute bit should be passed through unchanged. If the next stage is match dependent, this bit will be updated by the current stage. Note that global execute is not per-gress, so this value will be merged with the other gresses prior to writing configuration registers. |
void MauPower::MprSettings::set_mpr_bus_dep_long_brch | ( | int | stage, |
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
id_vector | An 8-bit vector indicating if the following stage is action dependent for the given long branch tag ID activation bit. A value of '1' indicates that the input long branch tag ID execution bit should be passed through unchanged. If the next stage is match dependent, this bit will be updated by the current stage. Note that long branch is not per-gress, so this value will be merged with the other gresses prior to writing configuration registers. |
void MauPower::MprSettings::set_mpr_global_exec | ( | int | stage, |
int | exec_bit, | ||
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
exec_bit | The global execute bit number that will activate the id_vector. Allowed values are [0:15]. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage to power on. |
void MauPower::MprSettings::set_mpr_long_branch | ( | int | stage, |
int | tag_id, | ||
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
tag_id | The long branch tag ID number that will activate the id_vector. Allowed values are [0:7]. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage to power on. |
void MauPower::MprSettings::set_mpr_next_table | ( | int | stage, |
int | logical_id, | ||
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
logical_id | The logical ID number that will activate the id_vector. Allowed values are [0:15]. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage to power on. |
void MauPower::MprSettings::set_mpr_stage | ( | int | stage, |
int | mpr_stage ) |
stage | The MAU stage number where the configuration will be written. |
mpr_stage | This stage, if it is match dependent, or the preceding match-dependent stage otherwise. The next_table, glob_exec, and long_branch input will be drawn from the output of the stage before this. |
void MauPower::MprSettings::set_or_mpr_always_run | ( | int | stage, |
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage are always power on. This value will be ORed into the existing value, if it exists. |
void MauPower::MprSettings::set_or_mpr_long_branch | ( | int | stage, |
int | tag_id, | ||
int | id_vector ) |
stage | The MAU stage number where the configuration will be written. |
tag_id | The long branch tag ID number that will activate the id_vector. Allowed values are [0:7]. |
id_vector | A 16-bit activation vector that says what logical tables in the current MAU stage to power on. This value will be ORed into the existing value, if it exists. |