P4C
The P4 Compiler
Loading...
Searching...
No Matches
Tofino::Memories Struct Reference
Inheritance diagram for Tofino::Memories:
[legend]

Public Types

using Use = ::Memories::Use
 

Public Member Functions

void add_table (const IR::MAU::Table *t, const IR::MAU::Table *gw, TableResourceAlloc *resources, const LayoutOption *lo, const ActionData::Format::Use *af, ActionData::FormatType_t ft, int entries, int stage_table, attached_entries_t attached_entries)
 
bool allocate_all ()
 
bool allocate_all_dummies ()
 
void clear ()
 
const ordered_map< cstring, int > collect_sram_block_alloc_info () override
 
void fill_placed_scm_table (const IR::MAU::Table *, const TableResourceAlloc *)
 
void printOn (std::ostream &) const
 
void remove (const std::map< UniqueId, Use > &alloc)
 
void remove (cstring name, const Use &alloc)
 
void shrink_allowed_lts ()
 
void update (const std::map< UniqueId, Use > &alloc)
 
void update (cstring name, const Use &alloc)
 
void visitUse (const Use &, std::function< void(cstring &, update_type_t)> fn)
 
- Public Member Functions inherited from Memories
virtual void init_shared (int stage)
 
cstring last_failure () const
 

Static Public Attributes

static constexpr int ACTION_TABLES_MAX = 16
 
static constexpr int BUS_COUNT = 2
 
static constexpr int COLOR_MAPRAM_PER_ROW = 4
 
static constexpr int GATEWAYS_PER_ROW = 2
 
static constexpr int IMEM_ADDRESS_BITS = 6
 
static constexpr int IMEM_LOOKUP_BITS = 3
 
static constexpr int LEFT_SIDE_COLUMNS = 4
 
static constexpr int LEFT_SIDE_RAMS = LEFT_SIDE_COLUMNS * SRAM_ROWS
 
static constexpr int LOGICAL_ROW_MISSING_OFLOW = 8
 
static constexpr int LOGICAL_TABLES = 16
 
static constexpr int MAPRAM_COLUMNS = 6
 
static constexpr int MAPRAM_MASK = (1U << MAPRAM_COLUMNS) - 1
 
static constexpr int MATCH_CENTRAL_ROW = 4
 
static constexpr int MAX_DATA_SWBOX_ROWS = 5
 
static constexpr int MAX_METERS_COLOR_MAPRAM_PER_ALU = 5
 
static constexpr int MAX_METERS_RAM_PER_ALU = MAPRAM_COLUMNS * MAX_METERS_ROW_PER_ALU
 
static constexpr int MAX_METERS_ROW_PER_ALU = 4
 
static constexpr int MAX_PARTITION_RAMS_PER_ROW = 5
 
static constexpr int MAX_STATS_RAM_PER_ALU = MAPRAM_COLUMNS * MAX_STATS_ROW_PER_ALU
 
static constexpr int MAX_STATS_ROW_PER_ALU = 3
 
static constexpr int METER_ALUS = 4
 
static constexpr int NUM_IDLETIME_BUS = 10
 
static constexpr int PAYLOAD_COUNT = 2
 
static constexpr int RIGHT_SIDE_COLUMNS = SRAM_COLUMNS - LEFT_SIDE_COLUMNS
 
static constexpr int RIGHT_SIDE_RAMS = RIGHT_SIDE_COLUMNS * SRAM_ROWS
 
static constexpr int SRAM_COLUMNS = 10
 
static constexpr int SRAM_DEPTH = 1024
 
static constexpr int SRAM_ROWS = 8
 
static constexpr int STASH_UNITS = 2
 
static constexpr int STATS_ALUS = 4
 
static constexpr int TABLES_MAX = 16
 
static constexpr int TCAM_COLUMNS = 2
 
static constexpr int TCAM_DEPTH = 512
 
static constexpr int TCAM_ROWS = 12
 
static constexpr int TERNARY_TABLES_MAX = 8
 
- Static Public Attributes inherited from Memories
static constexpr int ACTION_TABLES_MAX = 16
 
static constexpr int BUS_COUNT = 2
 
static constexpr int COLOR_MAPRAM_PER_ROW = 4
 
static constexpr int GATEWAYS_PER_ROW = 2
 
static constexpr int IMEM_ADDRESS_BITS = 6
 
static constexpr int IMEM_LOOKUP_BITS = 3
 
static constexpr int LAMB_DEPTH = 64
 
static constexpr int LEFT_SIDE_COLUMNS = 4
 
static constexpr int LEFT_SIDE_RAMS = LEFT_SIDE_COLUMNS * SRAM_ROWS
 
static constexpr int LOCAL_TIND_DEPTH = 64
 
static constexpr int LOGICAL_ROW_MISSING_OFLOW = 8
 
