P4C
The P4 Compiler
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
VLIW::Operand Struct Reference
Inheritance diagram for VLIW::Operand:
[legend]

Classes

struct  Action
 
struct  Base
 
struct  Const
 
struct  HashDist
 
struct  Named
 
struct  Phv
 
struct  RandomGen
 
struct  RawAction
 

Public Member Functions

 Operand (const ::Phv::Ref &r)
 
 Operand (const Operand &a)
 
 Operand (gress_t gress, int stage, const value_t &v)
 
 Operand (Operand &&a)
 
 Operand (Table *tbl, const Table::Actions::Action *act, const value_t &v)
 
unsigned bitoffset (int group)
 
int bits (int group, int dest_size=-1)
 
bool check ()
 
void dbprint (std::ostream &out) const
 
Baseoperator-> ()
 
Operandoperator= (const Operand &a)
 
Operandoperator= (Operand &&a)
 
bool operator== (Operand &a)
 
int phvGroup ()
 
bool phvRead (std::function< void(const ::Phv::Slice &sl)> fn)
 
template<class T>
T * to ()
 
bool valid () const
 
- Public Member Functions inherited from P4::IHasDbPrint
void print () const
 

Public Attributes

struct VLIW::Operand::Baseop
 

Static Public Attributes

static const int ACTIONBUS_OPERAND = 0x20
 

Member Function Documentation

◆ dbprint()

void VLIW::Operand::dbprint ( std::ostream & out) const
inlinevirtual

Implements P4::IHasDbPrint.

Member Data Documentation

◆ ACTIONBUS_OPERAND

const int VLIW::Operand::ACTIONBUS_OPERAND = 0x20
static

A source operand to a VLIW instruction – this can be a variety of things, so we have a pointer to an abstract base class and a number of derived concrete classes for the different kinds of operands. When we parse the operand, the type may be determined, or if it is just a name, we will have to wait to a later pass to resolve what the name refers to. At that point, the ‘Named’ object created in parsing will be replaced with the actual operand type