Python Environment Setup - 2022.2 English

Vitis Tutorials: AI Engine (XD100)

Document ID
XD100
Release Date
2022-12-01
Version
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:

    numpy
    multiprocessing
    struct
    matplotlib
    
  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/sdk.sh.

  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 env_setup.sh:

export XILINX_TOOLS_LOCATION=<Path to Vitis Build - Directory>/Vitis/2022.2
export PLATFORM_REPO_PATHS=<YOUR-PLATFORMS-DIRECTORY>
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 env_setup.sh 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 env_setup.sh script in the console.