资源简介
ZedBoard的AXI DMA收发独立双线程linux应用程序!有别于之前官方或者其它提供的单次发单次收。该代码包含速度测试,实测传输速率可以达到274MB/s。
代码片段和文件信息
/**
* Proof of concept offloaded memcopy using AXI Direct Memory Access v7.1
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include “dma.h“
int fd;
int cnt;
pthread_mutex_t dma_tx_mutex dma_rx_mutex;
pthread_t dma_tx_id dma_rx_id;
static void dma_tx_thread(void);
static void dma_rx_thread(void);
static void dma_set(unsigned int *dma_virtual_address int offset unsigned int value)
{
dma_virtual_address[offset >> 2] = value;
}
static unsigned int dma_get(unsigned int *dma_virtual_address int offset)
{
return dma_virtual_address[offset >> 2];
}
static void dma_s2mm_status(unsigned int *dma_virtual_address)
{
unsigned int status = dma_get(dma_virtual_address S2MM_STATUS_REGISTER);
printf(“Stream to memory-mapped status (0x%08x@0x%02x):“ status S2MM_STATUS_REGISTER);
if (status & 0x00000001)
printf(“ halted“);
else
printf(“ running“);
if (status & 0x00000002)
printf(“ idle“);
if (status & 0x00000008)
printf(“ SGIncld“);
if (status & 0x00000010)
printf(“ DMAIntErr“);
if (status & 0x00000020)
printf(“ DMASlvErr“);
if (status & 0x00000040)
printf(“ DMADecErr“);
if (status & 0x00000100)
printf(“ SGIntErr“);
if (status & 0x00000200)
printf(“ SGSlvErr“);
if (status & 0x00000400)
printf(“ SGDecErr“);
if (status & 0x00001000)
printf(“ IOC_Irq“);
if (status & 0x00002000)
printf(“ Dly_Irq“);
if (status & 0x00004000)
printf(“ Err_Irq“);
printf(“\n“);
}
static void dma_mm2s_status(unsigned int *dma_virtual_address)
{
unsigned int status = dma_get(dma_virtual_address MM2S_STATUS_REGISTER);
printf(“Memory-mapped to stream status (0x%08x@0x%02x):“ status MM2S_STATUS_REGISTER);
if (status & 0x00000001)
printf(“ halted“);
else
printf(“ running“);
if (status & 0x00000002)
printf(“ idle“);
if (status & 0x00000008)
printf(“ SGIncld“);
if (status & 0x00000010)
printf(“ DMAIntErr“);
if (status & 0x00000020)
printf(“ DMASlvErr“);
if (status & 0x00000040)
printf(“ DMADecErr“);
if (status & 0x00000100)
printf(“ SGIntErr“);
if (status & 0x00000200)
printf(“ SGSlvErr“);
if (status & 0x00000400)
printf(“ SGDecErr“);
if (status & 0x00001000)
printf(“ IOC_Irq“);
if (status & 0x00002000)
printf(“ Dly_Irq“);
if (status & 0x00004000)
printf(“ Err_Irq“);
printf(“\n“);
}
static void dma_mm2s_sync(unsigned int *dma_virtual_address)
{
unsigned int mm2s_status = dma_get(dma_virtual_address MM2S_STATUS_REGISTER);
while(!(mm2s_status & 1 << 12) || !(mm2s_status & 1 << 1) ) {
mm2s_status = dma_
相关资源
- axizilla是否可能发生双光子共振?
- stm32的DAC播放音乐文件
- Einstein-Maxwell-Dilaton-Axion模型中的剪切
- STM32F103 USART+DMA
- DMA+stm32 407.zip
- 4_USART串口通信(空闲中断+DMA.zip
- stm32f105-usart-DMA收发demo
- STM32F042F6P6 Uart12DMA;发送中断接收
- TD-SCDMA网络测试仪中E1数据采集卡的驱
- TD-SCDMA测试仪中Iub接口CDR的合成方案
- Global existence and behavior in thehigher-dim
- 安捷伦CDMA2000测试解决方案
- Pix4Dmapper4.4.10中文破解版带注册机网盘
- Pix4Dmapper4.4.10中文破解
- Pix4Dmapper教程
- stm32利用spi驱动tm1803
- qualcomm cdma technologies msm 驱动
- 基于溶胶凝胶法的TiO2溶胶的制备
- 矿井巷道时频编码协作MC-CDMA信道估计
- shape_predictor_68_face_landmarks.dat.bz2 68个标
- 论文研究-基于AMBA AXI总线的Crossbar互联
- 3DMax的模型
- springmvc+Mybatis+axis2+webservice+quartz作业整
- CDMA通信系统中的接入信道部分进行仿
- ZEDBoard实现OV7725显示Verilog
- WCDMA系列化基站规模服务马来西亚
- 华为承建阿联酋电信3G/WCDMA网络投入商
- 通用黑洞时空中受限制的Maximin曲面和
- panda插件201264位 3DMAX转换.x文件工具把
- Mindmanager模板素材446个淘宝买的史上最
评论
共有 条评论