在博客文章 使用 AXI performance monitors (APM)测试MPSoC DDR访问带宽 中介绍了DDR带宽测试工具"apm_main.elf"。使用过程中,发现还有些不足。它只能测试端口1/2/4/5,只能打印带宽。很多场合需要更多信息。于是更新了这个工具,可以测试所有端口,可以测试最小、最大、平均延时,也可以测试带宽,最后还会汇报总的带宽。注意,每个端口的测试是依次进行的,不是同时进行的。
旧工具"apm_main.elf"的输出:
root@zcu106_vcu_trd:/run# ./apm_main.elf -d /dev/uio2
AXI PMON is in Advanced Mode
port 1 read: 152688 0.15 MBps
port 1 write: 41344 0.04 MBps
port 2 read: 121568 0.12 MBps
port 2 write: 26884 0.03 MBps
port 4 read: 0 0.00 MBps
port 4 write: 0 0.00 MBps
port 5 read: 0 0.00 MBps
port 5 write: 0 0.00 MBps
新工具"apm_main.elf"的输出:
root@zcu106_vcu_llp2_audio_nv12:/run# ./apm_latency_all.elf -d /dev/uio2
AXI PMON is in Advanced Mode
S0, Port0, LPD Main Switch
port 0 Write Transaction Count: 0000000000 0.00 MTps
port 0 Read Transaction Count: 0000000000 0.00 MTps
port 0 Write Byte Count: 0000000000 0.00 MBps
port 0 Read Byte Count: 0000000000 0.00 MBps
port 0 Maximum Write Latency: 0000000000 cycles
port 0 Maximum Read Latency: 0000000000 cycles
port 0 Minimum Write Latency: 4294967295 cycles
port 0 Minimum Read Latency: 4294967295 cycles
S1, Port0, FPD CCI Main Switch; GPU, ACP, HPC0, HPC1
port 1 Write Transaction Count: 0007828067 7.83 MTps
port 1 Read Transaction Count: 0008704014 8.70 MTps
port 1 Write Byte Count: 0477243318 477.24 MBps
port 1 Average Write Transaction Size: 60.97 Bytes
port 1 Read Byte Count: 0539179840 539.18 MBps
port 1 Average Read Transaction Size: 61.95 Bytes
port 1 Total Write Latency: 0045395180, average: 5.80 cycles
port 1 Total Read Latency: 0882098985, average: 101.34 cycles
port 1 Maximum Write Latency: 0000001671 cycles
port 1 Maximum Read Latency: 0000001444 cycles
port 1 Minimum Write Latency: 0000000001 cycles
port 1 Minimum Read Latency: 0000000035 cycles
S2, Port2, FPD CCI Main Switch; GPU, ACP, HPC0, HPC1
port 2 Write Transaction Count: 0010030804 10.03 MTps
port 2 Read Transaction Count: 0008823563 8.82 MTps
port 2 Write Byte Count: 0619787783 619.79 MBps
port 2 Average Write Transaction Size: 61.79 Bytes
port 2 Read Byte Count: 0548313408 548.31 MBps
port 2 Average Read Transaction Size: 62.14 Bytes
port 2 Total Write Latency: 0095816478, average: 9.55 cycles
port 2 Total Read Latency: 0930169130, average: 105.42 cycles
port 2 Maximum Write Latency: 0000001355 cycles
port 2 Maximum Read Latency: 0000002109 cycles
port 2 Minimum Write Latency: 0000000001 cycles
port 2 Minimum Read Latency: 0000000035 cycles
S3, Port3, HP0, DP
port 3 Write Transaction Count: 0000000000 0.00 MTps
port 3 Read Transaction Count: 0003883411 3.88 MTps
port 3 Write Byte Count: 0000000000 0.00 MBps
port 3 Read Byte Count: 0994147488 994.15 MBps
port 3 Average Read Transaction Size: 256.00 Bytes
port 3 Total Read Latency: 0380278193, average: 97.92 cycles
port 3 Maximum Write Latency: 0000000000 cycles
port 3 Maximum Read Latency: 0000000480 cycles
port 3 Minimum Write Latency: 4294967295 cycles
port 3 Minimum Read Latency: 0000000050 cycles
S4, Port4, HP1
port 4 Write Transaction Count: 0000000000 0.00 MTps
port 4 Read Transaction Count: 0000000000 0.00 MTps
port 4 Write Byte Count: 0000000000 0.00 MBps
port 4 Read Byte Count: 0000000000 0.00 MBps
port 4 Maximum Write Latency: 0000000000 cycles
port 4 Maximum Read Latency: 0000000000 cycles
port 4 Minimum Write Latency: 4294967295 cycles
port 4 Minimum Read Latency: 4294967295 cycles
S5, Port5, HP3
port 5 Write Transaction Count: 0017064390 17.06 MTps
port 5 Read Transaction Count: 0037150803 37.15 MTps
port 5 Write Byte Count: 1131512512 1131.51 MBps
port 5 Average Write Transaction Size: 66.31 Bytes
port 5 Read Byte Count: 1328995568 1329.00 MBps
port 5 Average Read Transaction Size: 35.77 Bytes
port 5 Total Write Latency: 0101187053, average: 5.93 cycles
port 5 Total Read Latency: 0396740885, average: 10.68 cycles
port 5 Maximum Write Latency: 0000000980 cycles
port 5 Maximum Read Latency: 0000001099 cycles
port 5 Minimum Write Latency: 0000000001 cycles
port 5 Minimum Read Latency: 0000000035 cycles
All ports Write Byte Count: 2228543613 2228.54 MBps
All ports Read Byte Count: 3410636304 3410.64 MBps
如果有需要,可以联系FAE获取工具。