Xilinx / Vitis_Embedded_Platform_Source

115 stars 67 forks source link

Vitis Embedded Platform Source Repository

Welcome to the Vitis embedded platform source repository. This repository contains the source code needed to recreate, modify, and extend the Xilinx-provided Vitis embedded platforms.

To build the Vitis embedded platforms from source code in this repository, you will need to have the following tools installed and follow the build instructions:

To learn how to customize Vitis embedded platforms, please refer to Vitis Platform Creation Tutorials.

This repository is divided into two sections:

Build Instructions

Vitis environment need to be setup before building the platform.

  source <Vitis_install_path>/Vitis/2023.2/settings64.sh

This package comes with sources to generate the Vitis platform with these steps:

  1. Generate hardware specification file (XSA) using Vivado.
  2. Generate software components of platform (using XSCT).
  3. Generate the Vitis platform by packaging hardware and software together using XSCT tool

The following table summarizes use cases of platforms build :

Build Platform with pre-built Linux
Introduction: This method uses pre-built software components. Time taken for building sw components can be reduced
Requirements: Common Software. Use Sysroot SDK from Common Software
Pre-Synth command: make all PREBUILT_LINUX_PATH=<path/to/common_sw/dir>
Post-Impl command: make all PRE_SYNTH=FALSE PREBUILT_LINUX_PATH=<path/to/common_sw/dir>

The platform hardware has two types.

Note: For Versal platforms, the PDI in XSA will always be pre-synth PDI.

There are two methods to prepare the platform software.

The Flags used in commands of above table are explained below :

After the build process completes, the built platform output is located at platform_repo/<platform_name>/export/<platform_name>/ directory.

Notes:

Installing the Common Software

Xilinx provides pre-built Common Software images so that user can skip PetaLinux project creation and build process for common usages. They can be downloaded from Xilinx Download Center under Vitis Embedded Platform tab or PetaLinux tab. Please refer to Common images for Embedded Vitis platforms section.

The common image packages download contains these components

You can use the following command to extract the tar image.

tar -xzf xilinx-<arch>-common-<version>.tar.gz

To use the common software, download pre-built common images from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms.html and extract the common images to /opt/xilinx/platform/ or pass it as PREBUILT_LINUX_PATH parameter make command.

Installing the Sysroot (Yocto SDK)

Vitis applications require to build with libaries in sysroot (Yocto SDK). Sysroot can be installed from sdk.sh, which is included in Common Software images. Building Vitis base platforms doesn't require sysroot.

To install sysroot from sdk.sh, you can run the script sdk.sh directly.

./sdk.sh

You can also check the available options for scripting.

./sdk.sh --help
Usage: sdk.sh [-y] [-d <dir>]
  -y         Automatic yes to all prompts
  -d <dir>   Install the SDK to <dir>
======== Extensible SDK only options ============
  -n         Do not prepare the build system
  -p         Publish mode (implies -n)
======== Advanced DEBUGGING ONLY OPTIONS ========
  -S         Save relocation scripts
  -R         Do not relocate executables
  -D         use set -x to see what is going on
  -l         list files that will be extracted

To cross-compile with this SDK from the command line, run source ./environment-setup-*-xilinx-linux to set up your environment (cross-compile build tools, libraries, etc).