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.

DM8148 C6xDSP Performance problem in DVRRDK 2.80 and 3.00

I used the following code to test Version 02.80 and 03.00 of DVRRDK,but found that it makes a big difference in execution time.

In Version 02.80, C6XDSP takes 1 us(ProcTime1=1) in  memcpy and 4 us(ProcTime2=2) in addition.

But in Version 03.00, C6XDSP takes 40 us (ProcTime1=40)  in memcpy and 10 us(ProcTime2 =10) in addition.

I only load c6xdsp, videoM3 and vpssM3. I didn't run any application.

I would like to ask why time differs between these two versions while using DSP to run memcyp.

Thank you.

==================================================================

#define TEST_LOOP_NUM (1800)

#define TEST_MEM_SIZE_DW (1*1024)

void dsp_test_task (

UArg arg0,

UArg arg1

)

{

    UInt64 ProcStartTime;

    UInt64 ProcTime1;

    UInt64 ProcTime2;

    Int32 a;

    Int32 b;

    Int32* c;

    Int32* d;

    Int32 i;

    Int16 tmp;

   c= (Int32*) malloc (TEST_MEM_SIZE_DW);

   d= (Int32*) malloc (TEST_MEM_SIZE_DW);

  while(1)  {

    tmp= Utils_getCurTimeInUsec();

    memset(d, tmp, 640);

    ProcStartTime = Utils_getCurTimeInUsec(); 

    memcpy(c, d  , 640);

    ProcTime1 = Utils_getCurTimeInUsec() - ProcStartTime;

    a = Utils_getCurTimeInUsec();

    b = Utils_getCurTimeInUsec();

    ProcStartTime = Utils_getCurTimeInUsec();

    for (i=0;i<TEST_LOOP_NUM;i++)

    {

        a += b;

    }

    ProcTime2 = Utils_getCurTimeInUsec() - ProcStartTime;

    Vps_printf ("processing1 time=%d us\n", ProcTime1);

    Vps_printf ("processing2 time=%d us\n", ProcTime2);

    Task_sleep(3000);

  }

}


  • There can be two reasons for the performance degradation:

    1. DSP CPU frequency is not set correctly resulting in processor measuring time incorrectly.

    2. For some reason, buffers on which memset and memcpy are done are not cached.

    It looks more likely that the issue is (1). Can you check the DSP frequency configured by uboot matches the frequency set in

    /dvr_rdk/mcfw/interfaces/link_api/system_common.h

    #define SYSTEM_DSP_FREQ            (750*1000*1000)

    matches this.