P4C
The P4 Compiler
Loading...
Searching...
No Matches
ActionData::MeterColor Class Reference

#include <action_format.h>

Inheritance diagram for ActionData::MeterColor:
[legend]

Public Member Functions

 MeterColor (cstring mn, le_bitrange r)
 
bool can_merge (const Parameter *ad) const override
 
void dbprint (std::ostream &out) const override
 
bool equiv_value (const Parameter *, bool check_cond=true) const override
 
bool from_p4_program () const override
 
const Parameterget_extended_param (uint32_t extension, const Parameter *) const override
 
bool is_next_bit_of_param (const Parameter *, bool same_alias) const override
 
bool is_padding () const
 
bool is_subset_of (const Parameter *ad) const override
 
const Parametermerge (const Parameter *ad) const override
 
cstring name () const override
 
bool only_one_overlap_solution () const override
 
const Parameteroverlap (const Parameter *ad, bool only_one_overlap_solution, le_bitrange *my_overlap, le_bitrange *ad_overlap) const override
 
le_bitrange range () const
 
int size () const override
 
const Parametersplit (int lo, int hi) const override
 
- Public Member Functions inherited from ActionData::Parameter
bool can_overlap_ranges (le_bitrange my_range, le_bitrange ad_range, le_bitrange &overlap, le_bitrange *my_overlap, le_bitrange *ad_overlap) const
 
cstring cond_name () const
 
bool equiv_cond (const Parameter *p) const
 
template<typename T >
bool is () const
 
bool is_cond_type (ModConditionally_t type) const
 
void set_cond (const Parameter *p)
 
void set_cond (ModConditionally_t ct, cstring n)
 
template<typename T >
const T * to () const
 
- Public Member Functions inherited from P4::IHasDbPrint
void print () const
 

Additional Inherited Members

- Protected Attributes inherited from ActionData::Parameter
cstring _cond_name
 
ModConditionally_t _cond_type = NONE
 

Detailed Description

A Meter Color Map RAM outputs an 8-bit color to bits 24..31 of immediate. Only one meter can currently be connected to a single table's logical table (though perhaps later maybe more than one meter can be accessed). Similar to random number, the entire 8-bits of output is used by the meter color, thus nothing else can be allocated to those 8 bits.

However, unlike Random, because only one meter can exist per logical table, there is no need to complicate the merge and subset functions

Member Function Documentation

◆ can_merge()

bool ActionData::MeterColor::can_merge ( const Parameter * ad) const
overridevirtual

Reimplemented from ActionData::Parameter.

◆ dbprint()

void ActionData::MeterColor::dbprint ( std::ostream & out) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ equiv_value()

bool ActionData::MeterColor::equiv_value ( const Parameter * ad,
bool check_cond = true ) const
overridevirtual

Implements ActionData::Parameter.

◆ from_p4_program()

bool ActionData::MeterColor::from_p4_program ( ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ get_extended_param()

const Parameter * ActionData::MeterColor::get_extended_param ( uint32_t extension,
const Parameter *  ) const
overridevirtual

Implements ActionData::Parameter.

◆ is_next_bit_of_param()

bool ActionData::MeterColor::is_next_bit_of_param ( const Parameter * ad,
bool same_alias ) const
overridevirtual

Implements ActionData::Parameter.

◆ is_subset_of()

bool ActionData::MeterColor::is_subset_of ( const Parameter * ad) const
overridevirtual

Reimplemented from ActionData::Parameter.

◆ merge()

const Parameter * ActionData::MeterColor::merge ( const Parameter * ad) const
overridevirtual

Reimplemented from ActionData::Parameter.

◆ name()

cstring ActionData::MeterColor::name ( ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ only_one_overlap_solution()

bool ActionData::MeterColor::only_one_overlap_solution ( ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ overlap()

const Parameter * ActionData::MeterColor::overlap ( const Parameter * ad,
bool only_one_overlap_solution,
le_bitrange * my_overlap,
le_bitrange * ad_overlap ) const
overridevirtual

Implements ActionData::Parameter.

◆ size()

int ActionData::MeterColor::size ( ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ split()

const Parameter * ActionData::MeterColor::split ( int lo,
int hi ) const
overridevirtual

Implements ActionData::Parameter.