Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123978

Forum Post: QDMA PaRam set useless?

$
0
0

Hello,

        (Please visit the site to view this file)(Please visit the site to view this file)

        I'm using TMS320C6678EVM with -O3 optimization option. As in the .c file above, I want to use QDMA channel to move data from DDR3 to L1DSRAM by DataRead(), then write back from L1DSRAM to DDR3 by DataWrite(). 

int DataRead(void* src1,void* src2,void* src3,void* dst1,void* dst2,void* dst3)
{
int i,j;
//QDMA在PARAM重载时可以自动触发channel,但是EDMA不行,所以需要不断查询!
/* Setup param entry */
myParamSetup_QDMA.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_DIS,\
0,CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_DIS, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR);
myParamSetup_QDMA.srcAddr = (Uint32)src1;
myParamSetup_QDMA.aCntbCnt = CSL_EDMA3_CNT_MAKE(ImageWidth*sizeof(float),1);
myParamSetup_QDMA.dstAddr = (Uint32)dst1;
myParamSetup_QDMA.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup_QDMA.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(hParam2,0);
myParamSetup_QDMA.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup_QDMA.cCnt = 1;

/* Setup PING to operate with this PARAM Entry. */
if (CSL_edma3ParamSetup(hParam1, &myParamSetup_QDMA) != CSL_SOK)
{
printf ("Error: EDMA param setup failed\n");
return -1;
}

/* Setting up the next entry */
myParamSetup_QDMA.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_DIS,\
1,CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_DIS, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR);
myParamSetup_QDMA.srcAddr = (Uint32)src2;
myParamSetup_QDMA.aCntbCnt = CSL_EDMA3_CNT_MAKE(ImageWidth*sizeof(float),1);
myParamSetup_QDMA.dstAddr = (Uint32)dst2;
myParamSetup_QDMA.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup_QDMA.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(hParam3,0);
myParamSetup_QDMA.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup_QDMA.cCnt = 1;

/* Setup for the Pong buffer */
if (CSL_edma3ParamSetup(hParam2,&myParamSetup_QDMA) != CSL_SOK)
{
printf ("Error: EDMA param setup failed\n");
return -1;
}

/* Setting up the next entry */
myParamSetup_QDMA.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN,\
2,CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_EN, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR);
myParamSetup_QDMA.srcAddr = (Uint32)src3;
myParamSetup_QDMA.aCntbCnt = CSL_EDMA3_CNT_MAKE(ImageWidth*sizeof(float),1);
myParamSetup_QDMA.dstAddr = (Uint32)dst3;
myParamSetup_QDMA.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup_QDMA.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(0xffff,0);
myParamSetup_QDMA.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup_QDMA.cCnt = 1;

/* Setup for the Pong buffer */
if (CSL_edma3ParamSetup(hParam3,&myParamSetup_QDMA) != CSL_SOK)
{
printf ("Error: EDMA param setup failed\n");
return -1;
}

/* Trigger the word by writing to the trigger word... */
if (CSL_edma3ParamWriteWord(hParam1,Core0QDMATW,1) != CSL_SOK) {
printf ("Error: EDMA param write word failed\n");
return -1;
}

regionIntr_QDMA.region = CSL_EDMA3_REGION_GLOBAL;
regionIntr_QDMA.intr = 0;
regionIntr_QDMA.intrh = 0;
/* Poll IPR bit */
regionIntr_QDMA.region = CSL_EDMA3_REGION_GLOBAL;
do {
CSL_edma3GetHwStatus(hModule_QDMA,CSL_EDMA3_QUERY_INTRPEND,&regionIntr_QDMA);
} while (!(regionIntr_QDMA.intr & 0x4));

/* Clear pending interrupt */
if (CSL_edma3HwControl(hModule_QDMA,CSL_EDMA3_CMD_INTRPEND_CLEAR, &regionIntr_QDMA) != CSL_SOK)
{
printf ("Error: EDMA clear interrupt pend command failed\n");
return -1;
}

return 0;
}

//返回0则成功,1为失败。
int DataWrite(void* src1,void* dst1)
{
int i,j;
/* Setting up the next entry */
myParamSetup_QDMA.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN,\
2,CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_EN, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR);
myParamSetup_QDMA.srcAddr = (Uint32)src1;
myParamSetup_QDMA.aCntbCnt = CSL_EDMA3_CNT_MAKE(ImageWidth*sizeof(float),1);
myParamSetup_QDMA.dstAddr = (Uint32)dst1;
myParamSetup_QDMA.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup_QDMA.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(0xffff,0);
myParamSetup_QDMA.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup_QDMA.cCnt = 1;

/* Setup for the Pong buffer */
if (CSL_edma3ParamSetup(hParam1,&myParamSetup_QDMA) != CSL_SOK)
{
printf ("Error: EDMA param setup failed\n");
return -1;
}

/* Trigger the word by writing to the trigger word... */
if (CSL_edma3ParamWriteWord(hParam1,Core0QDMATW,1) != CSL_SOK) {
printf ("Error: EDMA param write word failed\n");
return -1;
}

regionIntr_QDMA.region = CSL_EDMA3_REGION_GLOBAL;
regionIntr_QDMA.intr = 0;
regionIntr_QDMA.intrh = 0;
/* Poll IPR bit */
regionIntr_QDMA.region = CSL_EDMA3_REGION_GLOBAL;
do {
CSL_edma3GetHwStatus(hModule_QDMA,CSL_EDMA3_QUERY_INTRPEND,&regionIntr_QDMA);
} while (!(regionIntr_QDMA.intr & 0x4));

/* Clear pending interrupt */
if (CSL_edma3HwControl(hModule_QDMA,CSL_EDMA3_CMD_INTRPEND_CLEAR, &regionIntr_QDMA) != CSL_SOK)
{
printf ("Error: EDMA clear interrupt pend command failed\n");
return -1;
}

return 0;
}

      I know that for L1DSRAM data, if their address want to be seen by other module, it must change to the global address:0x10000000+DNUM*0x1000000+data_address.

      Am I right that a paRam set mapped to a channel can be changed (with STATIC=0) every time before retrigger the QDMA channel?   My problem is that even the source data address and destination data address was passed to the functions' arguments correctly, the destination data remained unchanged or totally wrong. And when complete one progress( go through DataRead()+DataWrite() ), it will just stucked in DataRead() with no EDMA transfer complete.

     I really don't know how this happened, could anybody help? Really appreciate for your help!


Viewing all articles
Browse latest Browse all 123978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>