Skip to content

Commit fdedeb4

Browse files
committed
[Infra]: - improving run_yosys.sh help function
- removing yosys blif generating process from verify_odin Signed-off-by: Seyed Alireza Damghani <[email protected]>
1 parent e0cdad7 commit fdedeb4

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

ODIN_II/run_yosys.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ THIS_DIR=$(dirname "${THIS_SCRIPT_PATH}")
77
VTR_DIR=$(readlink -f "${THIS_DIR}/..")
88
ODIN_DIR="${VTR_DIR}/ODIN_II"
99
REGRESSION_DIR="${THIS_DIR}/regression_test"
10+
REG_LIB="${REGRESSION_DIR}/.library"
1011

1112
##############################################
1213
# grab the input args
@@ -15,17 +16,20 @@ INPUT="$*"
1516
# disable stdin
1617
exec 0<&-
1718

19+
source "${REG_LIB}/handle_exit.sh"
20+
source "${REG_LIB}/helper.sh"
21+
1822
BENCHMARK_DIR="${REGRESSION_DIR}/benchmark"
1923

2024
VTR_REG_DIR="${VTR_DIR}/vtr_flow/tasks/regression_tests"
2125

22-
SUITE_DIR="${BENCHMARK_DIR}/suite"
26+
SUITE_DIR="${BENCHMARK_DIR}/suite/"
27+
BLIF_SUITE_DIR="${SUITE_DIR}/_BLIF"
28+
RELAPATH_BLIF_SUITE_DIR=$(realapath_from "${BLIF_SUITE_DIR}" "${PWD}")
2329

2430
TASK_DIR="${BENCHMARK_DIR}/task"
25-
BLIF_TASK_DIR="${BENCHMARK_DIR}/task/_BLIF"
26-
27-
RTL_REG_PREFIX="rtl_reg"
28-
31+
BLIF_TASK_DIR="${TASK_DIR}/_BLIF"
32+
RELAPATH_BLIF_TASK_DIR=$(realapath_from "${BLIF_TASK_DIR}" "${PWD}")
2933

3034

3135
# COLORS
@@ -123,24 +127,19 @@ function help() {
123127
124128
OPTIONS
125129
-h|--help $(_prt_cur_arg off) print this
130+
-s|--show_failure $(_prt_cur_arg off) show failures in yosys blif generating process
126131
-t|--test < test name > A path to a single test file
127132
-T|--task Test name is either a absolute or relative path to
128133
a directory containing a task.ycfg, task_list.conf
129134
130135
AVAILABLE_TASK:
131136
"
132137

133-
printf "\n\t\t%s\n" "${RELAPATH_SUITE_DIR}/"
134-
for bm in "${SUITE_DIR}"/*; do printf "\t\t\t%s\n" "$(basename "${bm}")"; done
135-
136-
printf "\n\t\t%s\n" "${RELAPATH_TASK_DIR}/"
137-
for bm in "${TASK_DIR}"/*; do printf "\t\t\t%s\n" "$(basename "${bm}")"; done
138-
139-
printf "\n\t\t%s\n" "${VTR_REG_PREFIX}"
140-
for bm in "${VTR_REG_DIR}/${VTR_REG_PREFIX}"*; do printf "\t\t\t%s\n" "$(basename "${bm}" | sed "s+${VTR_REG_PREFIX}++g")"; done
141-
142-
printf "\n\t\t%s\n" "${RTL_REG_PREFIX}"
138+
printf "\n\t\t%s\n" "${RELAPATH_BLIF_SUITE_DIR}/"
139+
for bm in "${BLIF_SUITE_DIR}"/*; do printf "\t\t\t%s\n" "$(basename "${bm}")"; done
143140

141+
printf "\n\t\t%s\n" "${RELAPATH_BLIF_TASK_DIR}/"
142+
for bm in "${BLIF_TASK_DIR}"/*; do printf "\t\t\t%s\n" "$(basename "${bm}")"; done
144143
}
145144

146145
# to check whether failure path exist or not

run_reg_test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,23 @@ def run_odin_test(args, test_name):
277277
odin_reg_script[-1] += "suite/_BLIF/techmap_suite"
278278
elif test_name == "odin_reg_strong":
279279
odin_reg_script[-1] += "suite/heavy_suite"
280-
# to avoid showing yosys logs
281-
if not args.show_failures:
282-
odin_reg_script.append("--no_report")
283280
else:
284281
raise IOError("Test does not exist: {}".format(test_name))
285282

286283
odin_root = str(Path(odin_reg_script[0]).resolve().parent)
287284

285+
# generates yosys blif if needed
286+
if test_name == "odin_reg_techmap":
287+
yosys_reg_script = [
288+
str(paths.run_yosys_path),
289+
"-t",
290+
odin_reg_script[-1],
291+
"--generate_blif",
292+
# to avoid showing yosys logs
293+
"--show_failure" if args.show_failures else ""
294+
]
295+
subprocess.call(yosys_reg_script, cwd=odin_root)
296+
288297
result = subprocess.call(odin_reg_script, cwd=odin_root)
289298

290299
assert result is not None

0 commit comments

Comments
 (0)