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: PYNQ/sdbuild at master Ā· Xilinx/PYNQ Ā· GitHub
and here (not yet updated on readthedocs): PYNQ/pynq_sd_card.rst at master Ā· Xilinx/PYNQ Ā· GitHub
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 Releases Ā· Xilinx/PYNQ Ā· GitHub

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: Fix bug in pynq pre.sh for external boards by giunatale Ā· Pull Request #979 Ā· Xilinx/PYNQ Ā· GitHub
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