P4C
The P4 Compiler
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Table::Actions Class Reference

Classes

struct  Action
 

Public Types

typedef IterValues< map_t::const_iterator >::iterator const_iterator
 
typedef IterValues< map_t::iterator >::iterator iterator
 
typedef map_t::value_type value_type
 

Public Member Functions

 Actions (Table *tbl, VECTOR(pair_t) &)
 
Actionaction (const std::string &n)
 
void add_action_format (const Table *, json::map &) const
 
void add_immediate_mapping (json::map &)
 
void add_p4_params (const Action &, json::vector &) const
 
iterator begin ()
 
const_iterator begin () const
 
int count ()
 
int default_actions_count () const
 
iterator end ()
 
const_iterator end () const
 
bool exists (const std::string &n)
 
void gen_tbl_cfg (json::vector &) const
 
bool has_hash_dist ()
 
int hit_actions_count () const
 
void pass1 (Table *)
 
void pass2 (Table *)
 
size_t size ()
 
void stateful_pass2 (Table *)
 
template<class REGS>
void write_regs (REGS &, Table *)
 

Public Attributes

int max_code = -1
 

Member Function Documentation

◆ add_action_format()

void Table::Actions::add_action_format ( const Table * table,
json::map & tbl ) const

This following few fields are required on a per stage table action basis. The following information is:

  • next_table - The value that will be written into the next field RAM line on a hit, when the entry is specified with this action. This is either an index into the next_table_map_en (if that map is enabled), or the 8 bit next table value.
  • next_table_full - The value that will be written into the miss register for next table (next_table_format_data.match_next_table_adr_miss_value), if this action is set as the default action. This is the full 8 bit (9 bit for JBay) next table.
  • vliw_instruction - The value that will be written into the action instruction RAM entry when the entry is specified with this action. This is either an index into into the 8 entry table mau_action_instruction_adr_map_data, if that is enabled, or the full word instruction
  • vliw_instruction_full - The value that will written into the miss register for action_instruction (mau_action_instruction_adr_miss_value), when this action is specified as the default action. The full address with the PFE bit enabled.