MatchLib
All Classes Namespaces Files Functions Modules Pages
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, VectorLengthbase_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;
}
nvhls_t< W >::nvuint_t get_slc(type X, const unsigned int i)
Function that returns slice of bits.
Definition nvhls_int.h:437

Definition at line 145 of file nvhls_array.h.

Member Typedef Documentation

◆ base_t

Definition at line 148 of file nvhls_array.h.

Constructor & Destructor Documentation

◆ nv_array() [1/4]

template<typename Type , unsigned int VectorLength>
nvhls::nv_array< Type, VectorLength >::nv_array ( )
inline

Definition at line 149 of file nvhls_array.h.

◆ nv_array() [2/4]

template<typename Type , unsigned int VectorLength>
nvhls::nv_array< Type, VectorLength >::nv_array ( const char prefix)
inline

Definition at line 150 of file nvhls_array.h.

◆ nv_array() [3/4]

template<typename Type , unsigned int VectorLength>
nvhls::nv_array< Type, VectorLength >::nv_array ( sc_module_name  prefix)
inline

Definition at line 151 of file nvhls_array.h.

◆ nv_array() [4/4]

template<typename Type , unsigned int VectorLength>
nvhls::nv_array< Type, VectorLength >::nv_array ( sc_module_name  prefix,
const unsigned int id 
)
inline

Definition at line 152 of file nvhls_array.h.


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