Skip to content

Commit 7637657

Browse files
committed
ODIN II: regression script modifies arch.xml with tiles
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent bc50eee commit 7637657

File tree

1 file changed

+50
-48
lines changed

1 file changed

+50
-48
lines changed

ODIN_II/verify_odin.sh

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ function exit_program() {
6464
if [ -f ${NEW_RUN_DIR}/test_failures.log ]; then
6565
FAIL_COUNT=$(wc -l ${NEW_RUN_DIR}/test_failures.log | cut -d ' ' -f 1)
6666
fi
67-
67+
6868
FAILURE=$(( ${FAIL_COUNT} ))
69-
69+
7070
if [ "_${FAILURE}" != "_0" ]
7171
then
7272
echo "Failed ${FAILURE} benchmarks"
@@ -107,7 +107,7 @@ _prt_cur_arg() {
107107
function help() {
108108

109109
printf "Called program with $INPUT
110-
Usage:
110+
Usage:
111111
${THIS_SCRIPT_EXEC} [ OPTIONS / FLAGS ]
112112
113113
@@ -209,7 +209,7 @@ function cleanup_temp() {
209209
fi
210210

211211
for runs in ${OUTPUT_DIRECTORY}/run*
212-
do
212+
do
213213
rm -Rf ${runs}
214214
done
215215

@@ -267,14 +267,14 @@ function mv_failed() {
267267
# Helper Functions
268268
function flag_is_number() {
269269
case "_$2" in
270-
_)
270+
_)
271271
echo "Passed an empty value for $1"
272272
help
273273
exit 120
274274
;;
275275
*)
276276
case $2 in
277-
''|*[!0-9]*)
277+
''|*[!0-9]*)
278278
echo "Passed a non number value [$2] for $1"
279279
help
280280
exit 120
@@ -312,7 +312,7 @@ function _set_flag() {
312312
_batch_sim_flag=$(_set_if ${_BATCH_SIM} "--batch")
313313
_use_best_coverage_flag=$(_set_if ${_BEST_COVERAGE_OFF} "--best_coverage")
314314
_perf_flag=$(_set_if ${_USE_PERF} "--tool perf")
315-
315+
316316
_vector_flag="-g ${_VECTORS}"
317317
_timeout_flag="--time_limit ${_TIMEOUT}s"
318318
_simulation_threads_flag=$([ "${_SIM_THREADS}" != "1" ] && echo "-j ${_SIM_THREADS}")
@@ -323,20 +323,20 @@ function _set_flag() {
323323

324324
function parse_args() {
325325
while [[ "$#" > 0 ]]
326-
do
327-
case $1 in
326+
do
327+
case $1 in
328328

329329
# Help Desk
330330
-h|--help)
331331
echo "Printing Help information"
332332
help
333333
exit_program
334-
334+
335335
## directory in benchmark
336336
;;-t|--test)
337337
# this is handled down stream
338338
if [ "_$2" == "_" ]
339-
then
339+
then
340340
echo "empty argument for $1"
341341
exit 120
342342
fi
@@ -349,11 +349,11 @@ function parse_args() {
349349
;;-a|--adder_def)
350350

351351
if [ "_$2" == "_" ]
352-
then
352+
then
353353
echo "empty argument for $1"
354354
exit 120
355355
fi
356-
356+
357357
_ADDER_DEF=$2
358358

359359
if [ "${_ADDER_DEF}" != "default" ] && [ "${_ADDER_DEF}" != "optimized" ] && [ ! -f "$(readlink -f ${_ADDER_DEF})" ]
@@ -367,11 +367,11 @@ function parse_args() {
367367
;;-d|--output_dir)
368368

369369
if [ "_$2" == "_" ]
370-
then
370+
then
371371
echo "empty argument for $1"
372372
exit 120
373373
fi
374-
374+
375375
_RUN_DIR_OVERRIDE=$2
376376

377377
if [ ! -d "${_RUN_DIR_OVERRIDE}" ]
@@ -409,45 +409,45 @@ function parse_args() {
409409
shift
410410

411411
# Boolean flags
412-
;;-g|--generate_bench)
412+
;;-g|--generate_bench)
413413
_GENERATE_BENCH="on"
414414
echo "generating output vector for test given predefined input"
415415

416-
;;-o|--generate_output)
416+
;;-o|--generate_output)
417417
_GENERATE_OUTPUT="on"
418418
echo "generating input and output vector for test"
419419

420-
;;-c|--clean)
420+
;;-c|--clean)
421421
echo "Cleaning temporary run in directory"
422422
cleanup_temp
423423

424-
;;-l|--limit_ressource)
424+
;;-l|--limit_ressource)
425425
_LIMIT_RESSOURCE="on"
426426
echo "limiting ressources for benchmark, this can help with small hardware"
427427

428-
;;-v|--valgrind)
428+
;;-v|--valgrind)
429429
_VALGRIND="on"
430430
echo "Using Valgrind for benchmarks"
431431

432-
;;-B|--best_coverage_off)
432+
;;-B|--best_coverage_off)
433433
_BEST_COVERAGE_OFF="off"
434434
echo "turning off using best coverage for benchmark vector generation"
435435

