Intel® Acceleration Stack用户指南: Intel FPGA Programmable Acceleration Card N3000

ID 683040
日期 8/17/2020
Public
文档目录

6. 样例测试:本地环回(Native Loopback)

本章节介绍了如何使用Intel提供的FPGA出厂映像和hello_fpga.c主机程序进行存储器复制测试。FPGA出厂映像包括支持此测试的逻辑和一个带有预期AFU UUID的内部寄存器。hello_fpga.c仅适用于带有此AFU UUID的FPGA映像。FPGA中的加速逻辑(NLB)经过编程可将CSR_NUM_LINES (高速缓存行)从主机系统上的源缓存复制到目的缓存中。关于详细信息,请参考Native Loopback Accelerator Functional Unit (AFU) User Guide for Intel FPGA Programmable Acceleration Card N3000

确保分配大页面:
  • For CentOS:
    $ sudo sh -c "echo 200 > /sys/kernel/mm/hugepages/hugepages-2048kB/\
    nr_hugepages"
    
  • For Red Hat:
    # echo 200 > /proc/sys/vm/nr_hugepages
注: 必须以root运行命令。
解压缩软件包:N3000_supplemental_files.zip,作为Acceleration Stack installer的一部分提供。
$	unzip N3000_supplemental_files.zip
$	cd N3000_supplemental_files
$	gcc -o hello_fpga -std=gnu99 -rdynamic -ljson-c -luuid -lpthread \
-lopae-c -lm -Wl,-rpath -lopae-c hello_fpga.c
$	sudo ./hello_fpga
样例输出:
Using OPAE C library version '1.3.6' build '99fa5de'
Running Test
Running on bus 0x15.
dfh = 100000008000001f
id[0] = c000c9660d824272
id[1] = 9aeffe5f84570612
dfh = 2000000080000000
id[0] = a9149a35bace01ea
id[1] = ef82def7f6ec40fc
dfh = 2000000080000000
id[0] = a9149a35bace01ea
id[1] = ef82def7f6ec40fc
dfh = 2000000080000000
id[0] = a9149a35bace01ea
id[1] = ef82def7f6ec40fc
dfh = 2000000080000000
id[0] = a9149a35bace01ea
id[1] = ef82def7f6ec40fc
dfh = 1000010080001070
id[0] = f89e433683f9040b
id[1] = d8424dc4a4a3c413
Found NLB0 at offset 0x28000
Done Running Test
注: 在多卡系统中,通过PCIe bus argument -B 0x<xx>