Changeset 114 for trunk/Softwares


Ignore:
Timestamp:
Apr 17, 2009, 12:35:37 AM (15 years ago)
Author:
rosiere
Message:

1) Fix bug with previous commit
2) Add test libc
3) Change Dhrystone

Location:
trunk/Softwares
Files:
24 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Softwares/Dhrystone/src/c/dhry21a.c

    r112 r114  
    255255  User_Time = End_Time - Begin_Time;
    256256
    257   if (User_Time < Too_Small_Time)
     257//  if (User_Time < Too_Small_Time)
     258//  {
     259//#ifdef HAVE_DOUBLE
     260//    printf ("Measured time too small to obtain meaningful results : %f\n",User_Time);
     261//#else
     262//    printf ("Measured time too small to obtain meaningful results : %d\n",User_Time);
     263//#endif
     264//    printf ("Please increase number of runs\n");
     265//    printf ("\n");
     266//  }
     267//  else
    258268  {
    259     printf ("Measured time too small to obtain meaningful results : %f\n",User_Time);
    260     printf ("Please increase number of runs\n");
    261     printf ("\n");
    262   }
    263   else
    264   {
     269#ifdef HAVE_DOUBLE
    265270    Microseconds          = User_Time * Mic_secs_Per_Second / (DOUBLE) Number_Of_Runs;
    266271    Dhrystones_Per_Second = (DOUBLE) Number_Of_Runs / User_Time;
    267272    Vax_Mips              = Dhrystones_Per_Second / 1757.0;
     273#else
     274    Microseconds          = User_Time                       / (DOUBLE) Number_Of_Runs;
     275#endif
    268276
    269277#ifdef ROPT
     
    274282#endif
    275283
     284#ifdef HAVE_DOUBLE
    276285    printf ("Microseconds for one run through Dhrystone : %.1lf  \n",Microseconds);
    277286    printf ("Dhrystones per Second                      : %.1lf \n",Dhrystones_Per_Second);
    278287    printf ("VAX MIPS rating                            : %.3lf \n",Vax_Mips);
     288#else
     289    printf ("Begin_Time : %d\n",Begin_Time);
     290    printf ("End_Time   : %d\n",End_Time  );
     291    printf ("User_Time  : %d\n",User_Time );
     292    printf ("Numbers of cycle for one run through Dhrystone : %d  \n",Microseconds);
     293#endif
    279294    printf ("\n");
    280295 
     
    283298  fprintf(Ap,"%s\n",Reg_Define);
    284299
     300#ifdef HAVE_DOUBLE
    285301  fprintf(Ap,"Microseconds for one loop : %.1lf\n",Microseconds);
    286302  fprintf(Ap,"Dhrystones per second     : %.1lf\n",Dhrystones_Per_Second);
    287303  fprintf(Ap,"VAX MIPS rating           : %.3lf\n",Vax_Mips);
     304#else
     305  fprintf(Ap,"Numbers of cycle for one loop : %.1d\n",Microseconds);
     306#endif
    288307  }
    289308  fclose(Ap);
    290309  return 0;
    291  
    292310}
    293311
  • trunk/Softwares/Dhrystone/src/c/dtime.c

    r112 r114  
    6565
    6666#ifndef MHZ
    67 #define MHZ (1000000)
     67#define MHZ (1000000.0)
    6868#endif //!MHZ
    6969
     
    7272#endif //!FRQ
    7373
    74 #ifndef DOUBLE
    75 #define double
    76 #endif
    77 
    7874DOUBLE dtime()
    7975{
    8076  DOUBLE q;
    8177
    82 /*   q = (DOUBLE)(my_times())/(DOUBLE)FRQ; */
     78#ifdef HAVE_DOUBLE
     79  q = (DOUBLE)(my_times())/(DOUBLE)FRQ;
     80#else
    8381  q = (DOUBLE)(my_times());
    84  
     82#endif
     83
    8584  return (q);
    8685}
  • trunk/Softwares/Dhrystone/src/c/main.c

    r112 r114  
    1212int main()
    1313{
    14   printf("cycle : %f\n",dtime());
    15  
    16 /*   dhry21(100); */
    17  
    18  
     14  dhry21(100);
     15   
    1916  exit (0);
    2017
  • trunk/Softwares/Dhrystone/src/include/dhry.h

    r112 r114  
    338338/* Compiler and system dependent definitions: */
    339339
    340 #define DOUBLE float
    341 #define Mic_secs_Per_Second     1000000.0
     340#ifndef Morpheo
     341# define HAVE_DOUBLE
     342#endif
     343
     344#ifdef HAVE_DOUBLE
     345# define DOUBLE float
     346# define Mic_secs_Per_Second     1000000.0
     347#else
     348# define DOUBLE unsigned int
     349# define Mic_secs_Per_Second     1000000
     350#endif
    342351
    343352DOUBLE dtime ();
  • trunk/Softwares/Makefile.Software

    r112 r114  
    8181                                $(OR32_LD) -o $@ $^ $(OR32_LD_OPT);             \
    8282                                $(ECHO) "List symbols       : $*.x.nm";         \
    83                                 $(OR32_NM)      $(OR32_NM_OPT)      $^ > $@.nm; \
     83                                $(OR32_NM)      $(OR32_NM_OPT)      $@ > $@.nm; \
    8484                                $(ECHO) "Display info       : $*.x.txt";        \
    8585                                $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $@ > $@.txt;\
  • trunk/Softwares/Test/Test_066/src/c/main.c

    r112 r114  
    1414int main()
    1515{
    16 /*   printf("Hello World !!!\n");  */
     16  printf("Hello World !!!\n");
    1717 
    18   for (int i=0; i<20; ++i)
    19     printf("i : %d\n",i);
    20    
    2118  exit (0);
    2219
  • trunk/Softwares/Test/Test_067/src/c/main.c

    r112 r114  
    1414int main()
    1515{
    16   FILE * file = fopen("Test_067.txt","w");
    17    
    18   if (file == NULL)
    19     exit (1);
    20  
    21   fprintf(file,"Hello World !!!\n");
    22  
    23   if (fclose (file) != 0)
    24     exit (2);
     16  for (int i=0; i<10; ++i)
     17    printf("i : %d\n",i);
    2518 
    2619  exit (0);
Note: See TracChangeset for help on using the changeset viewer.