PYNQ custom overlay using m_axi Interface not working

Hello, I am using trying to get a simple square root IP working in PYNQ.

This is the HLS Code for the IP:


include <hls_math.h>

void axi4_sqrt(float *in, float *out, int len)
#pragma HLS INTERFACE s_axilite port=return bundle=sqrt
#pragma HLS INTERFACE s_axilite port=len bundle=sqrt
#pragma HLS INTERFACE m_axi depth=50 port=out offset=slave bundle=output
#pragma HLS INTERFACE m_axi depth=50 port=in offset=slave bundle=input
#pragma HLS INTERFACE s_axilite port=in
#pragma HLS INTERFACE s_axilite port=out

float buff[100];
memcpy(buff, (const float*) in, len * sizeof(float));
for(int i = 0; i < len; i++)
buff[i] = sqrt(buff[i]);
memcpy(out, (const float*) buff, len * sizeof(float));

And I have also attached my Vivado block design file. design_1.pdf (75.0 KB)

In PYNQ Jupyter Notebook, I am running the given code:

What am I doing wrong? My IP is not giving any output, the entire buffer is 0.

Please help. Thank you.

I think, you just didn’t start your IP properly :slight_smile:
Also why are you reading mmio result? output_buffer should be modified after running IP.
You could try to make this IP free running and test if this is an issue

Hi, could you please explain in a bit more detail?
How do I start my IP? The sqrt_ip.write(0x00, 0x1) is the code for starting the IP< is it not?

Also, how do I make this IP free running?

I have solved my issue and am closing this post.

In my case, the HLS code had its input and output data type as float and I had used int32 in the PYNQ Jupyter Notebook. Replacing the data type as float32 resolved the error.

1 Like