1 | // $Id: benchmark.c 119 2009-05-25 17:40:26Z rosiere $ |
---|
2 | |
---|
3 | #include <stdlib.h> |
---|
4 | #include <string.h> |
---|
5 | #include <stdio.h> |
---|
6 | |
---|
7 | #ifndef SPECINT2000_PATH |
---|
8 | # error "SPECINT2000_PATH must be defined" |
---|
9 | #endif |
---|
10 | |
---|
11 | //#define SPEC_DATA "ref" |
---|
12 | #define SPEC_DATA "test" |
---|
13 | //#define SPEC_DATA "train" |
---|
14 | |
---|
15 | int main_164_gzip (int argc, char * argv[]); |
---|
16 | int main_175_vpr (int argc, char * argv[]); |
---|
17 | int main_176_gcc (int argc, char * argv[]); |
---|
18 | int main_181_mcf (int argc, char * argv[]); |
---|
19 | int main_255_vortex (int argc, char * argv[]); |
---|
20 | int main_256_bzip2 (int argc, char * argv[]); |
---|
21 | int main_300_twolf (int argc, char * argv[]); |
---|
22 | |
---|
23 | //======================================================================================= |
---|
24 | // [ run_none ] |
---|
25 | //======================================================================================= |
---|
26 | void run_none () |
---|
27 | { |
---|
28 | printf("***** none *****\n"); |
---|
29 | return; |
---|
30 | } |
---|
31 | |
---|
32 | //======================================================================================= |
---|
33 | // [ run_164_gzip ] |
---|
34 | //======================================================================================= |
---|
35 | void run_164_gzip () |
---|
36 | { |
---|
37 | printf("***** 164.gzip - Begin *****\n"); |
---|
38 | |
---|
39 | int argc = 4; |
---|
40 | char ** argv; |
---|
41 | |
---|
42 | char * execname = "./gzip"; |
---|
43 | char *_filename = "/164.gzip/data/test/input/input.compressed"; |
---|
44 | char * filename = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_filename)); |
---|
45 | strcpy(filename,SPECINT2000_PATH); strcat(filename,_filename); |
---|
46 | char * input_size = "1"; |
---|
47 | char * compressed_size = "1"; |
---|
48 | |
---|
49 | // Create the arguments |
---|
50 | if ((argc < 1) || (argc > 4) ) |
---|
51 | { |
---|
52 | printf("Usage : gzip [filename] [intput_size] [compressed_size]\n"); |
---|
53 | return; |
---|
54 | } |
---|
55 | |
---|
56 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
57 | |
---|
58 | argv[0] = (char *) malloc (strlen(execname )); |
---|
59 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
60 | |
---|
61 | if (argc > 1) |
---|
62 | { |
---|
63 | argv[1] = (char *) malloc (strlen(filename )); |
---|
64 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
65 | } |
---|
66 | |
---|
67 | if (argc > 2) |
---|
68 | { |
---|
69 | argv[2] = (char *) malloc (strlen(input_size )); |
---|
70 | argv[2] = memcpy(argv[2],input_size ,strlen(input_size )); |
---|
71 | } |
---|
72 | |
---|
73 | if (argc > 3) |
---|
74 | { |
---|
75 | argv[3] = (char *) malloc (strlen(compressed_size)); |
---|
76 | argv[3] = memcpy(argv[3],compressed_size ,strlen(compressed_size)); |
---|
77 | } |
---|
78 | |
---|
79 | // +-------------------+ |
---|
80 | // | Run the benchmark | |
---|
81 | // +-------------------+ |
---|
82 | main_164_gzip (argc,argv); |
---|
83 | |
---|
84 | free(filename); |
---|
85 | |
---|
86 | printf("***** 164.gzip - End *****\n"); |
---|
87 | } |
---|
88 | |
---|
89 | //======================================================================================= |
---|
90 | // [ run_175_vpr ] |
---|
91 | //======================================================================================= |
---|
92 | void run_175_vpr () |
---|
93 | { |
---|
94 | printf("***** 175.vpr - Begin *****\n"); |
---|
95 | |
---|
96 | #define nb_option_175_vpr 12 |
---|
97 | int argc = 5 + nb_option_175_vpr; |
---|
98 | char ** argv; |
---|
99 | |
---|
100 | char * execname = "./vpr"; |
---|
101 | |
---|
102 | char *_circuit_net = "/175.vpr/data/test/input/net.in"; |
---|
103 | char *_fpga_arch = "/175.vpr/data/test/input/arch.in"; |
---|
104 | char *_placed_out = "/175.vpr/data/test/input/place.in"; |
---|
105 | char *_routed_out = "/175.vpr/data/test/input/route.out"; |
---|
106 | |
---|
107 | char * circuit_net = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_circuit_net)); |
---|
108 | char * fpga_arch = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_fpga_arch )); |
---|
109 | char * placed_out = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_placed_out )); |
---|
110 | char * routed_out = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_routed_out )); |
---|
111 | |
---|
112 | strcpy(circuit_net,SPECINT2000_PATH); strcat(circuit_net,_circuit_net); |
---|
113 | strcpy(fpga_arch ,SPECINT2000_PATH); strcat(fpga_arch ,_fpga_arch ); |
---|
114 | strcpy(placed_out ,SPECINT2000_PATH); strcat(placed_out ,_placed_out ); |
---|
115 | strcpy(routed_out ,SPECINT2000_PATH); strcat(routed_out ,_routed_out ); |
---|
116 | |
---|
117 | /* |
---|
118 | General Options: |
---|
119 | [-nodisp] |
---|
120 | [-auto <int>] |
---|
121 | [-route_only] |
---|
122 | [-place_only] |
---|
123 | [-aspect_ratio <float>] |
---|
124 | [-nx <int>] |
---|
125 | [-ny <int>] |
---|
126 | [-full_stats] |
---|
127 | [-fast] |
---|
128 | [-timing_analysis on | off] |
---|
129 | |
---|
130 | Placer Options: |
---|
131 | [-init_t <float>] |
---|
132 | [-exit_t <float>] |
---|
133 | [-alpha_t <float>] |
---|
134 | [-inner_num <float>] |
---|
135 | [-seed <int>] |
---|
136 | [-place_cost_exp <float>] |
---|
137 | [-place_cost_type linear | nonlinear] |
---|
138 | [-place_chan_width <int>] |
---|
139 | [-num_regions <int>] |
---|
140 | [-fix_pins random | <file.pads>] |
---|
141 | |
---|
142 | Router Options: |
---|
143 | [-max_router_iterations <int>] |
---|
144 | [-bb_factor <int>] |
---|
145 | [-initial_pres_fac <float>] |
---|
146 | [-pres_fac_mult <float>] |
---|
147 | [-acc_fac <float>] |
---|
148 | [-first_iter_pres_fac <float>] |
---|
149 | [-bend_cost <float>] |
---|
150 | [-route_type global | detailed] |
---|
151 | [-verify_binary_search] |
---|
152 | [-route_chan_width <int>] |
---|
153 | */ |
---|
154 | |
---|
155 | char * option [nb_option_175_vpr] = |
---|
156 | { |
---|
157 | "-nodisp" , |
---|
158 | "-route_only" , |
---|
159 | "-route_chan_width" , "15", |
---|
160 | "-pres_fac_mult" , "2" , |
---|
161 | "-acc_fac" , "1" , |
---|
162 | "-first_iter_pres_fac" , "4" , |
---|
163 | "-initial_pres_fac" , "8" |
---|
164 | }; |
---|
165 | |
---|
166 | // Create the arguments |
---|
167 | if (argc < 5) |
---|
168 | { |
---|
169 | printf("Usage : vpr circuit.net fpga.arch placed.out routed.out [Options ...]\n"); |
---|
170 | return; |
---|
171 | } |
---|
172 | |
---|
173 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
174 | |
---|
175 | argv[0] = (char *) malloc (strlen(execname )); |
---|
176 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
177 | |
---|
178 | argv[1] = (char *) malloc (strlen(circuit_net )); |
---|
179 | argv[1] = memcpy(argv[1],circuit_net ,strlen(circuit_net )); |
---|
180 | |
---|
181 | argv[2] = (char *) malloc (strlen(fpga_arch )); |
---|
182 | argv[2] = memcpy(argv[2],fpga_arch ,strlen(fpga_arch )); |
---|
183 | |
---|
184 | argv[3] = (char *) malloc (strlen(placed_out )); |
---|
185 | argv[3] = memcpy(argv[3],placed_out ,strlen(placed_out )); |
---|
186 | |
---|
187 | argv[4] = (char *) malloc (strlen(routed_out )); |
---|
188 | argv[4] = memcpy(argv[4],routed_out ,strlen(routed_out )); |
---|
189 | |
---|
190 | { |
---|
191 | unsigned int i; |
---|
192 | |
---|
193 | for (i = 0; i < nb_option_175_vpr; i ++) |
---|
194 | { |
---|
195 | argv[5+i] = (char *) malloc (strlen(option[i] )); |
---|
196 | argv[5+i] = memcpy(argv[5+i],option[i] ,strlen(option[i] )); |
---|
197 | }// end i |
---|
198 | } |
---|
199 | |
---|
200 | // +-------------------+ |
---|
201 | // | Run the benchmark | |
---|
202 | // +-------------------+ |
---|
203 | main_175_vpr (argc,argv); |
---|
204 | |
---|
205 | free(circuit_net); |
---|
206 | free(fpga_arch ); |
---|
207 | free(placed_out ); |
---|
208 | free(routed_out ); |
---|
209 | |
---|
210 | printf("***** 175.vpr - End *****\n"); |
---|
211 | } |
---|
212 | |
---|
213 | //======================================================================================= |
---|
214 | // [ run_176_gcc ] |
---|
215 | //======================================================================================= |
---|
216 | void run_176_gcc () |
---|
217 | { |
---|
218 | printf("***** 176.gcc - Begin *****\n"); |
---|
219 | |
---|
220 | #define nb_option_176_gcc 2 |
---|
221 | int argc = 2 + nb_option_176_gcc; |
---|
222 | char ** argv; |
---|
223 | |
---|
224 | char * execname = "./gcc"; |
---|
225 | char *_filename = "/176.gcc/data/test/input/cccp.i"; |
---|
226 | char * filename = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_filename)); |
---|
227 | strcpy(filename,SPECINT2000_PATH); strcat(filename,_filename); |
---|
228 | |
---|
229 | /* |
---|
230 | -O |
---|
231 | -fdefer-pop |
---|
232 | -fomit-frame-pointer |
---|
233 | -fcse-follow-jumps |
---|
234 | -fcse-skip-blocks |
---|
235 | -fexpensive-optimizations |
---|
236 | -fthread-jumps |
---|
237 | -fstrength-reduce |
---|
238 | -funroll-loops |
---|
239 | -fwritable-strings |
---|
240 | -fpeephole |
---|
241 | -fforce-mem |
---|
242 | -ffunction-cse |
---|
243 | -finline-functions |
---|
244 | -finline |
---|
245 | -freg-struct-return |
---|
246 | -fdelayed-branch |
---|
247 | -frerun-cse-after-loop |
---|
248 | -fschedule-insns |
---|
249 | -fschedule-insns2 |
---|
250 | -fcommon |
---|
251 | -fgnu-linker |
---|
252 | -m88110 |
---|
253 | -m88100 |
---|
254 | -m88000 |
---|
255 | -mno-ocs-debug-info |
---|
256 | -mno-ocs-frame-position |
---|
257 | -mcheck-zero-division |
---|
258 | */ |
---|
259 | |
---|
260 | char * option [nb_option_176_gcc] = |
---|
261 | { |
---|
262 | "-o" , "cccp.s" |
---|
263 | }; |
---|
264 | |
---|
265 | // Create the arguments |
---|
266 | if (argc < 2) |
---|
267 | { |
---|
268 | printf("Usage : gcc filename [Options ...]\n"); |
---|
269 | return; |
---|
270 | } |
---|
271 | |
---|
272 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
273 | |
---|
274 | argv[0] = (char *) malloc (strlen(execname )); |
---|
275 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
276 | argv[1] = (char *) malloc (strlen(filename )); |
---|
277 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
278 | |
---|
279 | { |
---|
280 | unsigned int i; |
---|
281 | |
---|
282 | for (i = 0; i < nb_option_176_gcc; i ++) |
---|
283 | { |
---|
284 | argv[2+i] = (char *) malloc (strlen(option[i] )); |
---|
285 | argv[2+i] = memcpy(argv[2+i],option[i] ,strlen(option[i] )); |
---|
286 | }// end i |
---|
287 | } |
---|
288 | |
---|
289 | // +-------------------+ |
---|
290 | // | Run the benchmark | |
---|
291 | // +-------------------+ |
---|
292 | main_176_gcc (argc,argv); |
---|
293 | |
---|
294 | free(filename); |
---|
295 | |
---|
296 | printf("***** 176.gcc - End *****\n"); |
---|
297 | } |
---|
298 | |
---|
299 | //======================================================================================= |
---|
300 | // [ run_181_mcf ] |
---|
301 | //======================================================================================= |
---|
302 | void run_181_mcf () |
---|
303 | { |
---|
304 | printf("***** 181.mcf - Begin *****\n"); |
---|
305 | |
---|
306 | int argc = 2; |
---|
307 | char ** argv; |
---|
308 | |
---|
309 | char * execname = "./mcf"; |
---|
310 | char *_filename = "/181.mcf/data/test/input/inp.in"; |
---|
311 | char * filename = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_filename)); |
---|
312 | strcpy(filename,SPECINT2000_PATH); strcat(filename,_filename); |
---|
313 | |
---|
314 | // Create the arguments |
---|
315 | if (argc != 2) |
---|
316 | { |
---|
317 | printf("Usage : mcf filename\n"); |
---|
318 | return; |
---|
319 | } |
---|
320 | |
---|
321 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
322 | |
---|
323 | argv[0] = (char *) malloc (strlen(execname )); |
---|
324 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
325 | |
---|
326 | argv[1] = (char *) malloc (strlen(filename )); |
---|
327 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
328 | |
---|
329 | // +-------------------+ |
---|
330 | // | Run the benchmark | |
---|
331 | // +-------------------+ |
---|
332 | main_181_mcf (argc,argv); |
---|
333 | |
---|
334 | free(filename); |
---|
335 | |
---|
336 | printf("***** 181.mcf - End *****\n"); |
---|
337 | } |
---|
338 | |
---|
339 | //======================================================================================= |
---|
340 | // [ run_255_vortex ] |
---|
341 | //======================================================================================= |
---|
342 | void run_255_vortex () |
---|
343 | { |
---|
344 | printf("***** 255.vortex - Begin *****\n"); |
---|
345 | |
---|
346 | int argc = 2; |
---|
347 | char ** argv; |
---|
348 | |
---|
349 | char * execname = "./vortex"; |
---|
350 | char *_filename = "/255.vortex/data/test/input/bendian.raw"; |
---|
351 | char * filename = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_filename)); |
---|
352 | strcpy(filename,SPECINT2000_PATH); strcat(filename,_filename); |
---|
353 | |
---|
354 | // Create the arguments |
---|
355 | if (argc != 2) |
---|
356 | { |
---|
357 | printf("Usage : vortex filename\n"); |
---|
358 | return; |
---|
359 | } |
---|
360 | |
---|
361 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
362 | |
---|
363 | argv[0] = (char *) malloc (strlen(execname )); |
---|
364 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
365 | argv[1] = (char *) malloc (strlen(filename )); |
---|
366 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
367 | |
---|
368 | // +-------------------+ |
---|
369 | // | Run the benchmark | |
---|
370 | // +-------------------+ |
---|
371 | main_255_vortex (argc,argv); |
---|
372 | |
---|
373 | free(filename); |
---|
374 | |
---|
375 | printf("***** 255.vortex - End *****\n"); |
---|
376 | } |
---|
377 | |
---|
378 | //======================================================================================= |
---|
379 | // [ run_256_bzip2 ] |
---|
380 | //======================================================================================= |
---|
381 | void run_256_bzip2 () |
---|
382 | { |
---|
383 | printf("***** 256.bzip2 - Begin *****\n"); |
---|
384 | |
---|
385 | int argc = 4; |
---|
386 | char ** argv; |
---|
387 | |
---|
388 | char * execname = "./bzip2"; |
---|
389 | char *_filename = "/256.bzip2/data/test/input/input.random"; |
---|
390 | char * filename = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_filename)); |
---|
391 | strcpy(filename,SPECINT2000_PATH); strcat(filename,_filename); |
---|
392 | char * input_size = "1"; |
---|
393 | char * compressed_size = "1"; |
---|
394 | |
---|
395 | // Create the arguments |
---|
396 | if ((argc < 1) || (argc > 4) ) |
---|
397 | { |
---|
398 | printf("Usage : bzip2 [filename] [intput_size] [compressed_size]\n"); |
---|
399 | return; |
---|
400 | } |
---|
401 | |
---|
402 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
403 | argv[0] = (char *) malloc (strlen(execname )); |
---|
404 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
405 | |
---|
406 | if (argc > 1) |
---|
407 | { |
---|
408 | argv[1] = (char *) malloc (strlen(filename )); |
---|
409 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
410 | } |
---|
411 | |
---|
412 | if (argc > 2) |
---|
413 | { |
---|
414 | argv[2] = (char *) malloc (strlen(input_size )); |
---|
415 | argv[2] = memcpy(argv[2],input_size ,strlen(input_size )); |
---|
416 | } |
---|
417 | |
---|
418 | if (argc > 3) |
---|
419 | { |
---|
420 | argv[3] = (char *) malloc (strlen(compressed_size)); |
---|
421 | argv[3] = memcpy(argv[3],compressed_size ,strlen(compressed_size)); |
---|
422 | } |
---|
423 | |
---|
424 | // +-------------------+ |
---|
425 | // | Run the benchmark | |
---|
426 | // +-------------------+ |
---|
427 | main_256_bzip2 (argc,argv); |
---|
428 | |
---|
429 | free(filename); |
---|
430 | |
---|
431 | printf("***** 256.bzip2 - End *****\n"); |
---|
432 | } |
---|
433 | |
---|
434 | //======================================================================================= |
---|
435 | // [ run_300_twolf ] |
---|
436 | //======================================================================================= |
---|
437 | void run_300_twolf () |
---|
438 | { |
---|
439 | printf("***** 300.twolf - Begin *****\n"); |
---|
440 | |
---|
441 | int argc = 2; |
---|
442 | char ** argv; |
---|
443 | |
---|
444 | char * execname = "./twolf"; |
---|
445 | char *_circuitName = "/300.twolf/data/test/input/test"; |
---|
446 | char * circuitName = (char *) malloc(strlen(SPECINT2000_PATH)+strlen(_circuitName)); |
---|
447 | strcpy(circuitName,SPECINT2000_PATH); strcat(circuitName,_circuitName); |
---|
448 | |
---|
449 | // Create the arguments |
---|
450 | if ((argc < 1) || (argc > 2) ) |
---|
451 | { |
---|
452 | printf("Usage : twolf circuitName\n"); |
---|
453 | return; |
---|
454 | } |
---|
455 | |
---|
456 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
457 | argv[0] = (char *) malloc (strlen(execname )); |
---|
458 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
459 | |
---|
460 | argv[1] = (char *) malloc (strlen(circuitName )); |
---|
461 | argv[1] = memcpy(argv[1],circuitName ,strlen(circuitName )); |
---|
462 | |
---|
463 | // +-------------------+ |
---|
464 | // | Run the benchmark | |
---|
465 | // +-------------------+ |
---|
466 | main_300_twolf (2,argv); |
---|
467 | |
---|
468 | free(circuitName); |
---|
469 | |
---|
470 | printf("***** 300.twolf - End *****\n"); |
---|
471 | } |
---|
472 | |
---|
473 | /* |
---|
474 | //======================================================================================= |
---|
475 | // [ run_dhry21 ] |
---|
476 | //======================================================================================= |
---|
477 | void run_dhry21 () |
---|
478 | { |
---|
479 | printf("***** dhry2.1 - Begin *****\n"); |
---|
480 | |
---|
481 | int argc = 2; |
---|
482 | char ** argv; |
---|
483 | |
---|
484 | char * execname = "./dhry21"; |
---|
485 | char * numberOfRuns = "2000"; |
---|
486 | |
---|
487 | // Create the arguments |
---|
488 | if (argc != 2) |
---|
489 | { |
---|
490 | printf("Usage : dhry21 numberOfRuns\n"); |
---|
491 | return; |
---|
492 | } |
---|
493 | |
---|
494 | argv = (char **)malloc (argc * sizeof(char *)); |
---|
495 | |
---|
496 | argv[0] = (char *) malloc (strlen(execname )); |
---|
497 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
498 | argv[1] = (char *) malloc (strlen(numberOfRuns )); |
---|
499 | argv[1] = memcpy(argv[1],numberOfRuns ,strlen(numberOfRuns )); |
---|
500 | |
---|
501 | // Run the benchmark |
---|
502 | main_dhry21 (argc,argv); |
---|
503 | |
---|
504 | printf("***** dhry2.1 - End *****\n"); |
---|
505 | } |
---|
506 | */ |
---|