P4C
The P4 Compiler
Loading...
Searching...
No Matches
Memories::Use Struct Reference

Classes

struct  Gateway
 
struct  Row
 
struct  ScmLoc
 
struct  Way
 

Public Types

enum  h_bus_t {
  NONE , LEFT_HBUS1 , LEFT_HBUS2 , RIGHT_HBUS1 ,
  RIGHT_HBUS2
}
 
enum  type_t {
  EXACT , ATCAM , TERNARY , GATEWAY ,
  TIND , IDLETIME , COUNTER , METER ,
  SELECTOR , STATEFUL , ACTIONDATA
}
 

Public Member Functions

void clear ()
 
void clear_allocation ()
 
void clear_scm ()
 
int get_way (int row, int col)
 
bool is_twoport () const
 
int rams_required () const
 
bool separate_search_and_result_bus () const
 

Public Attributes

IR::MAU::ColorMapramAddress cma = IR::MAU::ColorMapramAddress::NOT_SET
 
safe_vector< Rowcolor_mapram
 
safe_vector< UniqueIddleft_learn
 
safe_vector< UniqueIddleft_match
 
Gateway gateway
 
safe_vector< std::pair< int, int > > home_row
 
std::map< ScmLoc, std::pair< int, h_bus_t > > loc_to_gb
 
safe_vector< int > local_tind
 
safe_vector< Rowrow
 
int table_id = -1
 
int tind_result_bus = -1
 
enum Memories::Use::type_t type
 
std::map< UniqueId, ordered_set< UniqueId > > unattached_tables
 
std::string used_by
 
safe_vector< Wayways
 

Friends

std::ostream & operator<< (std::ostream &out, const Way &w)
 

Member Function Documentation

◆ separate_search_and_result_bus()

bool Memories::Use::separate_search_and_result_bus ( ) const

A function to determine whether or not the asm_output for a table needs to have a separate search bus and result bus printed, rather than having just a single bus, as the result bus a search bus have different values.

Member Data Documentation

◆ unattached_tables

std::map<UniqueId, ordered_set<UniqueId> > Memories::Use::unattached_tables

This is a map of AttachedMemory UniqueIds that are shared with other tables, i.e. Action Profiles. The AttachedMemory though shared, is only allocated on one table The key is the id of the table underneath the current table, and the value is the id of where the allocation of that table is.

In the assembly, the name from associated with the value will point to the correct assembly allocated name.

The map will only be valid under the associated match portion, i.e the EXACT/TERNARY portion of the key