436-
;;-b|--batch_sim)
436+
;;-b|--batch_sim)
437437
_BATCH_SIM="on"
438438
echo "Using Batch multithreaded simulation with -j threads"
439439

440440
;;-p|--perf)
441441
_USE_PERF="on"
442442
echo "Using perf for synthesis and simulation"
443-
444-
;;-f|--force_simulate)
443+
444+
;;-f|--force_simulate)
445445
_FORCE_SIM="on"
446-
echo "Forcing Simulation"
446+
echo "Forcing Simulation"
447447

448-
;;*)
448+
;;*)
449449
echo "Unknown parameter passed: $1"
450-
help
450+
help
451451
ctrl_c
452452
esac
453453
shift
@@ -477,9 +477,9 @@ function sim() {
477477
shift
478478

479479
while [[ "$#" > 0 ]]
480-
do
480+
do
481481
case $1 in
482-
--custom_args_file)
482+
--custom_args_file)
483483
with_custom_args=1
484484
;;
485485

@@ -517,7 +517,7 @@ function sim() {
517517

518518
*)
519519
echo "Unknown internal parameter passed: $1"
520-
config_help
520+
config_help
521521
ctrl_c
522522
;;
523523
esac
@@ -553,15 +553,15 @@ function sim() {
553553
${_timeout_flag}
554554
${_low_ressource_flag}
555555
${_valgrind_flag}"
556-
556+
557557
if [ "${_USE_PERF}" == "on" ]
558558
then
559559
wrapper_odin_command="${wrapper_odin_command} ${_perf_flag} ${DIR}/perf.data"
560560
fi
561561

562562
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}
565565
-sim_dir ${DIR}"
566566

567567
echo $(echo "${wrapper_odin_command} ${odin_command}" | tr '\n' ' ' | tr -s ' ' ) > ${DIR}/odin_param
@@ -607,13 +607,6 @@ function sim() {
607607

608608
for arches in ${arch_list}
609609
do
610-
611-
arch_cmd=""
612-
if [ -e ${arches} ]
613-
then
614-
arch_cmd="-a ${arches}"
615-
fi
616-
617610
arch_basename=${arches%.xml}
618611
arch_name=${arch_basename##*/}
619612

@@ -622,6 +615,14 @@ function sim() {
622615
DIR="${NEW_RUN_DIR}/${TEST_FULL_REF}"
623616
blif_file="${DIR}/odin.blif"
624617

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
625626

626627
#build commands
627628
mkdir -p $DIR
@@ -643,6 +644,7 @@ function sim() {
643644
wrapper_synthesis_command="${wrapper_synthesis_command} ${_perf_flag} ${DIR}/perf.data"
644645
fi
645646

647+
646648
synthesis_command="${DEFAULT_CMD_PARAM}
647649
${arch_cmd}
648650
-V ${benchmark}
@@ -712,7 +714,7 @@ function sim() {
712714

713715
#run the simulation
714716
find ${NEW_RUN_DIR}/${bench_type}/ -name sim_param | xargs -n1 -P$threads -I sim_cmd ${SHELL} -c '$(cat sim_cmd)'
715-
717+
716718
# move the log
717719
for sim_log in $(find ${NEW_RUN_DIR}/${bench_type}/ -name "simulation.log")
718720
do
@@ -722,7 +724,7 @@ function sim() {
722724
disable_failed ${global_simulation_failure}
723725

724726
done
725-
727+
726728
mkdir -p ${NEW_RUN_DIR}/${bench_type}/vectors
727729

728730
# move the vectors
@@ -733,7 +735,7 @@ function sim() {
733735

734736
cp ${sim_input_vectors} ${NEW_RUN_DIR}/${bench_type}/vectors/${BM_NAME}
735737
mv ${sim_input_vectors} ${BM_DIR}/${BM_NAME}
736-
738+
737739
done
738740

739741

@@ -803,7 +805,7 @@ function debug_failures() {
803805

804806
echo "Which benchmark would you like to debug (type 'quit' or 'q' to exit)?"
805807
echo "============"
806-
echo "${FAILURES_LIST}"
808+
echo "${FAILURES_LIST}"
807809
echo "============"
808810
printf "enter a substring: "
809811

@@ -813,7 +815,7 @@ function debug_failures() {
813815
echo "exiting"
814816
break
815817
;;
816-
*)
818+
*)
817819
BM="${FAILED_RUN_DIR}/$(echo "${FAILURES_LIST}" | grep ${INPUT_BM} | tail -n 1)"
818820

819821
if [ "_${BM}" != "_" ] && [ -f "${BM}/${CMD_FILE_NAME}" ]
@@ -854,7 +856,7 @@ LIGHT_LIST=(
854856
"operators"
855857
"arch"
856858
"other"
857-
"micro"
859+
"micro"
858860
"syntax"
859861
"FIR"
860862
)
@@ -934,8 +936,8 @@ case ${_TEST} in
934936

935937
full_suite)
936938
run_all
937-
;;
938-
939+
;;
940+
939941
heavy_suite)
940942
run_heavy_suite
941943
;;

0 commit comments

Comments
 (0)