MatchLib
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mem_array_sep< T, NumEntries, 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)
 
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

nvhls::nv_array< BankType, NumBanks > bank
 

Static Public Attributes

static const unsigned int NumEntriesPerBank = NumEntries/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 NumEntries, int NumBanks, int NumByteEnables = 1>
class mem_array_sep< T, NumEntries, NumBanks, NumByteEnables >

Abstract Memory Class.

Template Parameters
TDatatype of an entry to be stored in memory
NumEntriesNumber of entries 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);
...

Definition at line 83 of file mem_array.h.


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