MatchLib
Public Types | Public Member Functions | List of all members
nvhls::nv_array< Type, VectorLength > Class Template Reference

An implementation of array that declares VectorLength variables for array of size VectorLength. More...

#include <nvhls_array.h>

Inheritance diagram for nvhls::nv_array< Type, VectorLength >:
nvhls::nv_array_bank_array_no_assert_base< Type, VectorLength >

Public Types

typedef nv_array_bank_array_no_assert_base< Type, VectorLength > base_t
 

Public Member Functions

 nv_array (const char *prefix)
 
 nv_array (sc_module_name prefix)
 
 nv_array (sc_module_name prefix, const unsigned int &id)
 
- Public Member Functions inherited from nvhls::nv_array_bank_array_no_assert_base< Type, VectorLength >
 nv_array_bank_array_no_assert_base (const char *prefix)
 
Type & operator[] (size_t idx)
 
const Type & operator[] (size_t idx) const
 

Detailed Description

template<typename Type, unsigned int VectorLength>
class nvhls::nv_array< Type, VectorLength >

An implementation of array that declares VectorLength variables for array of size VectorLength.

Template Parameters
TypeDatatype
VectorLengthSize of array
Overview
  • Declares VectorLength variables to realize an array of size VectorLength
  • Helpful when HLS tool does not recognize your array correctly and requires unrolling array
  • nv_array also has specialization for size 0 arrays
  • Usage of this class is not recommended for new models. Instead, 1) If the array is modeling a RAM/ROM, use a dedicated class for this purpose such as ac_bank_array. 2) If the array is not modeling a RAM/ROM, use a dedicated class for this purpose. In both cases, the dedicated classes should always assert on invalid indexes.
A Simple Example
#include <nvhls_array.h>
...
nvhls::nv_array<NVUINT32, ArraySize> array;
for (unsigned i = 0; i < ArraySize; i++) {
array[i] = i;
}

Definition at line 145 of file nvhls_array.h.


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