嗨,
感谢您的答复。
以下是我试过的基于中断的CDMA数据传输。
在这里,我使用以下API:
int XAxiCdma_SimpleTransfer(XAxiCdma * InstancePtr,u32 SrcAddr,u32 DstAddr,int Length,XAxiCdma_CallBackFn SimpleCallBack,void * CallbackRef);
但,
1)以下代码不起作用!
知道为什么会这样吗?
2)比较“轮询模式下的DMA”和“DMA中断模式”时最快的是什么?
3)我可以在XAxiCdma_SimpleTransfer(...)中传输的最大长度是多少?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++
#include“xparameters.h”#include“stdio.h”#include“xutil.h”#include“xaxicdma.h”#include“xil_exception.h”#include“xtmrctr.h”#include“xil_cache.h”volatile
static int Done = 0; volatile static int Error = 0;
static void Example_CallBack(void * CallBackRef,u32 IrqMask,int * IgnorePtr){if(IrqMask& XAXICDMA_XR_IRQ_ERROR_MASK){Error = 1;
} if(IrqMask& XAXICDMA_XR_IRQ_IOC_MASK){Done = 1;
int main(void){int i = 0;
int状态;
int * ddrData = XPAR_DDR3_SDRAM_S_AXI_BASEADDR;
int * ptrData = XPAR_DATA_BRAM_CNTLR_0_S_AXI_BASEADDR;
XAxiCdma xcdma;
//初始化源数据(i = 0; i {*(ddrData + i)= i;} / *内存传输* /
XAxiCdma_IntrEnable(& xcdma,XAXICDMA_XR_IRQ_ALL_MASK);
Status = XAxiCdma_SimpleTransfer(& xcdma,* ddrData,* ptrData,16,Example_CallBack,(void *)& xcdma);
for(i = 0; i {xil_printf(“目标数据:%d n”,*(ptrData + i));}返回0;}
++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++
以上来自于谷歌翻译
以下为原文
Hi,
Thank you for the reply. Following is a interrupt based CDMA data transfer I tried. Here, I use following API:
int XAxiCdma_SimpleTransfer(XAxiCdma *InstancePtr, u32 SrcAddr, u32 DstAddr,
int Length, XAxiCdma_CallBackFn SimpleCallBack, void *CallbackRef);
But,
1) Following code is not working! Any idea why is that?
2) What is the fastest when compare "DMA in polling mode" and "DMA in interrupt mode"?
3) What is the maximum length that I can transfer in XAxiCdma_SimpleTransfer(...)?
++++++++++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++
#include "xparameters.h"
#include "stdio.h"
#include "xutil.h"
#include "xaxicdma.h"
#include "xil_exception.h"
#include "xtmrctr.h"
#include "xil_cache.h"
volatile static int Done = 0;
volatile static int Error = 0;
static void Example_CallBack(void *CallBackRef, u32 IrqMask, int *IgnorePtr)
{
if (IrqMask & XAXICDMA_XR_IRQ_ERROR_MASK) {
Error = 1;
}
if (IrqMask & XAXICDMA_XR_IRQ_IOC_MASK) {
Done = 1;
}
}
int main(void)
{
int i = 0;
int Status;
int *ddrData = XPAR_DDR3_SDRAM_S_AXI_BASEADDR;
int *ptrData = XPAR_DATA_BRAM_CNTLR_0_S_AXI_BASEADDR;
XAxiCdma xcdma;
//Initialize source data
for (i=0;i<1024;i++)
{
*(ddrData+i) = i;
}
/*Memory transfer*/
XAxiCdma_IntrEnable(&xcdma, XAXICDMA_XR_IRQ_ALL_MASK);
Status = XAxiCdma_SimpleTransfer(&xcdma, *ddrData, *ptrData, 16, Example_CallBack, (void *) &xcdma);
for (i=0;i<16;i++)
{
xil_printf("Destination Data : %dn",*(ptrData+i));
}
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
嗨,
感谢您的答复。
以下是我试过的基于中断的CDMA数据传输。
在这里,我使用以下API:
int XAxiCdma_SimpleTransfer(XAxiCdma * InstancePtr,u32 SrcAddr,u32 DstAddr,int Length,XAxiCdma_CallBackFn SimpleCallBack,void * CallbackRef);
但,
1)以下代码不起作用!
知道为什么会这样吗?
2)比较“轮询模式下的DMA”和“DMA中断模式”时最快的是什么?
3)我可以在XAxiCdma_SimpleTransfer(...)中传输的最大长度是多少?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++
#include“xparameters.h”#include“stdio.h”#include“xutil.h”#include“xaxicdma.h”#include“xil_exception.h”#include“xtmrctr.h”#include“xil_cache.h”volatile
static int Done = 0; volatile static int Error = 0;
static void Example_CallBack(void * CallBackRef,u32 IrqMask,int * IgnorePtr){if(IrqMask&amp; XAXICDMA_XR_IRQ_ERROR_MASK){Error = 1;
} if(IrqMask&amp; XAXICDMA_XR_IRQ_IOC_MASK){Done = 1;
int main(void){int i = 0;
int状态;
int * ddrData = XPAR_DDR3_SDRAM_S_AXI_BASEADDR;
int * ptrData = XPAR_DATA_BRAM_CNTLR_0_S_AXI_BASEADDR;
XAxiCdma xcdma;
//初始化源数据(i = 0; i {*(ddrData + i)= i;} / *内存传输* /
XAxiCdma_IntrEnable(&amp; xcdma,XAXICDMA_XR_IRQ_ALL_MASK);
Status = XAxiCdma_SimpleTransfer(&amp; xcdma,* ddrData,* ptrData,16,Example_CallBack,(void *)&amp; xcdma);
for(i = 0; i {xil_printf(“目标数据:%d n”,*(ptrData + i));}返回0;}
++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++
以上来自于谷歌翻译
以下为原文
Hi,
Thank you for the reply. Following is a interrupt based CDMA data transfer I tried. Here, I use following API:
int XAxiCdma_SimpleTransfer(XAxiCdma *InstancePtr, u32 SrcAddr, u32 DstAddr,
int Length, XAxiCdma_CallBackFn SimpleCallBack, void *CallbackRef);
But,
1) Following code is not working! Any idea why is that?
2) What is the fastest when compare "DMA in polling mode" and "DMA in interrupt mode"?
3) What is the maximum length that I can transfer in XAxiCdma_SimpleTransfer(...)?
++++++++++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++
#include "xparameters.h"
#include "stdio.h"
#include "xutil.h"
#include "xaxicdma.h"
#include "xil_exception.h"
#include "xtmrctr.h"
#include "xil_cache.h"
volatile static int Done = 0;
volatile static int Error = 0;
static void Example_CallBack(void *CallBackRef, u32 IrqMask, int *IgnorePtr)
{
if (IrqMask & XAXICDMA_XR_IRQ_ERROR_MASK) {
Error = 1;
}
if (IrqMask & XAXICDMA_XR_IRQ_IOC_MASK) {
Done = 1;
}
}
int main(void)
{
int i = 0;
int Status;
int *ddrData = XPAR_DDR3_SDRAM_S_AXI_BASEADDR;
int *ptrData = XPAR_DATA_BRAM_CNTLR_0_S_AXI_BASEADDR;
XAxiCdma xcdma;
//Initialize source data
for (i=0;i<1024;i++)
{
*(ddrData+i) = i;
}
/*Memory transfer*/
XAxiCdma_IntrEnable(&xcdma, XAXICDMA_XR_IRQ_ALL_MASK);
Status = XAxiCdma_SimpleTransfer(&xcdma, *ddrData, *ptrData, 16, Example_CallBack, (void *) &xcdma);
for (i=0;i<16;i++)
{
xil_printf("Destination Data : %dn",*(ptrData+i));
}
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
举报