1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-29 03:24:22 +00:00
hpc-2022-g3/hls/lab1/exercise_0/vadd.cpp

16 lines
519 B
C++
Raw Normal View History

2022-05-26 15:05:36 +00:00
#include "vadd.h"
void sum (int *a, int *b, int *c, int n) {
#pragma HLS INTERFACE s_axilite port=n bundle=regfile
#pragma HLS_INTERFACE s_axilite port=return bundle=regfile
#pragma HLS INTERFACE m_axi port=a offset=slave depth=max_elem bundle=a_mem
#pragma HLS INTERFACE m_axi port=b offset=slave depth=max_elem bundle=bc_mem
#pragma HLS INTERFACE m_axi port=c offset=slave depth=max_elem bundle=bc_mem
for (int i = 0; i < n; i++) {
#pragma HLS LOOP_TRIPCOUNT min=max_elem max=max_elem
c[i] = a[i] + b[i];
}
}