KR260 PYNQ ip calling problem

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));
}  

 

Hi @Tritone7-6,

Welcome to the PYNQ community.

One quick thing I noticed is the max_size=5000 in the python code, but 50000 in the HLS code.

Mario

Thanks for your reply, I use vector_ip.register_map.CTRL.AP_START=1 instead of vector_ip.write to START the start bit in the control register, ip can now be called normally.

Is your problem solved now?

yes, all is working now

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.