@@ -62,12 +62,14 @@ _DRY_RUN="off"
62
62
_RANDOM_DRY_RUN=" off"
63
63
_GENERATE_BLIF=" off"
64
64
_REGENERATE_BLIF=" off"
65
+ _FORCE_GENERATE_BLIF=" off"
65
66
_REGENERATE_EXPECTATION=" off"
66
67
_GENERATE_EXPECTATION=" off"
67
68
_CONTINUE=" off"
68
69
_REPORT=" on"
69
70
_STATUS_ONLY=" off"
70
71
_RUN_YOSYS_ARGS=" "
72
+ _CLEAN_UP=" off"
71
73
72
74
# #############################################
73
75
# Exit Functions
@@ -197,21 +199,25 @@ function find_in_bench() {
197
199
# generate blif files of verilog files in benchmark/blif/_VERILOGS
198
200
function generate_blifs() {
199
201
200
- TASK=" $1 "
201
- if [ _${_GENERATE_BLIF} = " _on" ]; then
202
- echo " Generating missed BLIF files for benchmarks in ${REGRESSION_DIR} /benchmark/_VERILOG/${TASK_NAME} "
203
- else
204
- echo " Regenerating BLIF files for benchmarks in ${REGRESSION_DIR} /benchmark/_VERILOG/${TASK_NAME} "
205
- fi
202
+ BENCHMARK=" $1 "
203
+ BENCH_NAME=$( echo ${BENCHMARK} | sed ' s/.*\(_BLIF\)/\1/g' )
206
204
207
- RUN_YOSYS_SCRIPT_PARAMS=" ${_RUN_YOSYS_ARGS} "
208
- RUN_YOSYS_SCRIPT_PARAMS+= " -t ${TASK} "
205
+ if [ " _${_CLEAN_UP} " == " _on" ]; then
206
+ _RUN_YOSYS_ARGS+=" --clean "
207
+ fi
209
208
210
- if [ _${_REPORT} == " _on" ]; then
211
- RUN_YOSYS_SCRIPT_PARAMS+=" --show_failure"
209
+ if [ _${_GENERATE_BLIF} = " _on" ]; then
210
+ echo " Generating missed BLIF files for benchmarks in ${REGRESSION_DIR} /benchmark/_VERILOG/${BENCH_NAME} "
211
+ elif [ _${_REGENERATE_BLIF} = " _on" ]; then
212
+ _RUN_YOSYS_ARGS+=" --regenerate_blif "
213
+ echo " Regenerating BLIF files for benchmarks in ${REGRESSION_DIR} /benchmark/_VERILOG/${BENCH_NAME} "
212
214
fi
213
215
214
- ${THIS_DIR} /run_yosys.sh
216
+ RUN_YOSYS_SCRIPT_PARAMS=" -t ${BENCHMARK} "
217
+ RUN_YOSYS_SCRIPT_PARAMS+=" ${_RUN_YOSYS_ARGS} "
218
+
219
+ ${THIS_DIR} /run_yosys.sh ${RUN_YOSYS_SCRIPT_PARAMS}
220
+ _RUN_YOSYS_ARGS=" "
215
221
}
216
222
217
223
@@ -389,6 +395,7 @@ function parse_args() {
389
395
390
396
;;-c|--clean)
391
397
echo " Cleaning temporary run in directory"
398
+ _CLEAN_UP=" on"
392
399
cleanup_temp
393
400
394
401
;;-f|--force_simulate)
@@ -408,13 +415,12 @@ function parse_args() {
408
415
echo " random dry run"
409
416
410
417
;;--generate_blif)
411
- _REGENERATE_BLIF =" on"
418
+ _GENERATE_BLIF =" on"
412
419
_RUN_YOSYS_ARGS+=" "
413
420
echo " generating missed blifs of benchmark/_BLIF"
414
421
415
422
;;--regenerate_blif)
416
423
_REGENERATE_BLIF=" on"
417
- _RUN_YOSYS_ARGS+=" --regenerate_blif"
418
424
echo " regenerating blifs of benchmark/_BLIF"
419
425
420
426
;;--regenerate_expectation)
@@ -704,7 +710,12 @@ function populate_arg_from_file() {
704
710
do
705
711
if [ ! -f " ${circuit_list_item} " ]
706
712
then
707
- echo " file ${circuit_list_item} not found, skipping"
713
+ if [ " _${_local_techmap_params} " != " _" ]; then
714
+ echo " file ${circuit_list_item} not found, will be generating.."
715
+ _FORCE_GENERATE_BLIF=" on"
716
+ else
717
+ echo " file ${circuit_list_item} not found, skipping"
718
+ fi
708
719
else
709
720
_circuit_list+=( " ${circuit_list_item} " )
710
721
fi
@@ -892,6 +903,18 @@ function sim() {
892
903
esac
893
904
done
894
905
906
+ # ###################################
907
+ # generate yosys BLIFs if needed
908
+ if [ " _${_techmap} " == " _on" ]; then
909
+ # check if blif generting flags are active
910
+ if [ " _${_CLEAN_UP} " == " _on" ] || \
911
+ [ " _${_GENERATE_BLIF} " == " _on" ] || \
912
+ [ " _${_REGENERATE_BLIF} " == " _on" ] || \
913
+ [ " _${_FORCE_GENERATE_BLIF} " == " _on" ]; then
914
+ generate_blifs " ${benchmark_dir/ ${THIS_DIR} \/ } "
915
+ fi
916
+ fi
917
+
895
918
# #########################################
896
919
# setup defaults
897
920
@@ -1623,10 +1646,6 @@ function run_suite() {
1623
1646
1624
1647
for (( i = 0 ; i < ${# task_list[@]} ; i++ )) ;
1625
1648
do
1626
- if [ _${_REGENERATE_BLIF} == " _on" ] || [ _${_GENERATE_BLIF} == " _on" ]; then
1627
- generate_blifs " ${task_list[$i]} "
1628
-
1629
- fi
1630
1649
run_task " ${task_list[$i]} "
1631
1650
TEST_COUNT=$(( TEST_COUNT + 1 ))
1632
1651
done
0 commit comments