PG021
AXI DMA:AXI Direct Memory Access
AXI DMA为内存和AXI4-Stream外设之间提供了高带宽的直接内存访问,其可选的S/G功能可以将CPU从数据搬运任务中解放出来。
AXI DMA通过AXI4-LITE接口对寄存器做一些配置和获取
MM2S:MemoryMap to Stream 存储器映射(AXI4-Full)到AXI4-Stream
S2MM:Stream to MemoryMap 存储器映射 AXI4-Stream到AXI4-Full
MM2S和S2MM传输完成后都会产生中断
时钟
m_axi_mm2s_aclk for mm2s interface
m_axi_s2mm_aclk for s2mm interface
s_axi_lite_aclk for axi4-lite control interface
m_axi_sg_clk for Scatter Gather Interface
AXI DMA编程顺序:
Direct Register Mode(简单DMA)
此模式提供了在MM2S和S2MM通道上进行简单DMA传输的配置,只需要较少的FPGA资源。
通过访问DMACR、源地址或目的地址寄存器和长度寄存器发起DMA传输。
当传输完成后,如果使能了产生中断输出,那么DMASR寄存器相关联的通道位会有效。
DMA的MM2S(存储器映射到Stream)通道的启动顺序
1. Start the MM2S channel running by setting the run/stop bit to 1 (MM2S_DMACR.RS = 1).
2. If desired, enable interrupts by writing a 1 to MM2S_DMACR. IOC_IrqEn and MM2S_DMACR.Err_IrqEn.
3. Write a valid source address to the MM2S_SA register.
4. Write the number of bytes to transfer in the MM2S_LENGTH register.
DMA的S2MM(Stream到存储器映射)通道的启动顺序
1. Start the S2MM channel running by setting the run/stop bit to 1 (S2MM_DMACR.RS = 1).
2. If desired, enable interrupts by writing a 1 to S2MM_DMACR.IOC_IrqEn and S2MM_DMACR.Err_IrqEn.
3. Write a valid destination address to the S2MM_DA register
4. Write the length in bytes of the receive buffer in the S2MM_LENGTH register