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.

About the useage of DAT_copy

Hi, all

             I do some image processing in CCS 2.21 on evmDM642.I use the IMGLIB to process the video. I list the part of my code.I have two questions:

            for ( i = 0; i < numLines-2; i ++ )
             {              
                        IMG_median_3x3(capFrameBuf->frame.iFrm.y1+i*capLinePitch,720,nMemTemp_out+i*capLinePitch);
           
                       m_nID=DAT_copy(capFrameBuf->frame.iFrm.cb1+i*(capLinePitch>>1),nMemTemp_cb,numPixels>>1);
                       DAT_wait(m_nID);
                       m_nID=DAT_copy(capFrameBuf->frame.iFrm.cr1+i*(capLinePitch>>1),nMemTemp_cr,numPixels>>1);
                       DAT_wait(m_nID); 
                       ICETEKDM642PCIImagebinary();
                       m_nID=DAT_copy(nSegmentTemp,nMemTemp_out+i*capLinePitch,720);
                       DAT_wait(m_nID);
                       IMG_perimeter(nMemTemp_out+i*capLinePitch,720,binary_out+i*capLinePitch);

                      .......

           1: 

           I want to test the overhead of the function of the ICETEKDM642PCIImagebinary(), I write a clock function such as:

           clock_t start,stop,overhead;

           start=clock();    stop=clock();    overhead=stop-start;

           start=clock();

           ICETEKDM642PCIImagebinary();

           stop=clock()

           printf("%d \n",stop-start-overhead);

           But the result is 0.   Why?  I track the running step by step,the application turn into the function of the  ICETEKDM642PCIImagebinary() actually. Why?

           When I use the profile tool to test the cycles of this function,but it can't run continue. WHY?

           2:

            #pragma DATA_ALIGN(nMemTemp_out,128);
            unsigned char nMemTemp_out[720*574];
            unsigned char binary_out[720*574];

            the varibles of nMemTemp_out and binary_out defined as a globle varible allocated in SDRAM,I want to process it in inter ram,so,I defined a varible nSegmentTemp

            #pragma DATA_SECTION(nSegmentTemp, ".INTPROCBUFF");
            #pragma DATA_ALIGN(nSegmentTemp,128);
            unsigned char nSegmentTemp[720];

            the nSegmentTemp is allocated in the inter ram. tha data of nSegmentTemp is evaluated by the function of  ICETEKDM642PCIImagebinary()

           this statements are in another file.  The compiling is passed,When i track this step by step ,I watch the memory

           m_nID=DAT_copy(nSegmentTemp,nMemTemp_out+i*capLinePitch,720);

           The content of the nSegmentTemp is not copied to the nMemTemp_out, the content of the nMemTemp_out is not changed.Why?

           And this statement: IMG_perimeter(nMemTemp_out+i*capLinePitch,720,binary_out+i*capLinePitch);

           This invoke is right? I mean the method of line by line to process this video?

         Thank you very much!

           

  • Jun,

     

    It would be helpful if you provided us with some more information:

    Are you using the simulator or actual hardware? 

    Are you using BIOS?  If so, what version?

    Where did you get the DAT software from, originally?

     

     

  • Hi,Jeff

                 I am using the actual hardware.

                BIOS version: 4.90.00.5

                #include <csl_dat.h> 

                I include this header file in my project. dat_copy is successful before this operation.

               Thank you very much!

  • Hi Jun Wang,

    Is this issue still open or able to fix the issue?

    Regards, Srirami.

  • 1. Is the application working okay but you wonder about the benchmarking value? The function to use for measuring clock cycles is CLK_gethtime() from DSP/BIOS. This may need to be multiplied by some factor to get actual clock cycles, but this should be documented well in your DSP/BIOS User's Guide or API Programmer's Guide. This should fix your 0 benchmark number. I am not sure what the other two questions there mean.

    2. Your plan to do line-by-line processing is a good plan. And using DAT_copy should work. You may need to deal with cache coherency because the EDMA does not go through the cache but the DSP does.