When the trace buffer available in the DDR is full, you have much less control on the event trace you can view and analyze. For more control, you can delay the event trace based on the time, iteration, or user-defined event.
Consider the following scenario. You want to view an event trace of a complex design. It runs for a long time and the trace buffer is not sufficient to hold the complete event trace information. In that case, you can open the initial trace and estimate the approximate time the kernel is in ideal state.
Based on this, you can specify the start time of the event trace.
Use the start_time option as explained in Table 1 and Table 1 with an example.
You can iterate over the value in xrt.ini file,
run the application on hardware, and view the trace information in the Vitis IDE.
Consider another scenario. The graph runs for 100 iterations and, as
explained above, the buffer is only sufficient to hold the trace information of 10
iterations. In that case, to get the event trace information at the 90th iteration,
delay the start of the event trace based on the iteration. Then specify the value of
the iteration using the option start_iteration=90.
To retrieve the trace information based on the iteration value, you need to do the
following:
- Re-compile the graph using the option
--graph-iterator-event. - Re-package the updated
libadf.ausing v++ package, and - Re-generate the
sd_cardimage.
You can use the XRT or XSDB flows to generate the event trace.
You can also delay the event trace based on the user-defined event
specified in the kernel code. For example, the code below uses the event0() intrinsic.
void kernel_w_2048_1(input_window_cint16 * in, output_window_cint16 * out)
{
cint16 c1, c2, cout;
for (unsigned i=0; i<2048; i++)
{
c1 = in.data();
c2 = out.data();
c2.real = c1.real+c1.imag;
c2.imag = c1.real-c1.imag;
if(c2.real == 50)
event0();
}
}
As shown above, the event0() triggers when
the real value of c2 equals 50. To view the trace information corresponding to
this user-defined event, specify the value kernel_event0 to the option start_type. You can do this either in the XSDB or XRT flow, and
generate the event trace.
For more information about the event0()
intrinsic, refer to Events in the
AI
Engine Intrinsics User Guide (UG1078).
Only one event0() can be used per AI Engine tile. You can
specify multiple events on multiple kernels that map to different AI Engine tiles.
event0() intrinsic. So, to use the event0() intrinsic for event-based delay, be sure to
remove the compile option --graph-iterator-event
and re-generate the sd_card image with updated
libadf.a. You can use the Vitis IDE to visualize a
sample delayed event trace, for which the start_time is specified as 1 ms. The following figure shows this.
Notice the highlighted portion at the top-left corner. This signifies that the trace
you are viewing is delayed in this case. Hover your mouse over that heading to see
more information.