Running Traffic Generators in Python/C++/MATLAB - 2023.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2023-12-13
Version
2023.2 English

After generating an external process binary as shown above using the headers and sources available at $XILINX_VIVADO/data/emulation/ip_utils/xtlm_ipc/xtlm_ipc_v1_0/<supported_language>, you can run the emulation using the following steps:

  1. For C++, set the LD_LIBRARY_PATH as export LD_LIBRARY_PATH=$XILINX_VIVADO/data/emulation/cpp/lib:$LD_LIBRARY_PATH
  2. For Python, set the PYTHONPATH as: export PYTHONPATH=$XILINX_VIVADO/data/emulation/hw_em/lib/python:$XILINX_VIVADO/data/emulation/python/xtlm_ipc/
  3. For MATLAB, set the following inside the script:
    vivado = getenv("XILINX_VIVADO");
    libPath = fullfile(vivado, "/data/emulation/matlab/xtlm_ipc");
    addpath(libPath)
  4. For Advanced C++ Traffic Generator APIs, launch the AMD Vitis™ emulation, the AMD Vivado™ simulation or x86sim/AI Enginesim using the standard process and wait for the simulation to start. For AI Engine specific APIs, use $XILINX_VIVADO/data/emulation/python/xtlm_ipc_v2/.
  5. From another terminal, launch the external process such as Python/C++/C. If you are running multiple I/O or traffic generator-based solutions on the same machine, set XTLM_IPC_SOCK_DIR to be unique to each test case on both the emulation terminal in addition to the external process terminal. For example, setenv XTLM_IPC_SOCK_DIR <test_case_dir> (same environment on both emulation process and external process).
    Note: The traffic generator executable and hw_emu/sw_emu or x86sim/aiesim should be run on the same server/machine.
Warning: AMD provides an end_of_simulation() API to terminate emulation from master utilities of memory mapped AXI4 and AXI4-Stream interfaces. However, you are warned not to use this method unless there is no way to terminate emulation from host. In a normal course of emulation, external process is not expected to terminate emulation. Use this in exceptional scenarios.