Data Snapshots - 2022.1 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
Release Date
2022-05-25
Version
2022.1 English

The x86simulator --dump data snapshot feature allows users to dump and inspect data traffic at kernel ports without using the debugger. This feature does not require any instrumentation of kernel code. It also helps diagnose simulation result mismatches between two versions of the same design with x86simulator. Data snapshots are supported for kernel ports including streams, windows, packet streams, cascade streams, and RTP ports. This feature is also supported for all platform level ports like PLIO, GMIO, RTP ports, as well as for PS accesses into a specific RTP port.

For input window ports, a data snapshot is taken each time the kernel acquires the window and the snapshot includes the margin. For output window ports, a snapshot is taken each time the kernel releases the window and it excludes the margin. In either case the snapshot consists of the kernel iteration count and sample data. One text file per kernel port is generated. In addition, the iteration count of the kernel is also recorded.

For example, a data snapshot for a graph with a chain of two kernels with window ports where the first window has a non-zero margin is as follows.

$x86simulator --pkg-dir=./Work --i=.. --dump
INFO: Reading options file './Work/options/x86sim.options'.
Processing './x86simulator_output/dump/x86sim_dump.data'
File Port direction Port type Data type Kernel or platform port
------------------------ -------------- --------- ---------
-----------------------
platform_src_0.txt out window cint16 platform.src[0]
mygraph_first_in_0.txt in window cint16 mygraph.first.in[0]
mygraph_second_out_0.txt out window cint16 mygraph.second.out[0]
platform_sink_0.txt in window cint16 platform.sink[0]
mygraph_first_out_0.txt out window cint16 mygraph.first.out[0]
mygraph_second_in_0.txt in window cint16 mygraph.second.in[0]
Wrote './x86simulator_output/dump/platform_src_0.txt'
Wrote './x86simulator_output/dump/mygraph_first_in_0.txt'
Wrote './x86simulator_output/dump/mygraph_second_out_0.txt'
Wrote './x86simulator_output/dump/platform_sink_0.txt'
Wrote './x86simulator_output/dump/mygraph_first_out_0.txt'
Wrote './x86simulator_output/dump/mygraph_second_in_0.txt'
Simulation completed successfully returning zero
$> more ./x86simulator_output/dump/mygraph_first_in_0.txt
# port: mygraph.first.in[0]
# port_dir: in
# port_type: window
# data_type: cint16
# Iteration 1; snapshot 1
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 1
2 3
4 5
6 7
8 9
10 11
12 13
14 15
16 17
18 19
20 21
22 23
24 25
26 27
28 29
30 31
32 33
34 35
36 37
38 39
40 41
42 43
44 45
46 47
48 49
50 51
52 53
54 55
56 57
58 59
60 61
62 63
# Iteration 2; snapshot 2
48 49
50 51
52 53
54 55
56 57
58 59
60 61
62 63
1 0
3 2
5 4
7 6
9 8
11 10
13 12
15 14
17 16
19 18
21 20
23 22
25 24
27 26
29 28
31 30
33 32
35 34
37 36
39 38
41 40
43 42
45 44
47 46
49 48
51 50
53 52
55 54
57 56
59 58
61 60
63 62

For stream ports, a data snapshot is taken for each chunk of four bytes of data. Each snapshot includes the value of TLAST and the kernel iteration count. For cascade stream ports, the granularity is eight bytes.

For example, a data snapshot for a graph with three kernels connected via stream ports is as follows.

$ x86simulator --pkg-dir=./Work --i=.. --dump
INFO: Reading options file './Work/options/x86sim.options'.
Processing './x86simulator_output/dump/x86sim_dump.data'


File Port direction Port type Data type Kernel or platform port
-------------------------- -------------- --------- --------- -----------------------
platform_src_0.txt out stream int32 platform.src[0] 
fifo_graph_dist_in_0.txt in stream int32 fifo_graph.dist.in[0] 
fifo_graph_aggr_out_0.txt out stream int32 fifo_graph.aggr.out[0] 
platform_sink_0.txt in stream int32 platform.sink[0] 
fifo_graph_comp0_in_0.txt in stream int32 fifo_graph.comp0.in[0] 
fifo_graph_comp1_in_0.txt in stream int32 fifo_graph.comp1.in[0] 
fifo_graph_dist_out_0.txt out stream int32 fifo_graph.dist.out[0] 
fifo_graph_comp0_out_0.txt out stream int32 fifo_graph.comp0.out[0]
fifo_graph_aggr_in_0.txt in stream int32 fifo_graph.aggr.in[0] 
fifo_graph_comp1_out_0.txt out stream int32 fifo_graph.comp1.out[0]
fifo_graph_aggr_in_1.txt in stream int32 fifo_graph.aggr.in[1] 


Wrote './x86simulator_output/dump/platform_src_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_dist_in_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_aggr_out_0.txt'
Wrote './x86simulator_output/dump/platform_sink_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_comp0_in_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_comp1_in_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_dist_out_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_comp0_out_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_aggr_in_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_comp1_out_0.txt'
Wrote './x86simulator_output/dump/fifo_graph_aggr_in_1.txt'
Simulation completed successfully returning zero


$ more ./x86simulator_output/dump/fifo_graph_dist_in_0.txt
# port: fifo_graph.dist.in[0]
# port_dir: in
# port_type: stream
# data_type: int32
# Iteration 1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...

The Vitis Analyzer can be used to visualize these snapshots:

Figure 1. Vitis Analyzer Window
  1. Click Graph in the left menu to display the Graph view.
  2. Select the Ports tab below the graph, and finally select the snapshot file that you want to display.
  3. The snapshot details are displayed to the right.