数据快照 - 2023.2 简体中文

AI 引擎工具和流程用户指南 (UG1076)

Document ID
UG1076
Release Date
2023-12-04
Version
2023.2 简体中文

x86simulator --dump 数据快照功能特性支持您无需使用调试器即可对内核端口处的数据流量进行转储和检验。此功能特性无需对内核代码执行任何检测。它还有助于诊断含 x86simulator 的相同设计的两个版本之间的仿真结果不匹配问题。对于内核端口(包括串流、窗口、包串流、级联串流和 RTP 端口),支持生成数据快照。所有平台级别的端口(如,PLIO、GMIO、RTP 端口以及对特定 RTP 端口进行的 PS 访问)也同样支持该功能特性。

对于输入窗口端口,每次内核获取窗口并且快照包含裕度时,都会生成数据快照。对于输出窗口端口,每次内核发布窗口并且其中不含裕度时,都会生成快照。在上述任一情况下,快照均包含内核迭代计数和样本数据。每个内核端口各生成一个文本文件。此外,还会记录内核的迭代计数。

例如,以下提供的 graph 数据快照包含由 2 个内核构成的内核链,内核所含窗口端口中,第一个窗口含非零裕度。

$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

对于串流端口,每个含 4 字节数据的数据区块各生成一个数据快照。每个快照均包含 TLAST 的值以及内核迭代计数。对于级联端口,粒度为 8 字节。

例如,以下提供的 graph 数据快照包含 3 个内核,这些内核通过串流端口相连接。

$ 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
...