The handling of FPGA bitstreams and derivation of bin files & device trees is complex and spread across different layers and recipes.
There are two use cases - either to use HDF_PATH and define a single .xsa file to be included in the Yocto image,
or to define PL_VARIANTS_DIR and PL_VARIANTS and use multiple .xsa files to be bundled in the image along with their respective device tree overlays.
These have to be defined at a central place visible to all other recipes; e.g. local.conf or the application's layer.conf.
-
PL_SUFFIX: Defines an (optional) suffix for the package names of the programmable logic related packages such asexternal-hdf,bitstream-extractionetc. This makes it possible to assign a project name to the packages, and to avoid name collisions in a shared package feed. Example:PL_PKG_SUFFIX = "-example-design"The PL-related packages will then be named
external-hdf-example-design(..).rpm,bitstream-extraction-example-design(..).rpm, etc. -
PL_VARIANTS: Defines a set of basenames of.xsafiles to be bundled into the root filesystem. Example:PL_VARIANTS_damc-fmc2zup = "zu11eg zu19eg"The build system will then use the basename and for each variant try to find a file such as
zu11eg.xsa,zu11eg-1.2.3.xsaorzu11eg-1.2.3-4-g12345678.xsa.
-
meta-xilinx-tools/recipes-bsp/hdf/external-hdf.bb- Acquires the hardware description
.xsadeclared byHDF_PATHorPL_VARIANTS_DEFAULTin the downstream recipe & installs it to/opt/xilinx/hw-design/design.xsa. - Deploys the
.xsato${DEPLOYDIR}/Xilinx-${MACHINE}.xsa.
- Acquires the hardware description
-
meta-techlab-utils/recipes-bsp/hdf/external-hdf.bbappend- Acquires and deploys
.xsafiles whenPL_VARIANTS_DIRis set, or falls back toHDF_PATH, which must be an absolute path unless the file is provided in a further overlay. WhenHDF_PATHcontains an asterisk (*), the glob result with the latest modification time is selected. - Sets a default variant as defined in
PL_VARIANTS_DEFAULT. IfPL_VARIANTS_DEFAULTis not set, it uses the firstPL_VARIANTas default one. - Picks up version suffixes in filenames such as
zu11eg-1.2.3.xsaorzu11eg-1.2.3-45-g12345678.xsa.
- Acquires and deploys
-
meta-<application>/.../hdf/external-hdf.bbappend- Defines
HDF_PATHorPL_VARIANTS_DIR,PL_VARIANTS_DEFAULTand provides.xsafiles.
- Defines
meta-techlab-utils/recipes-bsp/device-tree-from-bd/device-tree-from-bd.bb- Creates a
app_from_bd.dtsfor the.xsainHDF_PATHorPL_VARIANTS_DEFAULT. - When
PL_VARIANTSis set, it also iterates through all.xsafiles provided byexternal-hdfand creates aapp_from_bd_<variant>.dtsfor each.
- Creates a
meta-techlab-bsp/recipes-bsp/device-tree/device-tree.bbappend- Adds on-board (system) peripherals, defined in board-specific
system-user.dtsi, tosystem-top.dts. - Adds BSP related information (drivers etc) for PL, defined in board-specific
pl-conf.dtsi, topl.dtsi. - When
PL_VARIANTSis set, it iterates throughapp_from_bd_<variant>.dtsfor all variants and for each one, merges it with the other PL related files topl-var-<variant>.dtsi. - Upstream
device-tree.bbwill create apl-var-<variant>.dtbofor each of them.
- Adds on-board (system) peripherals, defined in board-specific
-
meta-xilinx-tools/recipes-bsp/bitstream/bitstream-extraction_git.bb- Extracts
.bitfile from.xsafile.
- Extracts
-
meta-techlab-utils/recipes-bsp/device-tree-from-bd/bitstream-extraction_git.bbappend- Also extracts bitfiles from all variants declared in
PL_VARIANTS.
- Also extracts bitfiles from all variants declared in
-
meta-xilinx-tools/recipes-bsp/fpga-manager-util/fpga-manager-util_1.0.bb- Generates binfile from bitfile.
- Installs binfile & device tree overlay
.dtboto/lib/firmware/...on rootfs.
-
meta-techlab-utils/recipes-bsp/device-tree-from-bd/fpga-manager-util_%.bbappend- Also creates binfiles and installs binfiles & device tree overlays for all
PL_VARIANTS.
- Also creates binfiles and installs binfiles & device tree overlays for all
meta-techlab-bsp/recipes-bsp/fpgautil-init/fpgautil-init.bb- Installs init script which downloads the appropriate bitstream into the FPGA & installs the appropriate device tree overlay in the Linux system.