Skip to content

Commit 635a591

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

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

ODIN_II/verify_odin.sh

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ QUIT=0
88
INPUT=$@
99

1010
BASE_DIR="regression_test/benchmark"
11-
TEST_DIR_LIST=$(find regression_test/benchmark -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3 | tr '\n' ' ')
11+
TEST_DIR_LIST=$(find regression_test/benchmark -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3 | tr '\n' ' ')
1212

1313
#include more generic names here for better vector generation
1414
HOLD_LOW_RESET="-L reset rst"
@@ -58,7 +58,7 @@ function help() {
5858
printf "
5959
Called program with $INPUT
6060
61-
Usage: ./verify_odin
61+
Usage: ./verify_odin
6262
--test [test name] * test name is one of ( ${TEST_DIR_LIST}full_suite vtr_basic vtr_strong pre_commit )
6363
--generate_bench * generate input and output vector for test
6464
--generate_output * generate output vector for test given its input vector
@@ -112,13 +112,13 @@ function init_temp() {
112112
new_run=regression_test/${RUN_NAME}
113113
echo "running benchmark @${new_run}"
114114
mkdir -p ${new_run}
115-
unlink regression_test/latest
115+
unlink regression_test/latest
116116
ln -s ${RUN_NAME} regression_test/latest
117117
}
118118

119119
function cleanup_temp() {
120120
for runs in regression_test/run*
121-
do
121+
do
122122
rm -Rf ${runs}
123123
unlink regression_test/latest || /bin/true
124124
done
@@ -187,9 +187,9 @@ function sim() {
187187
shift
188188

189189
while [[ "$#" > 0 ]]
190-
do
190+
do
191191
case $1 in
192-
--custom_args_file)
192+
--custom_args_file)
193193
with_custom_args=1
194194
;;
195195

@@ -227,7 +227,7 @@ function sim() {
227227

228228
*)
229229
echo "Unknown internal parameter passed: $1"
230-
config_help
230+
config_help
231231
ctrl_c
232232
;;
233233
esac
@@ -264,8 +264,8 @@ function sim() {
264264
${RUN_WITH_VALGRIND}"
265265

266266
odin_command="${DEFAULT_CMD_PARAM}
267-
$(cat ${dir}/odin.args | tr '\n' ' ')
268-
-o ${blif_file}
267+
$(cat ${dir}/odin.args | tr '\n' ' ')
268+
-o ${blif_file}
269269
-sim_dir ${DIR}"
270270

271271
echo $(echo "${wrapper_odin_command} ${odin_command}" | tr '\n' ' ' | tr -s ' ' ) > ${DIR}/odin_param
@@ -294,25 +294,27 @@ function sim() {
294294

295295
for arches in ${arch_list}
296296
do
297-
298-
arch_cmd=""
299-
if [ -e ${arches} ]
300-
then
301-
arch_cmd="-a ${arches}"
302-
fi
303-
304297
arch_basename=${arches%.xml}
305298
arch_name=${arch_basename##*/}
306299

307300
TEST_FULL_REF="${bench_type}/${test_name}/${arch_name}"
308-
309301
DIR="${new_run}/${TEST_FULL_REF}"
302+
310303
blif_file="${DIR}/odin.blif"
311304

312305

313306
#build commands
314307
mkdir -p $DIR
315308

309+
arch_cmd=""
310+
if [ -e ${arches} ]
311+
then
312+
tiles_cmd="../vtr_flow/scripts/add_tiles.py"
313+
arch_file="${arch_name}.xml"
314+
${tiles_cmd} --arch_xml ${arches} > ${DIR}/${arch_name}.xml
315+
arch_cmd="-a ${DIR}/${arch_name}.xml"
316+
fi
317+
316318
wrapper_synthesis_command="./wrapper_odin.sh
317319
--log_file ${DIR}/synthesis.log
318320
--test_name ${TEST_FULL_REF}
@@ -357,7 +359,7 @@ function sim() {
357359
if [ "_$REGENERATE_OUTPUT" != "_1" ] && [ -e ${output_vector_file} ]; then
358360
simulation_command="${simulation_command} -T ${output_vector_file}"
359361
fi
360-
362+
361363
else
362364
simulation_command="${simulation_command} ${GENERATE_VECTOR_COUNT}"
363365

@@ -382,20 +384,20 @@ function sim() {
382384
fi
383385

384386
fi
385-
387+
386388

387389
}
388390

389391
function parse_args() {
390392
while [[ "$#" > 0 ]]
391-
do
393+
do
392394
case $1 in
393395
-h|--help)
394396
help
395397
exit_program
396398
;;
397399

398-
--generate_output)
400+
--generate_output)
399401
if [ $REGENERATE_BENCH != "0" ] || [ $REGENERATE_OUTPUT != "0" ]
400402
then
401403
echo "can only specify one of --generate_output or --generate_bench"
@@ -406,7 +408,7 @@ function parse_args() {
406408
echo "regenerating output vector for test given predefined input"
407409
;;
408410

409-
--generate_bench)
411+
--generate_bench)
410412
if [ $REGENERATE_BENCH != "0" ] || [ $REGENERATE_OUTPUT != "0" ]
411413
then
412414
echo "can only specify one of --generate_output or --generate_bench"
@@ -417,7 +419,7 @@ function parse_args() {
417419
echo "regenerating input and output vector for test"
418420
;;
419421

420-
--limit_ressource)
422+
--limit_ressource)
421423
USING_LOW_RESSOURCE="--limit_ressource"
422424
echo "limiting ressources for benchmark, this can help with small hardware"
423425
;;
@@ -457,13 +459,13 @@ function parse_args() {
457459
shift
458460
;;
459461

460-
*)
462+
*)
461463
echo "Unknown parameter passed: $1"
462-
help
464+
help
463465
ctrl_c
464466
;;
465-
esac
466-
shift
467+
esac
468+
shift
467469
done
468470
}
469471

0 commit comments

Comments
 (0)