Build and Emulation with C++ and RTL Based Kernels - 2023.1 English

Vitis Tutorials: Hardware Acceleration (XD099)

Document ID
Release Date
2023.1 English

With the RTL-based kernel added and host code updated, build the application, targeting hardware emulation through the updated makefile in the run2 directory. The makefile has been updated to add both the CPP and RTL-based kernels to the hardware platform file (xclbin).

  1. Navigate to the ./02-mixing-c-rtl-kernels/reference-files directory.

  2. To build the application targeting hardware emulation, run the following makefile from the ./reference-files directory.

    make all TARGET=hw_emu LAB=run2

    As before, run emulation and generate and review the Application Timeline by running the following commands from within the ./reference-files directory.

  3. Set XCL_EMULATION_MODE environment variable for hardware emulation, and run the application.

    export XCL_EMULATION_MODE=hw_emu
    ./host krnl_vadd.hw_emu.xilinx_u250_gen3x16_xdma_4_1_202210_1.xclbin
  4. View the Application Timeline report in the Vitis analyzer.

    vitis_analyzer xrt.run_summary
  5. Under Device>Binary Container, traverse along the timeline and zoom in.
    You will now see both CUs, krnl_vadd_1 and rtl_kernel_wizard_0_1, show as running.
    Application Timeline 2

  6. After reviewing, close the Application Timeline and exit Vitis analyzer.

Vitis core development kit applications can use any combination of kernels, regardless of the language in which they were developed.

Because a CPP emulation file was packaged with the RTL Kernel (through the RTL Wizard), you can also run software emulation. To run software emulation, use the following steps:

# Build the application
make all TARGET=sw_emu

# Set XCL_EMULATION_MODE environment variable for software emulation
export XCL_EMULATION_MODE=sw_emu

# Run software emulation
./host krnl_vadd.sw_emu.xilinx_u250_gen3x16_xdma_4_1_202210_1.xclbin

# Open Vitis analyzer and view the timeline waveform
vitis_analyzer xrt.run_summary