Changeset 114 for trunk/Softwares
- Timestamp:
- Apr 17, 2009, 12:35:37 AM (16 years ago)
- Location:
- trunk/Softwares
- Files:
-
- 24 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/Dhrystone/src/c/dhry21a.c
r112 r114 255 255 User_Time = End_Time - Begin_Time; 256 256 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 258 268 { 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 265 270 Microseconds = User_Time * Mic_secs_Per_Second / (DOUBLE) Number_Of_Runs; 266 271 Dhrystones_Per_Second = (DOUBLE) Number_Of_Runs / User_Time; 267 272 Vax_Mips = Dhrystones_Per_Second / 1757.0; 273 #else 274 Microseconds = User_Time / (DOUBLE) Number_Of_Runs; 275 #endif 268 276 269 277 #ifdef ROPT … … 274 282 #endif 275 283 284 #ifdef HAVE_DOUBLE 276 285 printf ("Microseconds for one run through Dhrystone : %.1lf \n",Microseconds); 277 286 printf ("Dhrystones per Second : %.1lf \n",Dhrystones_Per_Second); 278 287 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 279 294 printf ("\n"); 280 295 … … 283 298 fprintf(Ap,"%s\n",Reg_Define); 284 299 300 #ifdef HAVE_DOUBLE 285 301 fprintf(Ap,"Microseconds for one loop : %.1lf\n",Microseconds); 286 302 fprintf(Ap,"Dhrystones per second : %.1lf\n",Dhrystones_Per_Second); 287 303 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 288 307 } 289 308 fclose(Ap); 290 309 return 0; 291 292 310 } 293 311 -
trunk/Softwares/Dhrystone/src/c/dtime.c
r112 r114 65 65 66 66 #ifndef MHZ 67 #define MHZ (1000000 )67 #define MHZ (1000000.0) 68 68 #endif //!MHZ 69 69 … … 72 72 #endif //!FRQ 73 73 74 #ifndef DOUBLE75 #define double76 #endif77 78 74 DOUBLE dtime() 79 75 { 80 76 DOUBLE q; 81 77 82 /* q = (DOUBLE)(my_times())/(DOUBLE)FRQ; */ 78 #ifdef HAVE_DOUBLE 79 q = (DOUBLE)(my_times())/(DOUBLE)FRQ; 80 #else 83 81 q = (DOUBLE)(my_times()); 84 82 #endif 83 85 84 return (q); 86 85 } -
trunk/Softwares/Dhrystone/src/c/main.c
r112 r114 12 12 int main() 13 13 { 14 printf("cycle : %f\n",dtime()); 15 16 /* dhry21(100); */ 17 18 14 dhry21(100); 15 19 16 exit (0); 20 17 -
trunk/Softwares/Dhrystone/src/include/dhry.h
r112 r114 338 338 /* Compiler and system dependent definitions: */ 339 339 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 342 351 343 352 DOUBLE dtime (); -
trunk/Softwares/Makefile.Software
r112 r114 81 81 $(OR32_LD) -o $@ $^ $(OR32_LD_OPT); \ 82 82 $(ECHO) "List symbols : $*.x.nm"; \ 83 $(OR32_NM) $(OR32_NM_OPT) $ ^> $@.nm; \83 $(OR32_NM) $(OR32_NM_OPT) $@ > $@.nm; \ 84 84 $(ECHO) "Display info : $*.x.txt"; \ 85 85 $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $@ > $@.txt;\ -
trunk/Softwares/Test/Test_066/src/c/main.c
r112 r114 14 14 int main() 15 15 { 16 /* printf("Hello World !!!\n"); */ 16 printf("Hello World !!!\n"); 17 17 18 for (int i=0; i<20; ++i)19 printf("i : %d\n",i);20 21 18 exit (0); 22 19 -
trunk/Softwares/Test/Test_067/src/c/main.c
r112 r114 14 14 int main() 15 15 { 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); 25 18 26 19 exit (0);
Note: See TracChangeset
for help on using the changeset viewer.