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.gz
files. 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
Makefile
are 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 all
from 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 all
ormake all_targets
always from the[project-root]
, but of course you can runmake all
in 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++ --link
step 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]/Makefile
mainmake
options:make all
to build everything for the specifiedTARGET
.make clean
to clean everything for the specifiedTARGET
.make clean_vitis
to clean everything (ip, ps_apps, vitis) after the (fixed) platform for the specifiedTARGET
.make all_targets
to build everything for ALLTARGETS
.make ultraclean
to clean everything for ALLTARGETS
.make ultraclean_vitis
to clean everything (ip, ps_apps, vitis) after the (fixed) platform for ALLTARGETS
.
[project-root]/Makefile
export options to be changed if needed:BOARD_NAME
:export BOARD_NAME := vck190
for targetting a VCK190 board (default).export BOARD_NAME := vek280
for targetting a VEK280 board.export BOARD_NAME := vek280_es1
for targetting a VEK280_ES1 board.
TARGET
:export TARGET := hw
for targetting a board (default).export TARGET := hw_emu
for 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_targets
from the[project-root]
!Some generated directories are depending on the
TARGET
selection and are further shown as[dir]_${TARGET}
.
XPFM_PRE_BUILDS
:export XPFM_PRE_BUILDS := false
for building xpfm (default).export XPFM_PRE_BUILDS := true
for using the xpfm pre-builds.Be sure that the environment
PLATFORM_REPO_PATHS
is set and pointing to theinternal_platforms
of the used version.This should be set by sourcing Vivado
settingsXY.sh
and/or VitissettingsXY.sh
.
Note:
export TARGET := hw_emu
is NOT supported and will error out.
LINUX_PRE_BUILDS
:export LINUX_PRE_BUILDS := false
for building linux (default).export LINUX_PRE_BUILDS := true
for using the linux pre-builds.To be updated! Download the
xilinx-versal-common-v2024.2_xxx.tar.gz
from the Xilinx® Website and…Extract it
cd xilinx-versal-common-v2024.2
xilinx-versal-common-v2024.2 $ ./sdk.sh
Enter target directory for Petalinux tools (default:
/opt/petalinux/2024.2
)
Make sure sourcing Vivado
settingsXY.sh
and/or VitissettingsXY.sh
first!xilinx-versal-common-v2024.2 $ unset LD_LIBRARY_PATH
xilinx-versal-common-v2024.2 $ source environment-setup-cortexa72-cortexa53-xilinx-linux
Note: The latter 3 items must be executed each time you start in a new terminal or when changing versions!
Note: Following
LINUX_X_Y
exports are ignored and do not need setup whenexport LINUX_PRE_BUILDS := true
.Note: If
export XPFM_PRE_BUILDS := false
then 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.dtsi
for a successfull build/boot.
ILA_EN
:export ILA_EN := 0
for disabling the ILA (default).export ILA_EN := 1
for enabling the ILA (change if needed).Note: When building vitis with
export TARGET := hw_emu
ILA_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 := hw
andexport ILA_EN := 1
and 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 := petalinux
to use Petalinux as linux build tool (default).export SW_BUILD_TOOL := yocto
to 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}/bin
so 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/petalinux
whenexport SW_BUILD_TOOL := petalinux
.Defaults to
/tmp/${USER}/2024.2/yocto
whenexport 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_DIR
may 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 := network
for using online network build-sources (default).export LINUX_BUILD_SOURCES := local
for using offline LOCALLY STORED build-sources (change if needed).Below described
LINUX_LOCAL_DOWNLOADS_DIR
ANDLINUX_LOCAL_SSTATE_DIR
MUST 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 := petalinux
andexport 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 := petalinux
andexport 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 := DHCP
for Ethernet DHCP Configuration (default).export LINUX_ETH_CONFIG := STATIC
for 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.img
can 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.sh
can be used to launch the hardware emulation.