In the [project-root] you can start the full build with make all or make all_targets after taking following prerequisites into account:
Before starting the build, please correctly setup the 2024.2 version of Vivado, Vitis and Petalinux/Yocto
If the tools are not setup correctly the build will stop with an ERROR message telling you what is not correctly setup!
Note: The Yocto Tool setup is not verified!
Note: The Petalinux Tool and Version check is skipped when targetting Yocto!
Everything is in the GitHub repository; no extra files are needed.
Although some are downloaded from GitHub; but that is handled by the Makefiles.
Exception: For building petalinux OFFLINE, you will need to download and extract some
tar.gzfiles. This is explained in more detail below.Exception: For building with Yocto-build, you will need to install Yocto. This is explained in more detail below.
All dependencies in every
Makefileare setup in such a way that if you need to rebuild after a certain modification; then it ONLY rebuilds what is needed to be rebuild.Example: After already done a full build before, modify
[project-root]/vitis/ip/vadd_s/src/vadd_s.cpp. Then, if you runmake allfrom the[project-root], it will ONLY rerun thev++ --compile(for the vadd_s), thev++ --link, and thev++ --package.This is to showcase that NO full rebuild is required after every (small) modification once you builded before the platform and did not modify the platform.
Recommendation is to start
make allormake all_targetsalways from the[project-root], but of course you can runmake allin every sub-module if for example you want to check if a sub-module is building correctly.Note: You could remove the
${GRAPH_O}dependency for thev++ --linkstep in the[project-root]/vitis/Makefile; but ONLY when you FIX your AIE I/O ports in Vitis/Vivado and do NOT do modifications anymore on the AIE I/O port definitions!
[project-root]/Makefilemainmakeoptions:make allto build everything for the specifiedTARGET.make cleanto clean everything for the specifiedTARGET.make clean_vitisto clean everything (ip, ps_apps, vitis) after the (fixed) platform for the specifiedTARGET.make all_targetsto build everything for ALLTARGETS.make ultracleanto clean everything for ALLTARGETS.make ultraclean_vitisto clean everything (ip, ps_apps, vitis) after the (fixed) platform for ALLTARGETS.
[project-root]/Makefileexport options to be changed if needed:BOARD_NAME:export BOARD_NAME := vck190for targetting a VCK190 board (default).export BOARD_NAME := vek280for targetting a VEK280 board.export BOARD_NAME := vek280_es1for targetting a VEK280_ES1 board.
TARGET:export TARGET := hwfor targetting a board (default).export TARGET := hw_emufor targetting hardware emulation (change if needed).The build flow supports both TARGETs in the same
[project-root]; if you need both results at once, you can domake all_targetsfrom the[project-root]!Some generated directories are depending on the
TARGETselection and are further shown as[dir]_${TARGET}.
XPFM_PRE_BUILDS:export XPFM_PRE_BUILDS := falsefor building xpfm (default).export XPFM_PRE_BUILDS := truefor using the xpfm pre-builds.Be sure that the environment
PLATFORM_REPO_PATHSis set and pointing to theinternal_platformsof the used version.This should be set by sourcing Vivado
settingsXY.shand/or VitissettingsXY.sh.
Note:
export TARGET := hw_emuis NOT supported and will error out.
LINUX_PRE_BUILDS:export LINUX_PRE_BUILDS := falsefor building linux (default).export LINUX_PRE_BUILDS := truefor using the linux pre-builds.To be updated! Download the
xilinx-versal-common-v2024.2_xxx.tar.gzfrom the Xilinx® Website and…Extract it
cd xilinx-versal-common-v2024.2xilinx-versal-common-v2024.2 $ ./sdk.shEnter target directory for Petalinux tools (default:
/opt/petalinux/2024.2)
Make sure sourcing Vivado
settingsXY.shand/or VitissettingsXY.shfirst!xilinx-versal-common-v2024.2 $ unset LD_LIBRARY_PATHxilinx-versal-common-v2024.2 $ source environment-setup-cortexa72-cortexa53-xilinx-linuxNote: The latter 3 items must be executed each time you start in a new terminal or when changing versions!
Note: Following
LINUX_X_Yexports are ignored and do not need setup whenexport LINUX_PRE_BUILDS := true.Note: If
export XPFM_PRE_BUILDS := falsethen a device-tree will be generated from the generated xsa. It could be - depending on the generated base platform (xsa) - that changes are needed in the[project-root]/linux/dtg/src/system-user.dtsifor a successfull build/boot.
ILA_EN:export ILA_EN := 0for disabling the ILA (default).export ILA_EN := 1for enabling the ILA (change if needed).Note: When building vitis with
export TARGET := hw_emuILA_EN will be forced toILA_EN = 0(ILA Disabled) in the[project-root]/vitis/Makefile. There is NO issue to first build everything withexport TARGET := hwandexport ILA_EN := 1and afterwards ONLY rebuild vitis withexport TARGET := hw_emu! NO need for a full rebuild in that respect!More information on how to setup and use the ILA can be found in the Notes
SW_BUILD_TOOL:export SW_BUILD_TOOL := petalinuxto use Petalinux as linux build tool (default).export SW_BUILD_TOOL := yoctoto use Yocto as linux build tool (change if needed).
LINUX_YOCTO_ROOT:ONLY required to setup when
export SW_BUILD_TOOL := yocto.Defaults to
export LINUX_YOCTO_ROOT := ${HOME}/binso please change to your local Yocto install directory.More information on how to install/setup and build Yocto can be found here.
LINUX_TMP_DIR:Defaults to
export LINUX_TMP_DIR := /tmp/${USER}/${REQUIRED_VERSION}/${SW_BUILD_TOOL}Defaults to
/tmp/${USER}/2024.2/petalinuxwhenexport SW_BUILD_TOOL := petalinux.Defaults to
/tmp/${USER}/2024.2/yoctowhenexport SW_BUILD_TOOL := yocto.
So if you want to place it somewhere else; please replace it with your required location.
Be aware that
LINUX_TMP_DIRmay NOT be located on an NFS mounted drive!If your [project-root] is NOT on an NFS mounted drive; you can easily add it in your project with for example
export LINUX_TMP_DIR := $(shell pwd)/linux/tmp
LINUX_BUILD_SOURCES:ONLY supported for
export SW_BUILD_TOOL := petalinux!export LINUX_BUILD_SOURCES := networkfor using online network build-sources (default).export LINUX_BUILD_SOURCES := localfor using offline LOCALLY STORED build-sources (change if needed).Below described
LINUX_LOCAL_DOWNLOADS_DIRANDLINUX_LOCAL_SSTATE_DIRMUST be setup!Note: First petalinux sysroot build needs online build-sources! But it is handled by the Makefiles.
LINUX_LOCAL_DOWNLOADS_DIR:ONLY used when
export SW_BUILD_TOOL := petalinuxandexport LINUX_BUILD_SOURCES := local!Defaults to
export LINUX_LOCAL_DOWNLOADS_DIR := /tmp/plnx-workspace/downloads.Change to the directory where you extracted the downloads_2024.2.tar.gz.
This can be shared amoungst different users.
LINUX_LOCAL_SSTATE_DIR:ONLY used when
export SW_BUILD_TOOL := petalinuxandexport LINUX_BUILD_SOURCES := local!Defaults to
export LINUX_LOCAL_SSTATE_DIR := /tmp/plnx-workspace/sstate_aarch64_2024.2/aarch64.Change to the WRITABLE directory where you extracted the sstate_aarch64_2024.2.tar.gz.
This can be shared amoungst different users.
LINUX_ETH_CONFIG:export LINUX_ETH_CONFIG := DHCPfor Ethernet DHCP Configuration (default).export LINUX_ETH_CONFIG := STATICfor Ethernet Static Configuration (change if needed).Please setup your required Ethernet Static Configuration in
[project-root]/linux/src/recipes-bsp/init-ifupdown/interfaces.
Note: When you like to have Ethernet connectivity (ssh/scp/…) during hardware emulation
export TARGET := hw_emu:The recommendation is to use
export LINUX_ETH_CONFIG := DHCP.Please read “Networking in QEMU” carefully.
End result:
export TARGET := hw:[project-root]/package_linux_hw/sd_card/*can be used to copy to a FAT-32 SD-card (partition)Note: This cannot be used when
export LINUX_PRE_BUILDS := true(due to only ext4 rootfs available)
[project-root]/package_linux_hw/sd_card.imgcan be used to be put on an SD-card with a Windows tool likeWin32 Disk Imager
export TARGET := hw_emu:[project-root]/package_linux_hw_emu/launch_hw_emu.shcan be used to launch the hardware emulation.