MatchLib
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>
...
read_data = banks.read(bank_addr, bank_sel);
banks.write(bank_addr, bank_sel, write_data);
...
Abstract Memory Class.
Definition: mem_array.h:199

Definition at line 199 of file mem_array.h.


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