21#include <nvhls_types.h>
22#include <hls_globals.h>
23#include <nvhls_array.h>
25#include <nvhls_assert.h>
26#include <nvhls_message.h>
30inline std::string synth_to_string(
const unsigned int&
n) {
32 std::ostringstream
stm;
76template <
typename Type,
unsigned int VectorLength>
81 static const unsigned int type_width = Wrapped<Type>::width;
83 static const unsigned int width = type_width *
VectorLength;
84 static const bool is_signed = Wrapped<Type>::is_signed;
100#pragma hls_unroll yes
107#pragma hls_unroll yes
114#pragma hls_unroll yes
121#pragma hls_unroll yes
123 out.data[
i] = data[
i];
125 Type& operator[](
unsigned int i) {
126 return this->data[
i];
128 const Type& operator[](
unsigned int i)
const {
129 return this->data[
i];
134#pragma hls_unroll yes
142#pragma hls_unroll yes
148 template <
unsigned int Size>
150 #pragma hls_unroll yes
157template <
typename Type,
unsigned int VectorLength>
158inline bool operator==(
162#pragma hls_unroll yes
168template <
typename Type,
unsigned int VectorLength>
169inline std::ostream& operator<<(std::ostream&
os,
215#pragma hls_unroll yes
262#pragma hls_unroll yes
308#pragma hls_unroll yes
355#pragma hls_unroll yes
356#pragma cluster addtree
357#pragma cluster_type both
411#pragma hls_unroll yes
412#pragma cluster multadd addtree
413#pragma cluster_type both
468#pragma hls_unroll yes
492#pragma hls_unroll yes
493#pragma cluster addtree
494#pragma cluster_type both
Vector helper container with vector operations.
nvhls_t< W >::nvuint_t get_slc(type X, const unsigned int i)
Function that returns slice of bits.
type1 set_slc(type1 X, type2 Y, const unsigned int i)
Function that replaces slice of bits.
void vector_mul(nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
Function implementing vector multiplication.
void vector_sub(nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
Function implementing vector subtraction.
void vector_add(nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
Function implementing vector addition.
void vector_mac(nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< InType3, VectorLength > in3, nv_scvector< OutType, VectorLength > &out)
Function implementing vector multiply and add.
void reduction(nv_scvector< InType, VectorLength > in, OutType &out)
Function implementing vector reduction.
void dp(nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, OutType &out)
Function implementing vector dot-product.