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.

why the speed of memcpy on DDR2 of dm6467 is too slow?



When I use DM6467 ,I find it is very slow to copy a large data from buffer a  to buffer b which are both allocated on DDR2. So I  did  a test using the following program.  Compile the following code and run it on PC (Linux OS), the rate of memcpy is 879M/s. Compile the same code and run it on DM6467, the rate of memcpy is only 76M/s. 
Is it the problem with my hardware?
Who can tell me the reason?

#define US 1000000
#define BUFSIZE (1024*200)
int main()
{
    char *p;
    char *a, *b;
    double size;
    double sec;
    int sumTime;
    int i;

    struct timeval startInitTime;
    struct timeval doneInitTime;

    a= (char *)malloc(BUFSIZE);
    b= (char *)malloc(BUFSIZE);

    p = a;
 
    for (i=0;i<BUFSIZE;i++)
   {
      *(p++) = i;
   }
   p = a;

   gettimeofday(&startInitTime, NULL);
   memcpy(b,a,BUFSIZE);
   gettimeofday(&doneInitTime, NULL);
   sumTime=((doneInitTime.tv_sec - startInitTime.tv_sec) * US + (doneInitTime.tv_usec - startInitTime.tv_usec));
 
    size = (double)BUFSIZE/(1024*1024);
    sec =  (double)sumTime/1000000;

    printf(" rate is %d M/s\n",(int)(size/sec));
   
    free(b);
    free(a);
}