Due to the approximate models used in hardware emulation, the behavior of an emulated system might not match the hardware. The following list provides some common issues to examine if your application does not give expected results during hardware emulation:
- Review the host application to ensure that the event dependency between different kernel runs is correctly captured. Such issues can lead to unpredictable behavior. It is also possible that the application can pass in hardware, but there could be a logical bug in your application which can be triggered on hardware under slightly different conditions.
- If you have an RTL kernel, run the application in debug mode and ensure that are no "X" (undriven values) in simulation in the kernel. This indicates incorrect code which can work in hardware but will fail in simulation with unpredictable behavior. If it is an HLS-generated kernel, confirm that all the variables are initialized to appropriate values.
- Ensure that the amount of data being processed by kernels in hardware
emulation is small so that emulation can finish in a reasonable time. Otherwise,
it can appear that the application is running forever or has "hung". In this
case, when running the application in hardware emulation look for
INFO: [Vitis-EM 22]messages in the host application console. Check that the amount of data being read/written to or from global memory is increasing:
- If the RD/WR data is increasing, this indicates that application and hardware execution is progressing. The application is not hung, but is taking a really long time to complete. This could be due to large data size or due to kernels performing memory read/write in an inefficient manner. The application and kernel needs to be optimized.
- If the RD/WR data is not increasing in successive
messages, this indicates that simulation is running but there is a
deadlock in the hardware somewhere — either in the kernel or rest of the
platform. Review the AXI transactions at the boundary of kernel,
interconnect (for example,
sdx_memss), and other places to check if there is an incomplete transaction or whether any transaction is being generated by the kernel.
- Run hardware emulation in waveform mode and also review at the timeline trace. Check whether the kernel is getting "started" and "done" by observing the traffic on its AXI4-Lite interface, or by observing the output interrupt from the kernel.
- Review the
[Emulation]section of the xrt.ini File to enable applicable settings that can help to narrow down the issue in your application or kernel.