最近开始玩atlas200了,先上一张美图。
今天先看看pcie的速度吧。
基本信息:
1、atlas200作为rc,FPGA 690T作为ep端;
2、atlas200和690T都支持PCIE3.0 4X,但是目前我们只用到2X;
3、EP的驱动使用XDMA,简单方便。
速度测试:
1、h2c(RC到EP)
./dma_to_device -v 1 -d /dev/xdma0_h2c_0 -f ./datafile_32M.bin -s 0x100000 -c 10
打印如下:
dev /dev/xdma0_h2c_0, addr 0x0, aperture 0x0, size 0x100000, offset 0x0, count 10
host buffer 0x101000 = 0xe7ffcc880000
host buffer 0x101000 = 0xe7ffcc880000
#0: CLOCK_MONOTONIC 0.000920677 sec. write 1048576 bytes
#1: CLOCK_MONOTONIC 0.000834687 sec. write 1048576 bytes
#2: CLOCK_MONOTONIC 0.000833386 sec. write 1048576 bytes
#3: CLOCK_MONOTONIC 0.000830729 sec. write 1048576 bytes
#4: CLOCK_MONOTONIC 0.000834063 sec. write 1048576 bytes
#5: CLOCK_MONOTONIC 0.000830521 sec. write 1048576 bytes
#6: CLOCK_MONOTONIC 0.000828489 sec. write 1048576 bytes
#7: CLOCK_MONOTONIC 0.000848438 sec. write 1048576 bytes
#8: CLOCK_MONOTONIC 0.000823958 sec. write 1048576 bytes
#9: CLOCK_MONOTONIC 0.000829688 sec. write 1048576 bytes
** Avg time device /dev/xdma0_h2c_0, total time 8414636 nsec, avg_time = 841463.625000, size = 1048576, BW = 1246.133545
/dev/xdma0_h2c_0 ** Average BW = 1048576, 1246.133545
2、c2h(EP到RC)
./dma_from_device -v 1 -d /dev/xdma0_c2h_0 -f output_datafile_4K.bin -s 0x100000 -c 10
打印如下:
dma0_c2h_0 -f output_datafile_4K.bin -s 0x100000 -c 10from_device -v 1 -d /dev/xd
dev /dev/xdma0_c2h_0, addr 0x0, aperture 0x0, size 0x100000, offset 0x0, count 10
host buffer 0x101000, 0xe7ffd6b65000.
#0: CLOCK_MONOTONIC 0.001695312 sec. read 1048576/1048576 bytes
#1: CLOCK_MONOTONIC 0.000915104 sec. read 1048576/1048576 bytes
#2: CLOCK_MONOTONIC 0.000908333 sec. read 1048576/1048576 bytes
#3: CLOCK_MONOTONIC 0.000935625 sec. read 1048576/1048576 bytes
#4: CLOCK_MONOTONIC 0.000925052 sec. read 1048576/1048576 bytes
#5: CLOCK_MONOTONIC 0.000914531 sec. read 1048576/1048576 bytes
#6: CLOCK_MONOTONIC 0.000902656 sec. read 1048576/1048576 bytes
#7: CLOCK_MONOTONIC 0.000913854 sec. read 1048576/1048576 bytes
#8: CLOCK_MONOTONIC 0.000918334 sec. read 1048576/1048576 bytes
#9: CLOCK_MONOTONIC 0.000920104 sec. read 1048576/1048576 bytes
** Avg time device /dev/xdma0_c2h_0, total time 9948905 nsec, avg_time = 994890.500000, size = 1048576, BW = 1053.961182
/dev/xdma0_c2h_0 ** Average BW = 1048576, 1053.961182
总结:
fpga到cpu的速度是1000MB,pcie2.0 4x的理论速度为2000MB;
cpu到fpga的速度是1250MB,pcie2.0 4x的理论速度为2000MB。
速度有待提升,具体可参考:HI3559AV100和FPGA 7K690T的PCIE接口调试记录-续_hi3559 + fpga-CSDN博客