mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-29 03:24:22 +00:00
16 lines
519 B
C++
16 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];
|
||
|
}
|
||
|
}
|