
This article is authored by AMD Engineer Garce Sun.
In the Vitis process, the compiled targets are divided into software emulation, hardware emulation, and hardware. Software emulation is the first step to test the system through user-created custom host code, with the main goal of ensuring the functional correctness of the host program and kernel. Here, the kernel code is always compiled and run natively. The application code is compiled differently depending on the platform: • Natively compiled and run on x86 processors (data center platform) • Cross-compiled to Arm processors and run in an emulator (embedded platform) Software emulation is typically used to improve algorithms, debug functional issues, and allow developers to quickly iterate on code for improvements. Software emulation is an abstract model that does not use any petalinux drivers, such as Zynq OpenCL (ZOCL), interrupt controllers, or device tree binaries (DTB). For embedded platforms, creating sd_card.img and booting petalinux on a complete QEMU machine is too heavy overhead. To avoid this overhead and improve the efficiency of software emulation, we can use x86 GCC (instead of ARM-GCC) to compile the same embedded application, achieving software emulation of embedded applications on x86 processors. For this method, users do not need to provide fields such as sysroot, rootfs, and sd_card Image, enabling faster software emulation. Overall, compared to software emulation with QEMU, the following changes are involved in the compilation process:
-
Users need to install XRT on the host and do not need Petalinux/SYSROOT.
For installation guidance on XRT, please refer to the relevant sections in UG1393:
https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Installing-Xilinx-Runtime-and-Platforms
-
Compile host code using the x86 GCC compiler instead of ARM GCC.
In the 2023.1 Vitis version, x86 compilation requires GCC 8.3 or higher.
-
The v++ -package and the process to start emulation are not the same.
The table below describes the differences in building PS applications and .xclbin when running software emulation under QEMU and on x86.

For designs that include AIE, the options based on the above table are adjusted; please refer to the table below:


The above comparison applies to Vitis 2023.1; command line options may change in different versions.
For example, in 2022.1, the v++ package option –package.ps_on_x86 was replaced in the new version with –package.emu_ps x86/qemu.
There are also limitations to running x86 compiled embedded applications, primarily in that the host code does not support ARM-only data types or libraries.
Below is an example of host code using the _fp16 data type, which is only supported in ARM-GCC based compilers; the x86 compiler will throw an error when compiling the same host code. In this case, it is recommended to use the QEMU model of PS and compile the PS application with an ARM-GCC based compiler.

Additionally, currently, launching the PS on x86 emulation mode from the Vitis GUI is not supported; it needs to be completed from the command line. There are examples on GitHub that demonstrate running software emulation using this feature: https://github.com/Xilinx/Vitis_Accel_Examples/tree/2023.1/emulation/aie_adder_hybrid_swemu
AMD Chinese Technical Support Community
Welcome to leave comments and discuss the issues and insights encountered during development in the AMD Chinese Technical Support Community!
This community is dedicated to providing a platform for AMD users and ecosystem partners to share, discuss, and collaboratively solve problems. Register to browse forum content or participate in discussions.
https://support.xilinx.com/s/?language=zh_CN
