|
Version: Vitis 2026.2
- Introduction
- Setup Instructions
- Available Examples
- AXI4-Stream, Packet Switching, and Width Conversion
- Standalone VFS Installation
Vitis Functional Simulation (VFS) allows you to functionally simulate AI Engine graphs and/or HLS kernels in both MATLAB® and Python™ environments on Linux. It presents simple APIs to compile and simulate your design. VFS is designed to be easy to use and provides a familiar environment for users who are already accustomed to using MATLAB or Python.
Vitis Functional Simulation (VFS) leverages "varray" (Vitis array), a module supporting all the data types available in AMD devices in both MATLAB and Python environments and allowing conversion and casting between the types.
For more information on Vitis Functional Simulation and Vitis array, refer to the Vitis Functional Simulation User Guide (UG1864).
Source the appropriate settings file:
[shell]% source <vitis_install_folder>/settings64.sh
Launch Python (supports 3.9 to 3.14). The following modules are required:
numpyscipymatplotlib
To set up a virtual environment with all dependencies:
python3 -m venv my-venv
source my-venv/bin/activate
pip install --upgrade pip
pip install numpy scipy matplotlibThen in your Python script:
import vfs
import varray as vaAlternatively, run ./create_venv.sh to create my-venv with these modules installed.
Some AIE examples (aie/firComplex, aie/FIRasyncRTP, aie_hls/channelizerPacketSwitching) use the Vitis DSP Library. Set the DSPLIB_ROOT environment variable to point to the DSP library root:
# Clone the library if you don't have it:
git clone https://github.com/Xilinx/Vitis_Libraries.git
export DSPLIB_ROOT=<path_to_Vitis_Libraries>/dsp
Launch MATLAB (supports 2025a, 2025b and 2026a).
Each example has a python/test.py and a matlab/test.m script. Run them from their own directory, for example:
cd hls/SumOfFour/python && python3 test.py
cd hls/SumOfFour/matlab && matlab -batch testTo run all examples, use make run_python or make run_matlab from this directory. make clean removes the generated vfs_work directories.
This directory contains simple AI Engine Graphs and HLS kernels to show how to get started with VFS, as well as a more representative system example.
| Example | Description |
|---|---|
varray |
Showcasing basic varray operations |
aie/GraphMultiplyByComplex |
Simple design showcasing the basic structure of a VFS code |
aie/bfloat16 |
Demonstrates partial data being passed to the AIE graph |
aie/FIRasyncRTP |
Instantiation of a symmetric FIR filter with async RTP port from Vitis_Libraries |
aie/firComplex |
Complex-data FIR filter using Vitis DSP Library with scipy validation |
aie/multiplyWithPreproc |
Demonstrates passing preprocessor definitions (Xpreproc) to AIE compilation |
aie/gmio |
Simple weighted-sum design that leverages GMIO |
hls/SumOfFour |
Simple design showcasing the basic structure of a VFS code |
hls/array_pointer_data_type |
Demonstrates a kernel with array and pointer inputs |
hls/arrayOfHlsStreams |
Demonstrates using an HLS kernel where the ports are arrays of streams |
hls/kernel_invert |
Demonstrates usage of the fixed-point varray data type |
hls/complexArguments |
HLS kernel with complex data types (cuint32, cfloat) |
hls/apfixArgument |
HLS kernel demonstrating ap_fixed / ap_ufixed fixed-point data types |
hls/apintArguments |
HLS kernel using ap_int / ap_uint with stream interfaces |
hls/floatArguments |
HLS kernel with float and double stream interfaces |
hls/axisFrameSum |
AXI4-Stream HLS kernel that processes TLAST-delimited frames |
hls/axisSideChannels |
AXI4-Stream side channels (TUSER, TID, TDEST) and a customized AXI4-Stream port with two elements per beat |
aie_hls/64kifft |
64k-point IFFT implemented using a 2D breakdown containing resources in both AI Engine and PL. Also includes a Jupyter notebook version. Link to original design. |
aie_hls/channelizerPacketSwitching |
VFS testbench for the packet-switched filterbank of the AIE-ML Channelizer tutorial: 128-bit HLS packet sender, DSP Library TDM FIR on 64-bit packet-switched PLIOs, and 128-bit HLS packet receiver, with AXI4-Stream width conversion between them. Uses the Channelizer sources unchanged. |
standalone_utility |
Package a standalone VFS installation with design sources for users without a full Vitis installation. See Standalone VFS Installation. |
A varray can carry AXI4-Stream side channels alongside its data. Create one with axis=va.axis_config(...) (Python) or axis=varray.axis_config(...) (MATLAB), then read or set the side channels through arr.axis.tlast, .tkeep, .tuser, .tid, and .tdest. The AxisConfig column of getInputSpec() and getOutputSpec() shows the configuration each port expects.
- HLS kernels: ports declared as
hls::stream<ap_axiu<...>>orhls::stream<hls::axis<...>>, including customizedhls::axisports with only some signals enabled, take and return axis varrays. Plain stream ports take plain varrays. - AI Engine graphs:
pktstreamPLIO ports take and return axis varrays whosetdata_widthequals the PLIO width. Usegraph.getPacketIds()to read the packet IDs assigned by the AI Engine compiler, andvarray.aiePacketUtils(pack_packets,unpack_packets,generate_packet_header,get_packet_id) to build and parse packet streams. - Width conversion: when PL and AI Engine interfaces have different widths (for example, a 128-bit HLS kernel feeding a 64-bit PLIO),
v++inserts an AXI4-Stream data width converter in hardware. In VFS, callva.convert_axis_width(arr, tdata_width)(Python) orvarray.convert_axis_width(arr, tdata_width)(MATLAB) at that boundary. It repacks beats and remaps TKEEP and TLAST the same way as the converter.aie_hls/channelizerPacketSwitchingshows the full flow.
For details, refer to the Vitis Functional Simulation User Guide (UG1864).
Vitis includes create_vfs_standalone.sh, which creates a portable, self-contained installation (less than 4 GB) with only the components VFS needs to simulate HLS kernels, AI Engine graphs, and HDL IPs.
This lets an implementation engineer and an algorithm engineer work on the same design without both needing a full Vitis installation:
- The implementation engineer owns the AI Engine graph and HLS kernel sources and has a full Vitis installation. They create the standalone installation and hand it off together with the design sources and VFS test scripts.
- The algorithm engineer extracts the hand-off, then develops and runs Python or MATLAB scripts that simulate the actual implementation source. Any source update from the implementation engineer can be dropped into the same directory structure and re-simulated.
standalone_utility/package_handoff.sh creates the standalone installation and bundles it with the selected examples into one archive:
source <Vitis_install_path>/settings64.sh
./standalone_utility/package_handoff.sh -o <output_dir>/vfs_handoff.tar.gz hls/SumOfFour aie/GraphMultiplyByComplexWithout example arguments, the script packages varray, hls/SumOfFour, and aie/GraphMultiplyByComplex. To reuse an installation you have already created with $XILINX_VITIS/functional_suite/create_vfs_standalone.sh <dest>, pass -s <dest>.
The archive contains:
vfs_handoff/
├── vfs_standalone/ # Standalone VFS installation (settings64.sh, settings64.csh)
├── create_venv.sh # Python environment with numpy, scipy, matplotlib
├── standalone_utility/
│ └── run_example.sh # Smoke test
└── <example>/ # src/, python/, matlab/ for each packaged example
tar xzf vfs_handoff.tar.gz && cd vfs_handoff
./create_venv.sh && source my-venv/bin/activate
source vfs_standalone/settings64.sh
./standalone_utility/run_example.sh hls/SumOfFour aie/GraphMultiplyByComplexsettings64.sh adds VFS and varray to both PYTHONPATH and MATLABPATH, so launch MATLAB from the same shell. The examples then run exactly as with a full Vitis installation:
cd hls/SumOfFour/python && python3 test.py
cd hls/SumOfFour/matlab && matlab -batch testThe standalone installation is relocatable and is tied to the Vitis version it was created from (see vfs_standalone/README.txt).
GitHub issues are used for tracking requests and bugs. For questions, go to Support.
Copyright © 2026 Advanced Micro Devices, Inc.

