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

#include <action_format.h>

Inheritance diagram for ActionData::Argument:
[legend]

Public Member Functions

 Argument (IR::ID n, le_bitrange pf)
 
void dbprint (std::ostream &out) const override
 
bool equiv_value (const Parameter *ad, 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 *ad, bool) const override
 
cstring name () const override
 
bool only_one_overlap_solution () const override
 
cstring originalName () const
 
const Parameteroverlap (const Parameter *ad, bool guaranteed_one_overlap, le_bitrange *my_overlap, le_bitrange *ad_overlap) const override
 
le_bitrange param_field () const
 
int size () const override
 
const Parametersplit (int lo, int hi) const override
 
- Public Member Functions inherited from ActionData::Parameter
virtual bool can_merge (const Parameter *param) const
 
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
 
virtual bool is_subset_of (const Parameter *param) const
 
virtual const Parametermerge (const Parameter *param) 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

This class is to represent a slice of an IR::MAU::ActionArg, essentially any argument that appears as a direct argument of an action and is used in an ALU operation:

Let's take the following example:

action act(bit<8> param1, bit<8> param2) { hdr.f1 = param1; hdr.f2 = param2; }

All valid bitranges of param1 and param2, e.g. param1[7:0] or param2[5:4] would be valid instantiations of the Argument class

Member Function Documentation

◆ dbprint()

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

Implements ActionData::Parameter.

◆ equiv_value()

bool ActionData::Argument::equiv_value ( const Parameter * ad,
bool check_cond = true ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ from_p4_program()

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

Implements ActionData::Parameter.

◆ get_extended_param()

const Parameter * ActionData::Argument::get_extended_param ( uint32_t extension,
const Parameter *  ) const
inlineoverridevirtual

Implements ActionData::Parameter.

◆ is_next_bit_of_param()

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

Implements ActionData::Parameter.

◆ name()

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

Implements ActionData::Parameter.

◆ only_one_overlap_solution()

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

Implements ActionData::Parameter.

◆ overlap()

const Parameter * ActionData::Argument::overlap ( const Parameter * ad,
bool guaranteed_one_overlap,
le_bitrange * my_overlap,
le_bitrange * ad_overlap ) const
overridevirtual

Returns an Argument if the two Arguments have some equivalency overlap, i.e.: param1[8:15] param1[12:19]

would return param1[12:15]

The two bitrange pointers are overlap offsets into the arguments, i.e. in the corner case: [4:7] [0:3]

Implements ActionData::Parameter.

◆ size()

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

Implements ActionData::Parameter.

◆ split()

const Parameter * ActionData::Argument::split ( int lo,
int hi ) const
inlineoverridevirtual

Implements ActionData::Parameter.