1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-22 16:14:24 +00:00
hpc-2022-g3/hls/lab1/exercise_0_solution.cpp
Gianluca Brilli 3c3ddf4bec HLS lab 1
2021-05-13 21:40:40 +02:00

17 lines
575 B
C++
Executable file

#define TEST_DATA_SIZE 4194304 // 2^22
const unsigned int c_dim = TEST_DATA_SIZE;
void vadd(int *a, int *b, int *c, const int len)
{
#pragma HLS INTERFACE m_axi port=a offset=slave bundle=mem
#pragma HLS INTERFACE m_axi port=b offset=slave bundle=mem
#pragma HLS INTERFACE m_axi port=c offset=slave bundle=mem
#pragma HLS INTERFACE s_axilite port=len bundle=params
#pragma HLS INTERFACE s_axilite port=return bundle=params
loop: for(int i = 0; i < len; i++) {
#pragma HLS LOOP_TRIPCOUNT min=c_dim max=c_dim
c[i] = a[i] + b[i];
}
}