Python Environment Setup - 2022.2 English

Vitis Tutorials: AI Engine Development

Document ID
Release Date
2022.2 English

The external traffic generators use Python and require non-standard packages to be installed. Perform the following steps to install these packages.

  1. Make sure you are using the latest version of Python 3. This tutorial has been developed with version 3.6.5. Run the following command to check the version:

    python3 --version
  2. Install the appropriate packges using pip.

    pip3 install requirements.txt

    This file contains the following packages:

  3. Validate your environment by running the following command. If errors are reported during import, rerun pip and install the packages manually.

    python3 -c 'import numpy, matplotlib, struct, multiprocessing'
  4. Add the provided packages for external traffic generators to the PYTHONPATH. Run the following command:

    export PYTHONPATH=${XILINX_VIVADO}/data/emulation/hw_em/lib/python/:${XILINX_VIVADO}/data/emulation/ip_utils/xtlm_ipc/xtlm_ipc_v1_0/python/:$XILINX_VIVADO/data/emulation/python/xtlm_ipc:${PYTHONPATH}

IMPORTANT: Before beginning the tutorial make sure you have read and followed the Vitis Software Platform Release Notes (v2022.2) for setting up software and installing the VCK190 base platform.

Before starting this tutorial run the following steps.

  1. Set up your platform by running the xilinx-versal-common-v2022.2/environment-setup-cortexa72-cortexa53-xilinx-linux script as provided in the platform download. This script sets up the SYSROOT and CXX variables. If the script is not present, you must run xilinx-versal-common-v2022.2/

  2. Set up your ROOTFS to point to the xilinx-versal-common-v2022.2/rootfs.ext4.

  3. Set up your IMAGE to point to xilinx-versal-common-v2022.2/Image.

  4. Set up your PLATFORM_REPO_PATHS environment variable based upon where you downloaded the platform.

Before starting this tutorial, run the following steps.

  1. Set up the following paths in the script

export XILINX_TOOLS_LOCATION=<Path to Vitis Build - Directory>/Vitis/2022.2
export XILINX_VERSAL_SW=<Path to xilinx-versal-common-v2022.2 - Directory>
export XILINX_XRT=/<user-path>/opt/xilinx/xrt
export PYTHON3_LOCATION=<user-path>
  1. This sets the necessary paths to run the tutorial:

    • ROOTFS, IMAGE, SYSROOT, CXX, and SDKTARGETSYSROOT for host software compilation.

    • LIBRARY_PATH to handle external traffic generator handles.

    • PATH and PYTHONPATH for the Python-based external traffic generator.

export PYTHON3_LOCATION=<user-path>
  1. Run the source script in the console.