I m learning to use PYNQ by using a vector addition ip but it doesn t seem to work properly when I call the ip on the KR 260 development board. When I use the status register to check the ip running its return value is always 0. My PYNQ version is the latest and the vitis unified 24.2.
#include "vector.h"
#include "string.h"
#define max 50000
void load(int *A,int*B,int A_buffer[max],int B_buffer[max]){
#pragma HLS DATAFLOW
//
memcpy(A_buffer,(const int*)A,max*sizeof(int));
memcpy(B_buffer,(const int*)B,max*sizeof(int));
}
void vector_add_top(int *A,int *B,int *C){
#pragma HLS INTERFACE mode=s_axilite port=return
#pragma HLS INTERFACE mode=m_axi port=C bundle=C depth=50000 offset=slave
#pragma HLS INTERFACE mode=m_axi port=B bundle=B depth=50000 offset=slave
#pragma HLS INTERFACE mode=m_axi port=A bundle=A depth=50000 offset=slave
int A_buffer[max];
int B_buffer[max];
int C_buffer[max];
#pragma HLS BIND_STORAGE variable=C_buffer type=ram_2p impl=lutram
#pragma HLS ARRAY_PARTITION variable=A_buffer dim=1 factor=10 type=cyclic
#pragma HLS ARRAY_PARTITION variable=B_buffer dim=1 factor=10 type=cyclic
#pragma HLS ARRAY_PARTITION variable=C_buffer dim=1 factor=10 type=cyclic
load(A,B,A_buffer,B_buffer);
for(int i = 0;i<max;i++){
#pragma HLS UNROLL factor=10
#pragma HLS PIPELINE
C_buffer[i] = A_buffer[i] + B_buffer[i];
}
//
memcpy(C,C_buffer,max*sizeof(int));
}