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.

problem of EVM6678 reading txt

Hi,

I use EVM6678L to read a txt file which is 50K bit and contains 4800 float data. It takes 19543907 cpu cycles to finish reading. Divided by the cpu frequency 1GHz, so the time of reading should be a little bit more than 19ms. However, the actual time is much longer than 19ms. I use a timer to measure the time and it is more or less 40s. What's the reason of this? Below is my testing code.

#include<stdio.h>
#include<stdlib.h>
#include "float.h"
#include <c6x.h>

void main()
{
 float a[4800];
 int i;
 FILE *fid;
 unsigned long long t1,t2;
    TSCL=0;
    TSCH=0;
    t1=_itoll(TSCH,TSCL);
 if((fid=fopen("p.txt","r"))==NULL)
 {
     printf("Cannot open pfile!\n");
     exit(0);
 }
 for(i=0;i<4800;i++)
 {
     fscanf(fid,"%f",&a[i]);
 }
 fclose(fid);
 t2=_itoll(TSCH,TSCL);
 printf("Done\n");
 printf("run_cycle=%lld\n",t2-t1);
}