# xdmalib **Repository Path**: shanxizeng/xdmalib ## Basic Information - **Project Name**: xdmalib - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-09 - **Last Updated**: 2025-07-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # XDMALIB ------------------------------------ install drivers: ```bash git sudmodule init git submodule update sudo ./install_driver.sh ``` ------------------------------------ compile & install: ```cpp make all make install ``` ------------------------------------ test: ```cpp make test ``` 在 build/tests/ 下生成 performance 和 correctness 两个测试程序: `performance [n] [r] [method]`:以n, r为参数在 method 模式中运行吞吐量测试。其中n一般指每次传输数据长度,r一般指传输数据的轮次数。 method: > 0:使用user通道,进行r轮传输,每一轮交替进行n次的32位写入和n次的32位读取,每一轮内访问地址连续。 1:使用C2H和H2C通道,进行r轮传输,每一轮进行一次n\*32位的写入和一次n\*32位的读取。 `correctness [n] [r] [method]`:以n, r为参数在 method 模式中运行吞吐量测试。其中n一般指每次传输数据长度,r一般指传输数据的轮次数。 method: > user:使用user通道的测试 其他:使用C2H通道和H2C通道的测试 ------------------------------------- h2c_transfer 和 c2h_transfer 提供了没有进行检查的快速访问 > parameters: data: host 中传输的地址 len: 传输数据长度(以字节为单位) pos: card 中传输的地址 channel: 使用哪个channel进行传输,不应超过 XDMA 中的设置。 h2c_transfer_safe 和 c2h_transfer_safe 在原版的基础上增加了检查,如果写入或读取成功,则返回写入或读取的字节数,否则返回-1,并报错。 initxdma(len):初始化文件描述符和内存映射空间。其中len为内存映射的长度,单位为字节。 read_user_int(pos):读取user通道,pos位置的32位数据。 write_user_int(pos, data):写入user通道,pos位置的32位数据data --------------------------------------- 示例vivado项目: [xdma_test(vivado 18.3)](https://gitee.com/shanxizeng/xdma_test)