【ZYNQ-7000开发之四】在PS端使用AXI DMA传输的步骤
来源:互联网 发布:工业4.0软件 编辑:程序博客网 时间:2024/04/30 22:42
本篇文章简要总结下AXI DMA在ZYNQ PS端的初始化方法。本文摘抄自xilinx SDK的API文档,更加详细的内容请参考官方文档,这里只提取了关键部分。
AXI DMA用于AXI4 memory mapped和AXI4-Stream之间的转换
Scatter Gather Mode性能更好,更消耗逻辑资源,使用更复杂一些。
Direct Register Mode则相反。
AXI DMA更加详细的介绍请参考:pg021_axi_dma.pdf
使用AXI DMA传输的步骤:
非Scatter Gather mode
To use the Simple mode DMA engine for transfers, the following setup is required:
- DMA Initialization using XAxiDma_CfgInitialize() function. This step initializes a driver instance for the given DMA engine and resets the engine.
- Enable interrupts if chosen to use interrupt mode. The application is responsible for setting up the interrupt system, which includes providing and connecting interrupt handlers and call back functions, before enabling the interrupts.
- Set the buffer address and length field in respective channels to start the DMA transfer
使用Scatter Gather mode
To use the SG mode DMA engine for transfers, the following setup are required:
- DMA Initialization using XAxiDma_CfgInitialize() function. This step initializes a driver instance for the given DMA engine and resets the engine.
- BD Ring creation. A BD ring is needed per DMA channel and can be built by calling XAxiDma_BdRingCreate().
- Enable interrupts if chose to use interrupt mode. The application is responsible for setting up the interrupt system, which includes providing and connecting interrupt handlers and call back functions, before enabling the interrupts.
- Start a DMA transfer: Call XAxiDma_BdRingStart() to start a transfer for the first time or after a reset, and XAxiDma_BdRingToHw() if the channel is already started. Calling XAxiDma_BdRingToHw() when a DMA channel is not running will not put the BDs to the hardware, and the BDs will be processed later when the DMA channel is started through XAxiDma_BdRingStart().
How to start DMA transactions
The user application uses XAxiDma_BdRingToHw() to submit BDs to the hardware to start DMA transfers.
For both channels, if the DMA engine is currently stopped (using XAxiDma_Pause()), the newly added BDs will be accepted but not processed until the DMA engine is started, using XAxiDma_BdRingStart(), or resumed, using XAxiDma_Resume().
Post-Processing 这个不是很了解
Software Post-Processing on completed DMA transactions
If the interrupt system has been set up and the interrupts are enabled, a DMA channels notifies the software about the completion of a transfer through interrupts. Otherwise, the user application can poll for completions of the BDs, using XAxiDma_BdRingFromHw() or XAxiDma_BdHwCompleted().
- Once BDs are finished by a channel, the application first needs to fetch them from the channel using XAxiDma_BdRingFromHw().
- On the TX side, the application now could free the data buffers attached to those BDs as the data in the buffers has been transmitted.
- On the RX side, the application now could use the received data in the buffers attached to those BDs.
- For both channels, completed BDs need to be put back to the Free group using XAxiDma_BdRingFree(), so they can be used for future transactions.
- On the RX side, it is the application's responsibility to have BDs ready to receive data at any time. Otherwise, the RX channel refuses to accept any data if it has no RX BDs.
- 【ZYNQ-7000开发之四】在PS端使用AXI DMA传输的步骤
- 【ZYNQ-7000开发之七】AXI CDMA特点以及在PS端使用的步骤_理论部分 未完待续
- 【ZYNQ-7000开发之九】使用VDMA在PL和PS之间传输视频流数据
- 从零开始zynq linux AXI DMA传输
- ZYNQ AXI DMA
- 【ZYNQ-7000开发之六】使用PS控制DDR3的读写
- 【ZYNQ-7000开发之十一】VGA RLT代码封装成AXI Stream
- zynq PS侧DMA驱动
- AXI DMA(2)简单的DMA传输寄存器编程顺序(不是SG)
- 【ZYNQ-7000开发之十二】中断:PS接收来自PL的中断
- Zynq PS DMA控制器应用笔记
- ZYNQ使用AXI VDMA搭建图像通路
- "30年---我与赛灵思FPGA的故事”:ZYNQ-7000使用总结(6) ——AXI接口简述
- Xilinx ZYNQ 7000+Vivado2015.2系列(六)创建一个基于AXI总线的GPIO IP并使用
- 一步一步学ZedBoard & Zynq(四):基于AXI Lite 总线的从设备IP设计
- 一步一步学ZedBoard & Zynq(四):基于AXI Lite 总线的从设备IP设计
- WINCE驱动开发之DMA的使用
- WINCE驱动开发之DMA的使用
- STL_4: 通用工具
- 【Javascript】返回/设置时间方法
- 最优编码问题(哈夫曼编码)(贪心)
- GLSL 中 ,如果定义的 变量 没有在代码中使用到,那么不会被编译,用 glget* 是获取不到的
- Servlet文件上传知识点
- 【ZYNQ-7000开发之四】在PS端使用AXI DMA传输的步骤
- oracle更改数据文件位置
- ListView使用技巧-更新中
- 关于开源项目中 Apache 开源协议的一些介绍
- ubuntu virtualbox xp无声音解决
- OpenGL ES 学习教程(九) 油腻的效果 Lighting Maps 高光贴图
- data analysis & deeplink sdk 备忘1
- Spine Script for Adobe(CC)
- 【Javascript】返回指定位置的字符