P4C
The P4 Compiler
Loading...
Searching...
No Matches
MauPower::MprSettings Class Reference

#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
 
MauFeaturesmau_features_
 

Friends

std::ostream & operator<< (std::ostream &out, const MprSettings &m)
 

Detailed Description

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.

Member Function Documentation

◆ need_to_emit()

bool MauPower::MprSettings::need_to_emit ( lut_t type,
int stage ) const
Parameters
typeThe type of look-up table (LUT).
stageThe MAU stage number where the configuration will be written.
Returns
A Boolean indicating if any of the LUT values are non-zero. Non-zero values need to be written to the assembly file.

◆ set_mpr_always_run()

void MauPower::MprSettings::set_mpr_always_run ( int stage,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
id_vectorA 16-bit activation vector that says what logical tables in the current MAU stage are always power on.

◆ set_mpr_bus_dep_glob_exec()

void MauPower::MprSettings::set_mpr_bus_dep_glob_exec ( int stage,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
id_vectorA 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.

◆ set_mpr_bus_dep_long_brch()

void MauPower::MprSettings::set_mpr_bus_dep_long_brch ( int stage,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
id_vectorAn 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.

◆ set_mpr_global_exec()

void MauPower::MprSettings::set_mpr_global_exec ( int stage,
int exec_bit,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
exec_bitThe global execute bit number that will activate the id_vector. Allowed values are [0:15].
id_vectorA 16-bit activation vector that says what logical tables in the current MAU stage to power on.

◆ set_mpr_long_branch()

void MauPower::MprSettings::set_mpr_long_branch ( int stage,
int tag_id,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
tag_idThe long branch tag ID number that will activate the id_vector. Allowed values are [0:7].
id_vectorA 16-bit activation vector that says what logical tables in the current MAU stage to power on.

◆ set_mpr_next_table()

void MauPower::MprSettings::set_mpr_next_table ( int stage,
int logical_id,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
logical_idThe logical ID number that will activate the id_vector. Allowed values are [0:15].
id_vectorA 16-bit activation vector that says what logical tables in the current MAU stage to power on.

◆ set_mpr_stage()

void MauPower::MprSettings::set_mpr_stage ( int stage,
int mpr_stage )
Parameters
stageThe MAU stage number where the configuration will be written.
mpr_stageThis 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.

◆ set_or_mpr_always_run()

void MauPower::MprSettings::set_or_mpr_always_run ( int stage,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
id_vectorA 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.

◆ set_or_mpr_long_branch()

void MauPower::MprSettings::set_or_mpr_long_branch ( int stage,
int tag_id,
int id_vector )
Parameters
stageThe MAU stage number where the configuration will be written.
tag_idThe long branch tag ID number that will activate the id_vector. Allowed values are [0:7].
id_vectorA 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.