Using the Delayed Event Trace - 2023.2 English

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2023-12-04
Version
2023.2 English

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 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 the Vitis IDE.

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.
  • Re-package the updated libadf.a using v++ package, 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.

Note: Both iteration-based delay and event based delay uses the 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.

A sample delayed event trace, for which the start_time is specified as 1 ms, can be visualized in the Vitis IDE, 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.

Figure 1. Delayed Event Trace