@@ -64,9 +64,9 @@ function exit_program() {
64
64
if [ -f ${NEW_RUN_DIR} /test_failures.log ]; then
65
65
FAIL_COUNT=$( wc -l ${NEW_RUN_DIR} /test_failures.log | cut -d ' ' -f 1)
66
66
fi
67
-
67
+
68
68
FAILURE=$(( ${FAIL_COUNT} ))
69
-
69
+
70
70
if [ " _${FAILURE} " != " _0" ]
71
71
then
72
72
echo " Failed ${FAILURE} benchmarks"
@@ -107,7 +107,7 @@ _prt_cur_arg() {
107
107
function help() {
108
108
109
109
printf " Called program with $INPUT
110
- Usage:
110
+ Usage:
111
111
${THIS_SCRIPT_EXEC} [ OPTIONS / FLAGS ]
112
112
113
113
@@ -209,7 +209,7 @@ function cleanup_temp() {
209
209
fi
210
210
211
211
for runs in ${OUTPUT_DIRECTORY} /run*
212
- do
212
+ do
213
213
rm -Rf ${runs}
214
214
done
215
215
@@ -267,14 +267,14 @@ function mv_failed() {
267
267
# Helper Functions
268
268
function flag_is_number() {
269
269
case " _$2 " in
270
- _)
270
+ _)
271
271
echo " Passed an empty value for $1 "
272
272
help
273
273
exit 120
274
274
;;
275
275
* )
276
276
case $2 in
277
- ' ' |* [!0-9]* )
277
+ ' ' |* [!0-9]* )
278
278
echo " Passed a non number value [$2 ] for $1 "
279
279
help
280
280
exit 120
@@ -312,7 +312,7 @@ function _set_flag() {
312
312
_batch_sim_flag=$( _set_if ${_BATCH_SIM} " --batch" )
313
313
_use_best_coverage_flag=$( _set_if ${_BEST_COVERAGE_OFF} " --best_coverage" )
314
314
_perf_flag=$( _set_if ${_USE_PERF} " --tool perf" )
315
-
315
+
316
316
_vector_flag=" -g ${_VECTORS} "
317
317
_timeout_flag=" --time_limit ${_TIMEOUT} s"
318
318
_simulation_threads_flag=$( [ " ${_SIM_THREADS} " != " 1" ] && echo " -j ${_SIM_THREADS} " )
@@ -323,20 +323,20 @@ function _set_flag() {
323
323
324
324
function parse_args() {
325
325
while [[ " $# " > 0 ]]
326
- do
327
- case $1 in
326
+ do
327
+ case $1 in
328
328
329
329
# Help Desk
330
330
-h|--help)
331
331
echo " Printing Help information"
332
332
help
333
333
exit_program
334
-
334
+
335
335
# # directory in benchmark
336
336
;;-t|--test)
337
337
# this is handled down stream
338
338
if [ " _$2 " == " _" ]
339
- then
339
+ then
340
340
echo " empty argument for $1 "
341
341
exit 120
342
342
fi
@@ -349,11 +349,11 @@ function parse_args() {
349
349
;;-a|--adder_def)
350
350
351
351
if [ " _$2 " == " _" ]
352
- then
352
+ then
353
353
echo " empty argument for $1 "
354
354
exit 120
355
355
fi
356
-
356
+
357
357
_ADDER_DEF=$2
358
358
359
359
if [ " ${_ADDER_DEF} " != " default" ] && [ " ${_ADDER_DEF} " != " optimized" ] && [ ! -f " $( readlink -f ${_ADDER_DEF} ) " ]
@@ -367,11 +367,11 @@ function parse_args() {
367
367
;;-d|--output_dir)
368
368
369
369
if [ " _$2 " == " _" ]
370
- then
370
+ then
371
371
echo " empty argument for $1 "
372
372
exit 120
373
373
fi
374
-
374
+
375
375
_RUN_DIR_OVERRIDE=$2
376
376
377
377
if [ ! -d " ${_RUN_DIR_OVERRIDE} " ]
@@ -409,45 +409,45 @@ function parse_args() {
409
409
shift
410
410
411
411
# Boolean flags
412
- ;;-g|--generate_bench)
412
+ ;;-g|--generate_bench)
413
413
_GENERATE_BENCH=" on"
414
414
echo " generating output vector for test given predefined input"
415
415
416
- ;;-o|--generate_output)
416
+ ;;-o|--generate_output)
417
417
_GENERATE_OUTPUT=" on"
418
418
echo " generating input and output vector for test"
419
419
420
- ;;-c|--clean)
420
+ ;;-c|--clean)
421
421
echo " Cleaning temporary run in directory"
422
422
cleanup_temp
423
423
424
- ;;-l|--limit_ressource)
424
+ ;;-l|--limit_ressource)
425
425
_LIMIT_RESSOURCE=" on"
426
426
echo " limiting ressources for benchmark, this can help with small hardware"
427
427
428
- ;;-v|--valgrind)
428
+ ;;-v|--valgrind)
429
429
_VALGRIND=" on"
430
430
echo " Using Valgrind for benchmarks"
431
431
432
- ;;-B|--best_coverage_off)
432
+ ;;-B|--best_coverage_off)
433
433
_BEST_COVERAGE_OFF=" off"
434
434
echo " turning off using best coverage for benchmark vector generation"
435
435
436
- ;;-b|--batch_sim)
436
+ ;;-b|--batch_sim)
437
437
_BATCH_SIM=" on"
438
438
echo " Using Batch multithreaded simulation with -j threads"
439
439
440
440
;;-p|--perf)
441
441
_USE_PERF=" on"
442
442
echo " Using perf for synthesis and simulation"
443
-
444
- ;;-f|--force_simulate)
443
+
444
+ ;;-f|--force_simulate)
445
445
_FORCE_SIM=" on"
446
- echo " Forcing Simulation"
446
+ echo " Forcing Simulation"
447
447
448
- ;;* )
448
+ ;;* )
449
449
echo " Unknown parameter passed: $1 "
450
- help
450
+ help
451
451
ctrl_c
452
452
esac
453
453
shift
@@ -477,9 +477,9 @@ function sim() {
477
477
shift
478
478
479
479
while [[ " $# " > 0 ]]
480
- do
480
+ do
481
481
case $1 in
482
- --custom_args_file)
482
+ --custom_args_file)
483
483
with_custom_args=1
484
484
;;
485
485
@@ -517,7 +517,7 @@ function sim() {
517
517
518
518
* )
519
519
echo " Unknown internal parameter passed: $1 "
520
- config_help
520
+ config_help
521
521
ctrl_c
522
522
;;
523
523
esac
@@ -553,15 +553,15 @@ function sim() {
553
553
${_timeout_flag}
554
554
${_low_ressource_flag}
555
555
${_valgrind_flag} "
556
-
556
+
557
557
if [ " ${_USE_PERF} " == " on" ]
558
558
then
559
559
wrapper_odin_command=" ${wrapper_odin_command} ${_perf_flag} ${DIR} /perf.data"
560
560
fi
561
561
562
562
odin_command=" ${DEFAULT_CMD_PARAM}
563
- $( cat ${dir} /odin.args | tr ' \n' ' ' )
564
- -o ${blif_file}
563
+ $( cat ${dir} /odin.args | tr ' \n' ' ' )
564
+ -o ${blif_file}
565
565
-sim_dir ${DIR} "
566
566
567
567
echo $( echo " ${wrapper_odin_command} ${odin_command} " | tr ' \n' ' ' | tr -s ' ' ) > ${DIR} /odin_param
@@ -607,13 +607,6 @@ function sim() {
607
607
608
608
for arches in ${arch_list}
609
609
do
610
-
611
- arch_cmd=" "
612
- if [ -e ${arches} ]
613
- then
614
- arch_cmd=" -a ${arches} "
615
- fi
616
-
617
610
arch_basename=${arches% .xml}
618
611
arch_name=${arch_basename##*/ }
619
612
@@ -622,6 +615,14 @@ function sim() {
622
615
DIR=" ${NEW_RUN_DIR} /${TEST_FULL_REF} "
623
616
blif_file=" ${DIR} /odin.blif"
624
617
618
+ arch_cmd=" "
619
+ if [ -e ${arches} ]
620
+ then
621
+ tiles_cmd=" ../vtr_flow/scripts/add_tiles.py"
622
+ arch_file=" ${arch_name} .xml"
623
+ ${tiles_cmd} --arch_xml ${arches} > ${DIR} /${arch_name} .xml
624
+ arch_cmd=" -a ${DIR} /${arch_name} .xml"
625
+ fi
625
626
626
627
# build commands
627
628
mkdir -p $DIR
@@ -643,6 +644,7 @@ function sim() {
643
644
wrapper_synthesis_command=" ${wrapper_synthesis_command} ${_perf_flag} ${DIR} /perf.data"
644
645
fi
645
646
647
+
646
648
synthesis_command=" ${DEFAULT_CMD_PARAM}
647
649
${arch_cmd}
648
650
-V ${benchmark}
@@ -712,7 +714,7 @@ function sim() {
712
714
713
715
# run the simulation
714
716
find ${NEW_RUN_DIR} /${bench_type} / -name sim_param | xargs -n1 -P$threads -I sim_cmd ${SHELL} -c ' $(cat sim_cmd)'
715
-
717
+
716
718
# move the log
717
719
for sim_log in $( find ${NEW_RUN_DIR} /${bench_type} / -name " simulation.log" )
718
720
do
@@ -722,7 +724,7 @@ function sim() {
722
724
disable_failed ${global_simulation_failure}
723
725
724
726
done
725
-
727
+
726
728
mkdir -p ${NEW_RUN_DIR} /${bench_type} /vectors
727
729
728
730
# move the vectors
@@ -733,7 +735,7 @@ function sim() {
733
735
734
736
cp ${sim_input_vectors} ${NEW_RUN_DIR} /${bench_type} /vectors/${BM_NAME}
735
737
mv ${sim_input_vectors} ${BM_DIR} /${BM_NAME}
736
-
738
+
737
739
done
738
740
739
741
@@ -803,7 +805,7 @@ function debug_failures() {
803
805
804
806
echo " Which benchmark would you like to debug (type 'quit' or 'q' to exit)?"
805
807
echo " ============"
806
- echo " ${FAILURES_LIST} "
808
+ echo " ${FAILURES_LIST} "
807
809
echo " ============"
808
810
printf " enter a substring: "
809
811
@@ -813,7 +815,7 @@ function debug_failures() {
813
815
echo " exiting"
814
816
break
815
817
;;
816
- * )
818
+ * )
817
819
BM=" ${FAILED_RUN_DIR} /$( echo " ${FAILURES_LIST} " | grep ${INPUT_BM} | tail -n 1) "
818
820
819
821
if [ " _${BM} " != " _" ] && [ -f " ${BM} /${CMD_FILE_NAME} " ]
@@ -854,7 +856,7 @@ LIGHT_LIST=(
854
856
" operators"
855
857
" arch"
856
858
" other"
857
- " micro"
859
+ " micro"
858
860
" syntax"
859
861
" FIR"
860
862
)
@@ -934,8 +936,8 @@ case ${_TEST} in
934
936
935
937
full_suite)
936
938
run_all
937
- ;;
938
-
939
+ ;;
940
+
939
941
heavy_suite)
940
942
run_heavy_suite
941
943
;;
0 commit comments