In the 2 previous articles, we have seen that we can use the AMD Vitis™ Functional Simulation (VFS) feature to simulate an AI Engine graph directly from a Python or MATLAB® test bench.
When developing with AMD Versal™ AI Engine, collaboration between embedded and algorithm engineers is crucial. What we have seen in the previous articles is that simulating an AI Engine graph in Python or MATLAB requires sharing all source files and dependencies and having the Vitis tools installed on the machine. However, there’s a streamlined approach: sharing only the output of the AI Engine x86compiler for use with the Vitis Functional Simulation (VFS) utility in Python or MATLAB®.
This article demonstrates how to:
- Share compiled AI Engine graph outputs for simulation.
- Run VFS simulations without a full Vitis installation.
Note: This tutorial was created using AMD Vitis 2025.1. Tool flow may vary in other versions of the tool.Generating VFS Files from the AI Engine x86compiler
When generating an AI Engine graph using the Vitis AI Engine x86compiler we can get a VFS folder we can use the the VFS flow.
You can run make all TARGET=x86sim from the following folder from my GitHub repository to rebuild the Vitis workspace and run the x86compiler for the AI Engine component:
https://github.com/xflorentw/AI_Engine_Basic/tree/main/02_FFT_AIE-ML
If we open the workspace and look on the outputs generated for the x86sim target we can find a folder vfs with 2 files (aie_interface_spec.json and libvfssim.so):
We can feed this folder directly to the vfs module in Python. I am copying this folder directly in my vfs folder:
02_FFT_AIE-ML]$ cp -r workspace/fft_1024/build/x86sim/Work/vfs/python/In the vfs folder, I have created a new Python script:
This file is basically the same file as fft1024_dsplib_vfs.py that we have seen in the first tutorial about running VFS from Python, with only a change in the line instantiating the vfs graph object
# Initialize the AIE graph
myaiefft = vfs.aieGraph(vfs_build_dir = "./vfs/")You can see that instead of passing all the AI Engine graph configuration, I am only passing the vfs folder that was generated by the AI Engine compiler.
I still need to setup the Vitis Environment to run VFS:
source <install location>/2025.1/Vitis/settings64.shThen I can run the Python script:
[python]$ python3 ./independant_fft1024_dsplib_vfs.py
Loaded AIEGraph
AI Engine FFT matches the Python FFT within 2 LSBYou can see that the vfs simulation is running without the need to run the AI Engine compiler as we have fed the compiled output.
Running VFS in Python without Vitis InstallationNote: This is an unofficial workflow and not supported by AMD. Use at your own risk and check licensing terms before distributing proprietary modules.
While this is not a flow supported by AMD and more a hack that I have found on Linux, it is possible to run the VFS simulation by grabbing the required Python modules from the Vitis installation. This might be useful if the algorithm engineer does not want to have the full Vitis installation on his/her machine.
I am creating a new folder called Python path under 02_FFT_AIE-ML/vfs/python and then copying the vfs and varray python modules that I have found under the Vitis Install directory:
[python]$ mkdir python_path
[python]$ cp -r
[python]$ cp -r $XILINX_VITIS/functional_suite/varray/python/varray ./python_path/
[python]$ cp -r $XILINX_VITIS/functional_suite/vfs/python/vfs ./python_path/I noticed that some other modules and libraries are required so I am copying them as well. Note that I am using Python 3.10 here
[python]$ export PYTHONVER=310
[python]$ mkdir python_path/common
[python]$ cp -r $XILINX_VITIS/functional_suite/common/python ./python_path/common/
[python]$ mkdir python_path/lib
[python]$ cp $XILINX_VITIS/functional_suite/lib/python/common_bind.cpython-$PYTHONVER-x86_64-linux-gnu.so ./python_path/lib/
[python]$ cp $XILINX_VITIS/functional_suite/lib/python/varray_bind.cpython-$PYTHONVER-x86_64-linux-gnu.so ./python_path/lib/
[python]$ cp $XILINX_VITIS/functional_suite/lib/python/vfs_bind.cpython-$PYTHONVER-x86_64-linux-gnu.so ./python_path/lib/Then we need to add the new directory to the python path by setting the environment variable PYTHONPATH
[python]$ export PYTHONPATH=$PWD/python_path:$PWD/python_path/lib:$PYTHONPATHNow we can run the VFS simulation without the need to set up the Vitis Installation (thus without the need of the full Vitis Installation):
[python]$ which vitis
[python]$ python3 independant_fft1024_dsplib_vfs.py
Loaded AIEGraph
AI Engine FFT matches the Python FFT within 2 LSBSummaryIn this article we have seen how we can share a the output of the AI Engine compiler targeting x86sim to run Vitis Functional Simulation without requiring the source files or without even requiring the full Vitis Installation.
Disclaimers- AMD, Versal, and Vitis are trademarks or registered trademarks of Advanced Micro Devices, Inc.
- Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.








Comments