When the trace buffer available in the DDR is full, you have much less control on the event trace that can be viewed and analyzed. To address this, you can delay the event trace based on the time, iteration or user-defined event.
Consider a scenario of viewing an event trace of a complex design
that runs for long time and the trace buffer is not sufficient enough to hold the
complete event trace information. In that case, you can open the initial trace in
the Vitis Analyzer and estimate the approximate time the kernel is in ideal state.
Based on this, you can specify the start time of the event trace, using 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 Vitis
Analyzer.
Consider another scenario where the graph is running for 100
iterations and as explained above, the buffer is only sufficient enough to hold the
trace information of 10 iterations. In that case, to get the event trace information
at 90th iteration, you can delay the start of the event trace based on the iteration
and specify the value of the iteration using the option start_iteration=90
. Please note that to get the trace information
based on iteration value, you need to:
- Re-compile the graph using the option
--graph-iterator-event
as explained in Table 10. - Link the updated
libadf.a
using v++, and - Re-generate the
sd_card
image.
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()
is
triggered 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
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. Multiple events can be specified on multiple kernels that are mapped
to different AI Engine tiles.
A sample delayed event trace, for which the
start_time
is specified as 1 ms, can be visualized in Vitis Analyzer, as shown below. Notice the highlighted portion at the
top-left corner which signifies the trace being viewed is delayed in this case.
Hover your mouse over that heading to see more information.