As described in Window and Streaming Data API the data flows into and out of an AI Engine kernel through access windows, or a stream interface. During debug you might want to see the value of these data access windows as data is passing through the kernels. In the following figure you can trace the series of objects that you must work through to examine the contents of the variables.
Figure 1. Data Access Chain
- In the code example shown at Step 1 in the figure, you can see that the variable
cb_input
is a pointer of typeinput_window_cint16
. This shows the declaration of an input window carrying complex integers where the real part is 16-bits wide, and the imaginary part is 16 bits. - Move to the
cb_input
variable in the Variables view. This is the pointer representation of the data access window that holds the input data for the kernel. However, the kernel functions merely operate on pointers to the window data structures passed to them as arguments. The input window data structure is defined by a pointer calledptr
. Thisptr
is defined by the input data window API as described in Window Operations for Kernels. - Examine the contents of the variable
ptr
. It is an address with value 0x00038000. - In the Memory window, click on the
+
sign to input the address 0x38000 as shown in Step 4. - The Memory window displays the content at address of 0x38000.
- This is the data contained in the data access window defined by the
cb_input
variable. The previous example has a 64-byte margin size, so the actual data starts from 0x38000 plus 0x40 = 0x38040. You can examine the data contents, display it in a specific data format, or copy it to the clipboard and export it to a separate file as described in Using the Debug Environment.Notice the HEX values, such as F4D9ED71, presented in the Memory window as shown in the previous figure represent a
cint16
type complex number with a 16-bit signed integer real number and a 16-bit signed imaginary number with the following values read from an input file:-4751 -2855 -1107 -5121 1062 -2732 4465 4323 9899 5093 5289 -2426 -1063 -5425 ...
Tip: If the connection to a data access window has a margin specified, the
margin data is included in the memory window. The total memory allocated equals the
window size plus the margin size.