Windows操作系统:PCIE Axidma篇 3 官方例程的读写测试

简介: 先介绍一下官方提供的几个demo吧,重点参考Xilinx官方文档65444.有的可以帮助我们开发应用,有的编成应用后可以当做小工具直接帮助我们直接配置寄存器或者读取内存地址的数值。

前言

 先介绍一下官方提供的几个demo吧,重点参考Xilinx官方文档65444.有的可以帮助我们开发应用,有的编成应用后可以当做小工具直接帮助我们直接配置寄存器或者读取内存地址的数值。

 https://www.xilinx.com/support/answers/65444.html

 下面重点介绍一下Xdma_rw例程:

 这个例程用来打开任何设备节点并执行读/写操作。通常操作是读取控制器或用户PCIe bar的内存空间。然而,它也可以用于执行对齐的DMA传输通过h2c_*和c2h_节点,其中表示通道索引(0-3)。默认情况下,主机端数据缓冲区,该应用程序分配的内存与PAGE_SIZE边界对齐(通常为4kB)

Xdma_ rW  
This application can be usedto open any ofthe device nodes and perform read/write operations. Typically this is useful for reading memorv space ofthecontro/oruserPCleBARs.However it can also be used to perform alianed DMA transfers via theh2c*andc2h*nodes. where the asterisk denotes the channel index (0-3). Bv default the host-side data buffer that this application allocates is memory aligned to the PAGE SIZE boundary (typically 4kB).
Usage
xdma rw.exe <DEVNODE> <read write> <ADDR> [OPTIONS] 「DATA
-DEVNODE :One of:control| user | event * | hc2 * | c2h *,
where the * is a numeric wildcard(0-15 for events, 0-3 for hc2 and c2h).
- ADDR :  The target offset address of the read write operation.  
Can be in hex or decimal.
- OPTIONS :
-l (length of data to read/write)
 Copyright 2018 Xilinx
-b open file as binary
-f use data file as input/output (for write/read respectively). -v more verbose output
-a set host-side buffer alignment in bytes (default: PAGE SIZE)
- DATA :  Space separated byte data in decimal or hex 
e.g.: 17 34 51 68
or :  0x11 0x22 0x33 0x44 Hx--1024

示例:

 1.在偏移0x1000的控制寄存器地址下读一个4Byte的值(注意小写L不是数字1):

   xdma_rw.exe control read 0x1000 -l 4

 2.在偏移0x2004的控制寄存器地址下写一个2Byte 的值(0x1234)(注意当指定字节序列中的数据时-l选项不是必需的。

   xdma_rw.exe control write 0x2004 0x34 0x12

 3.C2H_0通道从偏移0地址读取4KB大小数据并存为一个bin文件,文件名为my_data.bin

   xdma_rw.exe c2h_0 read 0 –l 0x1000 -b -f my_data.bin

 4.C2H_0通道从偏移0x100地址读取4KB大小数据,不存文件直接打印

   xdma_rw.exe c2h_0 read 0x100 -l 0x1000

 5.H2C_3通道在偏移0x10的地址下写入4Byte数据,数据内容为0x12345678

   xdma_rw.exe h2c_3 write 0x10 0x78 0x56 0x34 0x12

 6.通过AXI-Lite口在偏移0的地址下读取4Byte的数据

   xdma_rw.exe user read 0 –l 4

 7.在确定的偏移地址0x0000下写确定的数据0x1234567给Bram

   xdma_rw.exe user write 0x0 0x67 0x45 0x23 0x01

 8.在用户内存空间偏移0地址下读取256byte数据

   xdma_rw.exe user read 0 -l 0x100

 9.从指定bin文件(my_data.bin)获得数据,并将其写入用户内存地址偏移0的位置

   xdma_rw.exe user write 0 -b -f my_data.bin


相关文章
|
2月前
|
安全 Linux iOS开发
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
303 0
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
3月前
|
安全 Linux 网络安全
Metasploit Pro 4.22.7-2025061201 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025061201 (Linux, Windows) - 专业渗透测试框架
111 3
Metasploit Pro 4.22.7-2025061201 (Linux, Windows) - 专业渗透测试框架
|
1月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-2025073001 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025073001 (Linux, Windows) - 专业渗透测试框架
84 0
|
4月前
|
安全 Unix Linux
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
115 5
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
|
4月前
|
安全 前端开发 Linux
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
152 3
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
|
4月前
|
安全 测试技术 Linux
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
133 2
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
|
4月前
|
人工智能 安全 网络安全
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
214 4
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
|
4月前
|
数据采集 安全 Linux
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
92 4
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
|
4月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
101 4
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
|
4月前
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
84 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试

热门文章

最新文章

推荐镜像

更多