PYNQ: PYTHON PRODUCTIVITY FOR ZYNQ

Use pre-built PYNQ/boards base, logictools, etc?

Support,

I manually ran make for the base, logictools, etc for each board in the PYNQ/boards directories. When I ran PYNQ/sdbuild/make BOARDDIR=<my_board_dir> BOARDS=<my_board> it once again had to re-build all the base, logictools, etc for each board. Is there a way to have the build process use all the pre-built overlays from the PYNQ/boards directories ? I assume the PYNQ/sdbuild/build/PYNQ/boards/* are copied from the PYNQ/boards/* directories however they do not copy the pre-built base overlays etc.

regards

Hi @rfdmod
There’s a new feature that handles the build you’re looking for. It’s so recent it hasn’t made it to the documentation yet. Take a look at this post:
https://discuss.pynq.io/t/problems-getting-build-system-up-and-running/665/18

Thanks,
-Pat

1 Like

I’d recommend you use the fature @patocarr suggested and avoid building the bistreams yourself altogether. I also suggest you to use the prebuilt rootfs so you will save even more time.

The two options are documented here: https://github.com/Xilinx/PYNQ/tree/master/sdbuild
and here (not yet updated on readthedocs): https://github.com/Xilinx/PYNQ/blob/master/docs/source/pynq_sd_card.rst
In particular:

The relevant excerpt from the sdbuild readme:


To use a board-agnostic image to build a board-specific image you can pass the PREBUILT variable:

make PREBUILT=<image path> BOARDS=<board>

To use a previously built PYNQ source distribution tarball you can pass the PYNQ_SDIST variable. This will also avoid having to rebuild bitstreams (except for external boards) and MicroBlazes’ bsps and binaries.

make PYNQ_SDIST=<sdist tarball path>

1 Like

Hi Gnatele,

I used the two options mentioned, however it is still trying to re-build the bitstreams
for the boards.

When PYNQ/sdbuild/build/PYNQ/sdbuild/packages/pynq/pre.sh reaches
line 41 overlays=find . -maxdepth 2 -iname 'makefile' -printf '%h\n' | cut -f2 -d"/"
it will not find any overlays since the ‘makefiles’ are not present in the untarred pynq-2.5.tar.gz

I downloaded pynq-2.5.tar.gz from https://github.com/Xilinx/PYNQ/releases

you can see this in my log file below:

++ ls /home/user/local/git/PYNQ/sdbuild/build/PYNQ/sdist_untar/pynq-2.5/boards

  • boards=‘Pynq-Z1
    Pynq-Z2
    ZCU104’
  • for bd_name in ‘$boards’
  • cd /home/user/local/git/PYNQ/sdbuild/build/PYNQ/sdist_untar/pynq-2.5/boards/Pynq-Z1
    ++ find . -maxdepth 2 -iname makefile -printf ‘%h\n’
    ++ cut -f2 -d/
  • overlays=
  • for bd_name in ‘$boards’
  • cd /home/user/local/git/PYNQ/sdbuild/build/PYNQ/sdist_untar/pynq-2.5/boards/Pynq-Z2
    ++ find . -maxdepth 2 -iname makefile -printf ‘%h\n’
    ++ cut -f2 -d/
  • overlays=
  • for bd_name in ‘$boards’
  • cd /home/user/local/git/PYNQ/sdbuild/build/PYNQ/sdist_untar/pynq-2.5/boards/ZCU104
    ++ find . -maxdepth 2 -iname makefile -printf ‘%h\n’
    ++ cut -f2 -d/
  • overlays=
  • rm -rf /home/user/local/git/PYNQ/sdbuild/build/PYNQ/sdist_untar
  • cd /home/user/local/git/PYNQ/sdbuild/build/PYNQ
  • ./build.sh
    ./build.sh

Script for building default overlays, microblaze bsp’s and binaries.

skipping bitstream base.bit for SnickerdoodleBlack
skipping bitstream logictools.bit for Pynq-Z2
building bitstream base.bit for Pynq-Z2
make[1]: Entering directory ‘/home/user/local/git/PYNQ/sdbuild/build/PYNQ/boards/Pynq-Z2/base’
vivado -mode batch -source build_base_ip.tcl -notrace

I am sorry, you are totally right! During testing, I happened to use an sdist that had the makefile in it so I introduced this bug. I’ll immediately file a PR to fix it.
In the meantime, I suggest you change the incriminated line with what the PR will look like


into
overlays=find . -maxdepth 2 -iname ‘*.bit’ -printf ‘%h\n’ | cut -f2 -d"/"``

EDIT: PR submitted: https://github.com/Xilinx/PYNQ/pull/979
Thanks again for pointing this out!

1 Like

I’m not sure if this will affect anyone else but I am using a vmware virtual machine and after patching the overlay line as suggested and restarting the build, I received the following error:

rm -rf base *.jou *.log NA
make[1]: Leaving directory ‘/home/user/local/git/PYNQ/sdbuild/build/PYNQ/boards/ZCU104/base’

  • cd /home/user/local/git/PYNQ/sdbuild/build/PYNQ
  • python3 setup.py sdist
    Traceback (most recent call last):
    File “setup.py”, line 34, in
    from setuptools import setup, Extension, find_packages, Distribution
    ImportError: No module named ‘setuptools’
  • unmount_special

To fix this I had to do the following:

sudo apt install python3-pip
sudo pip3 install --upgrade “setuptools>=24.2.0”

After that the build completed fine. The entire build after a make clean now only takes about 27 minutes for my setup !! Thanks for all your work.

1 Like

setup_host.sh has this install at the bottom.

So this should not be a problem. Perhaps I am assuming you built the VM before I did the PR to fix the imagebuild (that’s when I added that line in setup_host)

btw, the PR mentioned above got merged yesterday :slight_smile:

Again, thanks for reporting this out!

1 Like