5.Run Hardware Emulation - 5.Run Hardware Emulation - 2026.1 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2026-06-23
Version
2026.1 English

After packaging, everything is set to run emulation. Because you ran aiesimulator with profiling enabled, you can bring that to hardware emulation. You can pass the aiesim_options.txt to the launch_hw_emu.sh which enables the profiling options used in aiesimulator to be applied to hardware emulation. To do this, add the -aie-sim-options ../aiesimulator_output/aiesim_options.txt.

Because Profiling is deprecated in Hardware Emulation Flow, comment the line ‘AIE_PROFILE=All’ in aiesimulator_output/aiesim_options.txt

  1. To run emulation use the following command:

    make run_emu TARGET=hw_emu
    

    or

    cd ./sw
    ./launch_hw_emu.sh -aie-sim-options ../aiesimulator_output/aiesim_options.txt -add-env AIE_COMPILER_WORKDIR=../Work
    

    When launched, use the Linux prompt presented to run the design. Note that the emulation process is slow, so do not touch the keyboard of your terminal or you might stop the emulation of the Versal booth (as it happens in the real HW board).

  2. Execute the following command when the emulated Linux prompt appears:

    cd /run/media/*1
    export XILINX_XRT=/usr
    dmesg -n 4 && echo "Hide DRM messages..."
    

    This command sets up the design to run emulation and removes any unnecessary DRM messaging.

  3. Run the design using the following command:

    ./host.exe a.xclbin
    

    Note: The design runs with VCD dumping, which extends emulation time. It may seem hung, but it is not.

  4. You should see an output displaying TEST PASSED. When this is shown, run the keyboard command: Ctrl+A x to end the QEMU instance.

  5. To view the profiling results and trace in Vitis Analyzer, run the command:

    vitis_analyzer -a sw/sim/behav_waveform/xsim/default.aierun_summary
    

    hw_emu analyzer

    When you open the run Summary, notice that it uses the same layout as aiesimulator.

  6. Click Trace. This opens the VCD data (as defined in the aiesim_options.txt). This provides detailed information about kernels, tiles, and nets within the AI Engine during execution. Here you can see stalls for each kernel and identify where they originate.

    hw_emu trace

    From the trace information, you can calculate the kernel latency as follows:

    1. Click the Trace in the AI Engine simulation run summary, and navigate to the any function to calculate the latency. For example, consider the classifier function.

    2. Notice the function classifier ran for seven iterations. Zoom into the period of one iteration (between two main() function calls), add a marker, and drag it to the end of the kernel function as follows: hw_emu_trace

      Notice the difference of 25.093 us as highlighted above. This is the time the kernel took to complete one iteration.

    If you click the AI Engine Simulation Summary, notice the AI Engine Frequency is 1250 MHz (0.8 ns per cycle). The classifier function took 25.093 us for one iteration, which equals approximately 31298 cycles (25.093 us / 0.8 ns). Compare this with the latency from aiesimulation where the AI Engine runs as a standalone module.

  7. Explore the two reports and take note of any differences and similarities. This helps you debug and optimize your design.

  8. Close the Vitis Analyzer and build for hardware.