static constexpr int LOGICAL_TABLES = 16
 
static constexpr int MAPRAM_COLUMNS = 6
 
static constexpr int MAPRAM_MASK = (1U << MAPRAM_COLUMNS) - 1
 
static constexpr int MATCH_CENTRAL_ROW = 4
 
static constexpr int MAX_DATA_SWBOX_ROWS = 5
 
static constexpr int MAX_PARTITION_RAMS_PER_ROW = 5
 
static constexpr int MAX_STATS_RAM_PER_ALU = MAPRAM_COLUMNS * MAX_STATS_ROW_PER_ALU
 
static constexpr int MAX_STATS_ROW_PER_ALU = 3
 
static constexpr int METER_ALUS = 4
 
static constexpr int NUM_IDLETIME_BUS = 10
 
static constexpr int PAYLOAD_COUNT = 2
 
static constexpr int RIGHT_SIDE_COLUMNS = SRAM_COLUMNS - LEFT_SIDE_COLUMNS
 
static constexpr int RIGHT_SIDE_RAMS = RIGHT_SIDE_COLUMNS * SRAM_ROWS
 
static constexpr int SRAM_COLUMNS = 10
 
static constexpr int SRAM_DEPTH = 1024
 
static constexpr int SRAM_ROWS = 8
 
static constexpr int STASH_UNITS = 2
 
static constexpr int STATS_ALUS = 4
 
static constexpr int TABLES_MAX = 16
 
static constexpr int TCAM_DEPTH = 512
 
static constexpr int TERNARY_TABLES_MAX = 8
 
static constexpr int TOTAL_LAMBS = 8
 
static constexpr int TOTAL_LOCAL_TIND = 16
 
static constexpr int TOTAL_SRAMS = SRAM_ROWS * SRAM_COLUMNS
 

Friends

std::ostream & operator<< (std::ostream &out, const Memories::table_alloc &ta)
 
std::ostream & operator<< (std::ostream &out, const result_bus_info &rbi)
 
std::ostream & operator<< (std::ostream &out, const safe_vector< Memories::table_alloc * > &v)
 
std::ostream & operator<< (std::ostream &out, const search_bus_info &sbi)
 
class SetupAttachedTables
 

Additional Inherited Members

- Static Public Member Functions inherited from Memories
static Memoriescreate ()
 
- Public Attributes inherited from Memories
int local_stage = -1
 
- Protected Types inherited from Memories
enum  update_type_t {
  NONE , UPDATE_RAM , UPDATE_MAPRAM , UPDATE_GATEWAY ,
  UPDATE_PAYLOAD , UPDATE_SEARCH_BUS , UPDATE_RESULT_BUS , UPDATE_ACTION_BUS ,
  UPDATE_TIND_BUS , UPDATE_STATEFUL_BUS
}
 
- Protected Member Functions inherited from Memories
- Protected Attributes inherited from Memories
cstring failure_reason
 

Member Function Documentation

◆ add_table()

void Memories::add_table ( const IR::MAU::Table * t,
const IR::MAU::Table * gw,
TableResourceAlloc * resources,
const LayoutOption * lo,
const ActionData::Format::Use * af,
ActionData::FormatType_t ft,
int entries,
int stage_table,
attached_entries_t attached_entries )
virtual

Implements Memories.

◆ allocate_all()

bool Memories::allocate_all ( )
virtual

Implements Memories.

◆ allocate_all_dummies()

bool Memories::allocate_all_dummies ( )
virtual

Reimplemented from Memories.

◆ clear()

void Memories::clear ( )
virtual

Implements Memories.

◆ collect_sram_block_alloc_info()

const ordered_map< cstring, int > Tofino::Memories::collect_sram_block_alloc_info ( )
inlineoverridevirtual

Implements Memories.

◆ fill_placed_scm_table()

void Tofino::Memories::fill_placed_scm_table ( const IR::MAU::Table * ,
const TableResourceAlloc *  )
inlinevirtual

Implements Memories.

◆ printOn()

void Memories::printOn ( std::ostream & out) const
virtual

Implements Memories.

◆ remove() [1/2]

void Memories::remove ( const std::map< UniqueId, Use > & alloc)
virtual

Implements Memories.

◆ remove() [2/2]

void Memories::remove ( cstring name,
const Use & alloc )
virtual

Implements Memories.

◆ shrink_allowed_lts()

void Tofino::Memories::shrink_allowed_lts ( )
inlinevirtual

Implements Memories.

◆ update() [1/2]

void Memories::update ( const std::map< UniqueId, Use > & alloc)
virtual

Implements Memories.

◆ update() [2/2]

void Memories::update ( cstring name,
const Use & alloc )
virtual

Implements Memories.

◆ visitUse()

void Memories::visitUse ( const Use & alloc,
std::function< void(cstring &, update_type_t)> fn )
virtual

Implements Memories.