Overlay Tutorial incorrect | PYNQ readthedocs

Hello,
I am a beginner to PYNQ and I was following this Overlay Tutorial — Python productivity for Zynq (Pynq)
I have a PYNQ Z2 board and when I ran the HLS code under this
Overlay Tutorial — Python productivity for Zynq (Pynq)
The HLS (Vitis HLS 2023.1) tool threw errors as shown below


Can anyone help me resolve this? I am very new to PYNQ, it would be really helpful if someone could link me to resources which would help me learn these.
Thanks

Hi @varun_samaga,

Welcome to the PYNQ community.

You should use a Vivado version that aligns with the PYNQ version you’re using. Vivado 2023.1 is not supported to rebuild the overlay.

https://pynq.readthedocs.io/en/latest/pynq_sd_card.html

Best,
Mario

Hey Mario,
Thanks for your response.
It would be really helpful if you guys update the docs to include this redirect so beginners like me don’t fall into this pitfall! The add implementation actually did work with 2023.1 so that led to this issue. I had implemented some other random simple stuff with 2023.1 too and they worked too. So if you have any idea for the reason for this incompatibility between different versions, could you shine some light on it (I’m just curious!)?

EDIT(18/6/23): The HLS tool failed to regenerate again for the same code, I have installed Vitis HLS 2022.1 as my PYNQ image is v3. The same errors were generated, looks like the code is out of date?
Thanks again,
Varun

@marioruiz

I think this is a good chance to ask a confusing question that seen in many posts.

Q1 PYNQ Image compile tool version is strict ? (For example Vivado 2020.2 for PYNQ 2.7)

Q2 PYNQ overlay version however is slack? (For example PYNQ 3.0.1 can accept overlay from Vivado 2020.2 or before) Of cause some uses tcl and some are hwh but not really matter a lot as they can both generated accordingly.

Overlay = bit+hwh OR bit+tcl
Image = Ubuntu + PYNQ Python Engine etc

Thanks,

ENJOY~

@varun_samaga,

Thank you for the suggestion, we’ll look into updating the documentation in the next release.

For a particular version of PYNQ we only have verified the Vivado version listed in the table.

EDIT(18/6/23): The HLS tool failed to regenerate again for the same code, I have installed Vitis HLS 2022.1 as my PYNQ image is v3. The same errors were generated, looks like the code is out of date?
Thanks again,
Varun

Did you start from a fresh version of the PYNQ repo?

Mario

1 Like

@briansune,

Q1 PYNQ Image compile tool version is strict ? (For example Vivado 2020.2 for PYNQ 2.7)

To generate the SD Card image, we only highly recommend the tools version associated to the release. Other version may work, but there’s no warranty.

Q2 PYNQ overlay version however is slack? (For example PYNQ 3.0.1 can accept overlay from Vivado 2020.2 or before) Of cause some uses tcl and some are hwh but not really matter a lot as they can both generated accordingly.

Yes, this could work. But, IP version change between releases. So, there’s a chance that the drivers won’t work properly.

Mario

1 Like

@marioruiz

Understood with thank you.

Maybe a short suggestion would improve the next readme doc:

For PYNQ-Z2 and Z1, the base overlay should involve Vivado IP(s).
Any IP(s) in the base overlay can show a table of IP revision between previous and latest PYNQ Image. So User can easily know Vivado cross-compile is possible or not.

As we all know there are too many IP in Vivado and listing all IP revision is unreasonable.
But overlay involved IP(s) should give a good clue to user cross-compilation risk.

ENJOY~

I am not quite sure what you mean, the PYNQ SD card image was downloaded from the vendor(https://www.tulembedded.com/fpga/ProductsPYNQ-Z2.html) if that’s what you are asking.
I had a fresh install of Vitis HLS on another user account and a completely new project on Vitis HLS which failed the code.
I’ve rerun the synthesis tool and copied the errors into this pastebin for further inspection.
Error details - Pastebin.com

Regards,
Varun

Hi @varun_samaga,

The code should be rewritten like to to work in the new versions of Vitis HLS

#include "ap_axi_sdata.h"
typedef ap_axiu<32, 1, 1, 1> stream_type;

void mult_constant(hls::stream<stream_type> &in_data, hls::stream<stream_type> &out_data,
		ap_int<32> constant) {
#pragma HLS PIPELINE II=1
#pragma HLS INTERFACE s_axilite register port=constant
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in_data
#pragma HLS INTERFACE axis port=out_data
	stream_type tmp;
	in_data.read(tmp);
	tmp.data = tmp.data * constant;
	out_data.write(tmp);
}

Mario

Hey Mario,
Thanks for the corrected code. I’ve done other stuff using the AXI stream after following this beautifully written tutorial here. The problem seems resolved. I think the docs need to be updated with this code as well so as this doesn’t become a pitfall for beginners.
Thanks for the help again.
Varun

2 Likes