MatchLib
All Classes Namespaces Files Functions Modules Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables > Class Template Reference

Abstract Memory Class. More...

#include <mem_array.h>

Public Types

typedef Wrapped< T > WData_t
 
typedef sc_lv< WordWidth > Data_t
 
typedef sc_lv< SliceWidth > Slice_t
 
typedef Slice_t BankType[NumEntriesPerBank *NumByteEnables]
 

Public Member Functions

typedef NVUINTW (nvhls::index_width< NumEntriesPerBank >::val) LocalIndex
 
typedef NVUINTW (nvhls::index_width< NumEntriesPerBank *NumByteEnables >::val) LocalSliceIndex
 
typedef NVUINTW (nvhls::index_width< NumBanks >::val) BankIndex
 
typedef NVUINTW (NumByteEnables) WriteMask
 
typedef NVUINTW (nvhls::index_width< NumByteEnables >::val) ByteEnableIndex
 
void clear ()
 
read (LocalIndex idx, BankIndex bank_sel=0, WriteMask read_mask=~static_cast< WriteMask >(0))
 
void write (LocalIndex idx, BankIndex bank_sel, T val, WriteMask write_mask=~static_cast< WriteMask >(0), bool wce=1)
 
template<unsigned int Size>
void Marshall (Marshaller< Size > &m)
 

Public Attributes

BankType bank [NumBanks]
 

Static Public Attributes

static const unsigned int NumEntries = NumEntriesPerBank*NumBanks
 
static const unsigned int WordWidth = WData_t::width
 
static const unsigned int SliceWidth = WordWidth/NumByteEnables
 
static const int width = NumEntries * WordWidth
 

Detailed Description

template<typename T, int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
class mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >

Abstract Memory Class.

Template Parameters
TDatatype of an entry to be stored in memory
NumEntriesPerBankNumber of entries per bank in memory
NumBanksNumber of banks in memory
A Simple Example
#include <mem_array.h>
...
mem_array_opt <MemWord_t, NUM_ENTRIES_PER_BANK, NBANKS> banks;
read_data = banks.read(bank_addr, bank_sel);
banks.write(bank_addr, bank_sel, write_data);
...

Definition at line 199 of file mem_array.h.

Member Typedef Documentation

◆ WData_t

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
typedef Wrapped<T> mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::WData_t

Definition at line 201 of file mem_array.h.

◆ Data_t

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
typedef sc_lv<WordWidth> mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::Data_t

Definition at line 208 of file mem_array.h.

◆ Slice_t

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
typedef sc_lv<SliceWidth> mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::Slice_t

Definition at line 209 of file mem_array.h.

◆ BankType

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
typedef Slice_t mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::BankType[NumEntriesPerBank *NumByteEnables]

Definition at line 213 of file mem_array.h.

Constructor & Destructor Documentation

◆ mem_array_opt()

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::mem_array_opt ( )
inline

Definition at line 218 of file mem_array.h.

Member Function Documentation

◆ clear()

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
void mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::clear ( )
inline

Definition at line 235 of file mem_array.h.

◆ read()

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
T mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::read ( LocalIndex  idx,
BankIndex  bank_sel = 0,
WriteMask  read_mask = ~static_cast<WriteMask>(0) 
)
inline

Definition at line 244 of file mem_array.h.

◆ write()

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
void mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::write ( LocalIndex  idx,
BankIndex  bank_sel,
val,
WriteMask  write_mask = ~static_cast<WriteMask>(0),
bool  wce = 1 
)
inline

Definition at line 263 of file mem_array.h.

◆ Marshall()

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
template<unsigned int Size>
void mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::Marshall ( Marshaller< Size > &  m)
inline

Definition at line 285 of file mem_array.h.

Member Data Documentation

◆ NumEntries

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
const unsigned int mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::NumEntries = NumEntriesPerBank*NumBanks
static

Definition at line 202 of file mem_array.h.

◆ WordWidth

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
const unsigned int mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::WordWidth = WData_t::width
static

Definition at line 203 of file mem_array.h.

◆ SliceWidth

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
const unsigned int mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::SliceWidth = WordWidth/NumByteEnables
static

Definition at line 204 of file mem_array.h.

◆ bank

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
BankType mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::bank[NumBanks]

Definition at line 215 of file mem_array.h.

◆ width

template<typename T , int NumEntriesPerBank, int NumBanks = 1, int NumByteEnables = 1>
const int mem_array_opt< T, NumEntriesPerBank, NumBanks, NumByteEnables >::width = NumEntries * WordWidth
static

Definition at line 216 of file mem_array.h.


The documentation for this class was generated from the following file: