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

Vitis Tutorials: Hardware Acceleration (XD099)

Document ID
XD099
Release Date
2023-11-13
Version
2023.2 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_2 krnl_vadd.hw_emu.xclbin
    
  4. View the Application Timeline report in the Vitis analyzer.

    vitis -a 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.
    Timeline 2

  6. After reviewing, close the Analysis view and the Vitis unified IDE.

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 LAB=run2

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

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

# Open Vitis analyzer and view the timeline waveform
vitis -a xrt.run_summary