1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-26 01:54:22 +00:00
hpc-2022-g3/hls/lab1/exercise_0/vadd.cpp
2022-05-26 17:05:36 +02:00

15 lines
519 B
C++

#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];
}
}