- Set the desired runtime settings in the xrt.ini file. This step is optional.
As described in xrt.ini File, the file specifies various parameters to control debugging, profiling, and message logging in XRT when running the host application and kernel execution. This enables the runtime to capture debugging and profile data as the application is running. The
Emulationgroup in the xrt.ini provides features that affect your emulation run.Tip: Be sure to use the
v++ -goption when compiling your kernel code for emulation mode.
- Create an emconfig.json file from the
target platform as described in emconfigutil Utility.
This is required for running hardware or software emulation.
The emulation configuration file,
emconfig.json, is generated from the specified platform using the
emconfigutilcommand, and provides information used by the XRT library during emulation. The following example creates the
emconfig.jsonfile for the specified target platform:
In emulation mode, the runtime looks for the emconfig.json file at a location specified by the
emconfigutil --platform xilinx_u200_xdma_201830_2
$EMCONFIG_PATHvariable, or in the same directory as the host executable.Tip: It is mandatory to have an up-to-date JSON file for running emulation on your target platform.
- Set the
XCL_EMULATION_MODEenvironment variable to
sw_emu(software emulation) or
hw_emu(hardware emulation) as appropriate. This changes the application execution to emulation mode.
Use the following syntax to set the environment variable for C shell (csh):
setenv XCL_EMULATION_MODE sw_emu
export XCL_EMULATION_MODE=sw_emuImportant: The emulation targets will not run if the
XCL_EMULATION_MODEenvironment variable is not properly set.
- Run the application.
With the runtime initialization file (xrt.ini), emulation configuration file (emconfig.json), and the
XCL_EMULATION_MODEenvironment set, run the host executable with the desired command line argument.
./host.exe kernel.xclbinTip: This command line assumes that the host program is written to take the name of the xclbin file as an argument, as most Vitis examples and tutorials do. However, your application might have the name of the xclbin file hard-coded into the host program, or might require a different approach to running the application.
Tip: Set up the command shell or window as described in Setting Up the Vitis Environment prior to running the builds.