This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/PROCESSOR-SDK-DRA8X-TDA4X: appUdmaCopy2D cost time too big

Part Number: PROCESSOR-SDK-DRA8X-TDA4X
Other Parts Discussed in Thread: TDA2

Tool/software: Code Composer Studio

Hi :

         i  am   using   TDA4  EVM,  

I did a time-consuming unit test of appudmacopy2d,

In one function, we use appudmacopy2d and memcpy to move 180 * 2 data to perform 10000 times of statistics. The total time of appudmacopy2d is longer than that of memcpy.

The smaller the target data is, the larger the time-consuming gap between appudmacopy2d and memcpy is. It takes about the same time to copy 180 * 320 data. How to improve appudmacopy2d

Efficiency?

Thanks!

Shuai

      

  • Shuai,

    This is expected as the DMA setup is always higher when the data transfer is small. What are we try to achieve here?

    Regards

    Sivaraj R

  • HI :Sivaraj R

         i     just    tyr   to  compear   time  cost  of     appUdmaCopy2D    and    memcpy,    i    think   UDMA  should   de   faster    than    memcpy.

        here    is    a    table     i   list       times      of    diffrent   datasize .       i    think  time  of    appUdmaCopy2D  is   too  big. 

    Thanks

    Shuai

  • As I said this will be faster for larger transfer size. For smaller transfer size, memcpy is faster.

    This is true for any DMA.

    Regards

    Sivaraj R

  • Hi :Sivaraj R

           here   is   some    data   about   it!appUdmaCopy2D 性能统计.xlsx

  • Hi   :Sivaraj R

    in   TDA2     EDMA_UTILS_memcpy2D   is  faser   than   memcpy,     also   faster   than  appUdmaCopy2D

    So I don't think it's reasonable. Maybe there are some problems that can make such a performance

    Thanks

    Shuai

  • You can use DRU channels if you want better throughput. The NAVSS DMA channels are by design doesn't give max performance when using a single UDMA channel. At max we can get around 1GB/sec (including both read/write) for a DDR to DDR transfer.

    Regards

    Sivaraj R

  • Hi :Sivaraj R

          for    better throughput   ,    which    sample   should    i     refer to?

         Thanks

    Shuai

          

  • Kindly use the PDK UDMA DRU example in pdk/packages/ti/drv/udma/examples/udma_dru_testapp

    Regards

    Sivaraj R

  • HI:Sivaraj R

         I     have  try     DRU    it   is   also   slow   than   EDMA  in   TDA4  ,     copy     1K      data      EDMA    is  about  1.5us  but       DRU  use   18us.

      in    my   code    i  have   to   copy     data   between   DDR  and  L2   ,  data  is  small  than  1k   In most cases.   so   have   to   make   UDMA   faster?

    Thanks!

    Shuai

  • slow   than   EDMA  in   TDA2

  • Hi,

    Can you share the changes done to trigger UDMA DRU channel?

    May be we are including the entire channel setup in the test.

    If we know the transfer size well in advance we can submit TR up front and then trigger UDMA with a single API.

    This is show cased in DMA utils of UDMA.

    Regards

    Sivaraj R

  • HI:Sivaraj R

              pdk\packages\ti\drv\udma\examples\udma_dru_test

             I     have  test   this   sample .      copy    1K   data     it   take    18us   and      copy    64K   data     it   take    48us.    for   litter  data   it's  efficiency     relatively low .

           i     test    EDMA   in   TDA2   copy      1K    data    edma   use   1.53us.

    Thanks!

    Shuai

  • Hi Shuai,

    Could you please share the code that you are using to measure the performance? we think there is still something in code that gets added in performance measurement..

    Regards,

    Brijesh

  • Hi:Brijesh

          i    use    pdk\packages\ti\drv\udma\examples\udma_dru_test      test   DRU ,     follow   is   my    code   ,     

    static int32_t App_memcpyTest(Udma_ChHandle chHandle)
    {
        int32_t             retVal = UDMA_SOK;
        uint32_t            i;
        uint32_t            loopCnt = 0U;
        uint8_t            *srcBuf = &gUdmaTestSrcBuf[0U];
        uint8_t            *destBuf = &gUdmaTestDestBuf[0U];

        /* Init buffers */
        for(i = 0U; i < UDMA_TEST_APP_NUM_BYTES; i++)
        {
            srcBuf[i] = i;
            destBuf[i] = 0U;
        }
        printf("i = %d,UDMA_TEST_APP_NUM_BYTES=%d\n", i, UDMA_TEST_APP_NUM_BYTES);
        /* Writeback source and destination buffer */
        Udma_appUtilsCacheWb(&gUdmaTestSrcBuf[0U], UDMA_TEST_APP_NUM_BYTES);
        Udma_appUtilsCacheWb(&gUdmaTestDestBuf[0U], UDMA_TEST_APP_NUM_BYTES);
        uint64_t   currentTS = 0;
        uint64_t   start = 0;
        start = TimerP_getTimeInUsecs();
        while(loopCnt < UDMA_TEST_APP_LOOP_CNT)
        {
            /* Perform UDMA memcpy */

            retVal = App_udmaMemcpy(
                         chHandle,
                         destBuf,
                         srcBuf,
                         UDMA_TEST_APP_NUM_BYTES);
        //    memcpy(destBuf, srcBuf, UDMA_TEST_APP_NUM_BYTES);

            //Udma_appUtilsCacheInv(&gUdmaTestDestBuf[0U], UDMA_TEST_APP_NUM_BYTES);
            //if(UDMA_SOK == retVal)
            //{
            //    /* Compare data */
            //    /* Invalidate destination buffer */

            //    for(i = 0U; i < UDMA_TEST_APP_NUM_BYTES; i++)
            //    {
            //        if(srcBuf[i] != destBuf[i])
            //        {
            //            App_print("[Error] Data mismatch!!\n");
            //            retVal = UDMA_EFAIL;
            //            break;
            //        }
            //    }
            //}

            if(UDMA_SOK != retVal)
            {
                break;
            }

            loopCnt++;
        }
        currentTS = TimerP_getTimeInUsecs();
        printf("Cycles - Using DMA = %llu\n", (currentTS - start));
        return (retVal);
    }
     

    100     times    copy    1K   data     cost   1019us

    Thanks!

    Shuai

        

  • Hello Mr Shuai,

    Are you facing this issue? What is the value of  UDMA_TEST_APP_NUM_BYTES, i mean did you change it from default application?

    Rgds,

    Brijesh