Ignore:
Timestamp:
Feb 16, 2010, 1:35:48 PM (14 years ago)
Author:
rosiere
Message:

Various modif (add test, and vhdl)

Location:
trunk/Softwares/MiBench
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Softwares/MiBench/Makefile

    r129 r137  
    1717DIR_SYS                         = $(DIR_SRC)/sys
    1818DIR_INC                         = $(DIR_SRC)/include
    19 DIR_LDSCRIPT                    = $(NEWLIB)/lib/
     19DIR_LDSCRIPT                    = $($(OS)_DIR_LDSCRIPT)
    2020
    21 INCDIR                          = $(NEWLIB_INCDIR) -I$(DIR_INC)
    22 LIBDIR                          = $(NEWLIB_LIBDIR)
    23 LIBNAME                         = $(NEWLIB_LIBNAME)
     21INCDIR                          = $($(OS)_INCDIR) -I$(DIR_INC)
     22LIBDIR                          = $($(OS)_LIBDIR)
     23LIBNAME                         = $($(OS)_LIBNAME)
    2424
    2525MIBENCH_DATA_PATH               = $(MORPHEO_TOPLEVEL)/Softwares/MiBench/data
     
    2828
    2929#-----[ Files ]-------------------------------------------------------------------
    30 OBJECTS                         =       $(NEWLIB)/lib/*.o \
     30OBJECTS                         =       $($(OS)_OBJECTS) \
    3131                                        $(patsubst $(DIR_ASM)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_ASM)/*.s))    \
    3232                                        $(patsubst $(DIR_SYS)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SYS)/*.s))    \
  • trunk/Softwares/MiBench/Makefile.defs

    r130 r137  
    1010
    1111BENCHS                  = \
    12                         automative.basicmath\
    13                         automative.bitcount \
    14                         automative.qsort    \
    15                         automative.susan    \
    16                         network.dijkstra    \
    17                         office.stringsearch \
    18                         security.sha        \
     12                        automative.basicmath            \
     13                        automative.bitcount             \
     14                        automative.qsort                \
     15                        automative.susan                \
     16                        automative.susan_edges          \
     17                        automative.susan_corners        \
     18                        automative.susan_smoothing      \
     19                        network.dijkstra                \
     20                        office.stringsearch             \
     21                        security.sha                    \
     22                        all                             \
    1923                        none
    2024
    21 BENCHS_TYPE             = -DMIBENCH_LARGE
     25BENCHS_TYPE             = -DMIBENCH_SMALL
    2226
    2327# MIBENCH_SMALL
  • trunk/Softwares/MiBench/src/c/benchmark.c

    r129 r137  
    148148    free(argv[i]);
    149149  free(argv);
     150  free(filename);
    150151}
    151152#endif
     
    175176    free(argv[i]);
    176177  free(argv);
     178  free(filename);
    177179}
    178180#endif
     
    193195
    194196//=======================================================================================
    195 //                                                       [ run_automative_susan ]
    196 //=======================================================================================
    197 #ifdef MIBENCH_SMALL
    198 void main_susan_small (void)
     197//                                                   [ run_automative_susan_egdes ]
     198//=======================================================================================
     199#ifdef MIBENCH_SMALL
     200void main_susan_edges_small (void)
    199201{
    200202  int     argc = 4;
     
    205207  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
    206208  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
     209  char  * filename_output = "output_small.edges.pgm";
     210  char  * option          = "-e";                   
    207211 
    208212  argv    = (char **)malloc ((argc) * sizeof(char *));
     
    214218  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
    215219
    216   char  * filename_output = "output_small.smoothing.pgm";
    217   char  * option          = "-s";
    218 
    219220  argv[2] = (char *) malloc (strlen(filename_output));
    220221  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     
    225226  main_susan(argc, argv);
    226227
    227   for (int i=2; i<argc; ++i)
    228     free(argv[i]);
    229 
    230   filename_output = "output_small.edges.pgm";
    231   option          = "-e";
    232 
    233   argv[2] = (char *) malloc (strlen(filename_output));
    234   argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
    235 
    236   argv[3] = (char *) malloc (strlen(option         ));
    237   argv[3] = memcpy(argv[3],option         ,strlen(option         ));
    238 
    239   main_susan(argc, argv);
    240 
    241   for (int i=2; i<argc; ++i)
    242     free(argv[i]);
    243 
    244   for (int i=2; i<argc; ++i)
    245     free(argv[i]);
    246 
    247   filename_output = "output_small.cornes.pgm";
    248   option          = "-c";
    249 
    250   argv[2] = (char *) malloc (strlen(filename_output));
    251   argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
    252 
    253   argv[3] = (char *) malloc (strlen(option         ));
    254   argv[3] = memcpy(argv[3],option         ,strlen(option         ));
    255 
    256   main_susan(argc, argv);
    257    
    258   for (int i=0; i<argc; ++i)
    259     free(argv[i]);
    260   free(argv);
    261 }
    262 #endif
    263 
    264 #ifdef MIBENCH_LARGE
    265 void main_susan_large (void)
     228  for (int i=0; i<argc; ++i)
     229    free(argv[i]);
     230  free(argv);
     231  free(filename_input);
     232}
     233#endif
     234
     235#ifdef MIBENCH_LARGE
     236void main_susan_edges_large (void)
    266237{
    267238  int     argc = 4;
     
    272243  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
    273244  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
     245  char  * filename_output = "output_large.edges.pgm";
     246  char  * option          = "-e";                   
    274247 
    275248  argv    = (char **)malloc ((argc) * sizeof(char *));
     
    281254  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
    282255
     256  argv[2] = (char *) malloc (strlen(filename_output));
     257  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     258
     259  argv[3] = (char *) malloc (strlen(option         ));
     260  argv[3] = memcpy(argv[3],option         ,strlen(option         ));
     261
     262  main_susan(argc, argv);
     263
     264  for (int i=0; i<argc; ++i)
     265    free(argv[i]);
     266  free(argv);
     267  free(filename_input);
     268}
     269#endif
     270
     271void run_automative_susan_edges (void)
     272{
     273  printf("***** automative.susan.edges - Begin *****\n");
     274 
     275#ifdef MIBENCH_SMALL
     276  main_susan_edges_small     ();
     277#endif
     278#ifdef MIBENCH_LARGE
     279  main_susan_edges_large     ();
     280#endif
     281
     282  printf("***** automative.susan.edges - End   *****\n");
     283}
     284
     285//=======================================================================================
     286//                                                  [ run_automative_susan_corners ]
     287//=======================================================================================
     288#ifdef MIBENCH_SMALL
     289void main_susan_corners_small (void)
     290{
     291  int     argc = 4;
     292  char ** argv;
     293
     294  char  * execname        = "./susan";
     295  char  *_filename_input  = "/susan-input_small.pgm";
     296  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
     297  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
     298  char  * filename_output = "output_small.corners.pgm";
     299  char  * option          = "-c";
     300 
     301  argv    = (char **)malloc ((argc) * sizeof(char *));
     302 
     303  argv[0] = (char *) malloc (strlen(execname       ));
     304  argv[0] = memcpy(argv[0],execname       ,strlen(execname       ));
     305
     306  argv[1] = (char *) malloc (strlen(filename_input ));
     307  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
     308
     309  argv[2] = (char *) malloc (strlen(filename_output));
     310  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     311
     312  argv[3] = (char *) malloc (strlen(option         ));
     313  argv[3] = memcpy(argv[3],option         ,strlen(option         ));
     314
     315  main_susan(argc, argv);
     316   
     317  for (int i=0; i<argc; ++i)
     318    free(argv[i]);
     319  free(argv);
     320  free(filename_input);
     321}
     322#endif
     323
     324#ifdef MIBENCH_LARGE
     325void main_susan_corners_large (void)
     326{
     327  int     argc = 4;
     328  char ** argv;
     329
     330  char  * execname        = "./susan";
     331  char  *_filename_input  = "/susan-input_large.pgm";
     332  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
     333  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
     334  char  * filename_output = "output_small.corners.pgm";
     335  char  * option          = "-c";
     336 
     337  argv    = (char **)malloc ((argc) * sizeof(char *));
     338 
     339  argv[0] = (char *) malloc (strlen(execname       ));
     340  argv[0] = memcpy(argv[0],execname       ,strlen(execname       ));
     341
     342  argv[1] = (char *) malloc (strlen(filename_input ));
     343  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
     344
     345  argv[2] = (char *) malloc (strlen(filename_output));
     346  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     347
     348  argv[3] = (char *) malloc (strlen(option         ));
     349  argv[3] = memcpy(argv[3],option         ,strlen(option         ));
     350
     351  main_susan(argc, argv);
     352   
     353  for (int i=0; i<argc; ++i)
     354    free(argv[i]);
     355  free(argv);
     356  free(filename_input);
     357}
     358#endif
     359
     360void run_automative_susan_corners (void)
     361{
     362  printf("***** automative.susan.corners - Begin *****\n");
     363 
     364#ifdef MIBENCH_SMALL
     365  main_susan_corners_small   ();
     366#endif
     367#ifdef MIBENCH_LARGE
     368  main_susan_corners_large   ();
     369#endif
     370
     371  printf("***** automative.susan.corners - End   *****\n");
     372}
     373
     374//=======================================================================================
     375//                                                [ run_automative_susan_smoothing ]
     376//=======================================================================================
     377#ifdef MIBENCH_SMALL
     378void main_susan_smoothing_small (void)
     379{
     380  int     argc = 4;
     381  char ** argv;
     382
     383  char  * execname        = "./susan";
     384  char  *_filename_input  = "/susan-input_small.pgm";
     385  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
     386  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
     387  char  * filename_output = "output_small.smoothing.pgm";
     388  char  * option          = "-s";
     389 
     390  argv    = (char **)malloc ((argc) * sizeof(char *));
     391 
     392  argv[0] = (char *) malloc (strlen(execname       ));
     393  argv[0] = memcpy(argv[0],execname       ,strlen(execname       ));
     394
     395  argv[1] = (char *) malloc (strlen(filename_input ));
     396  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
     397
     398  argv[2] = (char *) malloc (strlen(filename_output));
     399  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     400
     401  argv[3] = (char *) malloc (strlen(option         ));
     402  argv[3] = memcpy(argv[3],option         ,strlen(option         ));
     403
     404  main_susan(argc, argv);
     405
     406  for (int i=0; i<argc; ++i)
     407    free(argv[i]);
     408  free(argv);
     409  free(filename_input);
     410}
     411#endif
     412
     413#ifdef MIBENCH_LARGE
     414void main_susan_smoothing_large (void)
     415{
     416  int     argc = 4;
     417  char ** argv;
     418
     419  char  * execname        = "./susan";
     420  char  *_filename_input  = "/susan-input_large.pgm";
     421  char  * filename_input  = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input));
     422  strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input);
    283423  char  * filename_output = "output_large.smoothing.pgm";
    284424  char  * option          = "-s";
    285425
     426  argv    = (char **)malloc ((argc) * sizeof(char *));
     427 
     428  argv[0] = (char *) malloc (strlen(execname       ));
     429  argv[0] = memcpy(argv[0],execname       ,strlen(execname       ));
     430
     431  argv[1] = (char *) malloc (strlen(filename_input ));
     432  argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input ));
    286433  argv[2] = (char *) malloc (strlen(filename_output));
    287434  argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
     
    291438
    292439  main_susan(argc, argv);
    293 
    294   for (int i=2; i<argc; ++i)
    295     free(argv[i]);
    296 
    297   filename_output = "output_large.edges.pgm";
    298   option          = "-e";
    299 
    300   argv[2] = (char *) malloc (strlen(filename_output));
    301   argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
    302 
    303   argv[3] = (char *) malloc (strlen(option         ));
    304   argv[3] = memcpy(argv[3],option         ,strlen(option         ));
    305 
    306   main_susan(argc, argv);
    307 
    308   for (int i=2; i<argc; ++i)
    309     free(argv[i]);
    310 
    311   for (int i=2; i<argc; ++i)
    312     free(argv[i]);
    313 
    314   filename_output = "output_large.cornes.pgm";
    315   option          = "-c";
    316 
    317   argv[2] = (char *) malloc (strlen(filename_output));
    318   argv[2] = memcpy(argv[2],filename_output,strlen(filename_output));
    319 
    320   argv[3] = (char *) malloc (strlen(option         ));
    321   argv[3] = memcpy(argv[3],option         ,strlen(option         ));
    322 
    323   main_susan(argc, argv);
    324    
    325   for (int i=0; i<argc; ++i)
    326     free(argv[i]);
    327   free(argv);
    328 }
    329 #endif
     440   
     441  for (int i=0; i<argc; ++i)
     442    free(argv[i]);
     443  free(argv);
     444  free(filename_input);
     445}
     446#endif
     447
     448void run_automative_susan_smoothing (void)
     449{
     450  printf("***** automative.susan.smoothing - Begin *****\n");
     451 
     452#ifdef MIBENCH_SMALL
     453  main_susan_smoothing_small ();
     454#endif
     455#ifdef MIBENCH_LARGE
     456  main_susan_smoothing_large ();
     457#endif
     458
     459  printf("***** automative.susan.smoothing - End   *****\n");
     460}
     461
     462//=======================================================================================
     463//                                                       [ run_automative_susan ]
     464//=======================================================================================
    330465
    331466void run_automative_susan (void)
     
    333468  printf("***** automative.susan - Begin *****\n");
    334469 
    335 #ifdef MIBENCH_SMALL
    336   main_susan_small ();
    337 #endif
    338 #ifdef MIBENCH_LARGE
    339   main_susan_large ();
    340 #endif
     470  run_automative_susan_edges     ();
     471  run_automative_susan_corners   ();
     472  run_automative_susan_smoothing ();
     473
     474  /*
     475#ifdef MIBENCH_SMALL
     476  main_susan_edges_small     ();
     477  main_susan_corners_small   ();
     478  main_susan_smoothing_small ();
     479#endif
     480#ifdef MIBENCH_LARGE
     481  main_susan_edges_large     ();
     482  main_susan_corners_large   ();
     483  main_susan_smoothing_large ();
     484#endif
     485  */
    341486
    342487  printf("***** automative.susan - End   *****\n");
     
    376521    free(argv[i]);
    377522  free(argv);
     523  free(filename);
    378524}
    379525#endif
     
    409555    free(argv[i]);
    410556  free(argv);
     557  free(filename);
    411558}
    412559#endif
     
    470617    free(argv[i]);
    471618  free(argv);
     619  free(filename);
    472620}
    473621#endif
     
    497645    free(argv[i]);
    498646  free(argv);
     647  free(filename);
    499648}
    500649#endif
     
    513662  printf("***** security.sha - End   *****\n");
    514663}
     664
     665
     666//=======================================================================================
     667//                                                                       [ run_all ]     
     668//=======================================================================================
     669void run_all (void)
     670{
     671  printf("***** all *****\n");
     672
     673  run_automative_basicmath       ();
     674  run_automative_bitcount        ();
     675  run_automative_qsort           ();
     676  run_automative_susan_edges     ();
     677  run_automative_susan_corners   ();
     678  run_automative_susan_smoothing ();
     679 
     680  run_network_dijkstra           ();
     681 
     682  run_office_stringsearch        ();
     683 
     684  run_security_sha               ();
     685
     686  return;
     687}
  • trunk/Softwares/MiBench/src/c/main.c

    r117 r137  
    1616int main()
    1717{
     18#ifdef Morpheo
    1819  int pid = (int)getpid();
    1920 
     
    2526  else
    2627    printf("The number of function in the workload is %d. (maximum of thread is : %d)\n",(int)NB_WORKLOAD,NB_THREAD_MAX);
    27    
     28#endif
     29
     30#ifdef UNIX
     31  for (int i=0; i<(int)NB_WORKLOAD; ++i)
     32    (*WorkLoad[i])();
     33#endif
     34
    2835  exit (0);
    2936
  • trunk/Softwares/MiBench/src/include/benchmark.h

    r124 r137  
    44#define benchmark_h
    55
    6 void run_none                 (void);
     6void run_none                       (void);
     7void run_all                        (void);
     8                                   
     9void run_automative_basicmath       (void);
     10void run_automative_bitcount        (void);
     11void run_automative_qsort           (void);
     12void run_automative_susan           (void);
     13void run_automative_susan_edges     (void);
     14void run_automative_susan_corners   (void);
     15void run_automative_susan_smoothing (void);
    716
    8 void run_automative_basicmath (void);
    9 void run_automative_bitcount  (void);
    10 void run_automative_qsort     (void);
    11 void run_automative_susan     (void);
    12 
    13 void run_network_dijkstra     (void);
    14 
    15 void run_office_stringsearch  (void);
    16 
    17 void run_security_sha         (void);
     17void run_network_dijkstra           (void);
     18                                   
     19void run_office_stringsearch        (void);
     20                                   
     21void run_security_sha               (void);
    1822
    1923#endif // benchmark_h
  • trunk/Softwares/MiBench/src/include/workload.h

    r124 r137  
    1212void (*WorkLoad[])() =
    1313{
    14         (void *) run_security_sha
     14        (void *) run_automative_susan
    1515};
    1616
  • trunk/Softwares/MiBench/workload.sh

    r124 r137  
    1 echo -e "1\n1\n2\n3\n4\n5\n6\n7\n0\n" | make -s workload
     1echo -e "1\n4\n0\n" | make -s workload
  • trunk/Softwares/MiBench/workload.txt

    r124 r137  
    1 soft_0.x :  automative_basicmath
    2 soft_1.x :  automative_bitcount
    3 soft_2.x :  automative_qsort
    4 soft_3.x :  automative_susan
    5 soft_4.x :  network_dijkstra
    6 soft_5.x :  office_stringsearch
    7 soft_6.x :  security_sha
     1soft_0.x :  automative_susan
Note: See TracChangeset for help on using the changeset viewer.