Commit cb227ee5 by Miodrag Milanovic

Unify statuses and FAIL test but not break

parent 9fe8fe2a
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -9,6 +9,12 @@ mkdir $1/work_$2 ...@@ -9,6 +9,12 @@ mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if [ "$1" = "synth_ecp5" ]; then if [ "$1" = "synth_ecp5" ]; then
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/ecp5/cells_sim.v iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/ecp5/cells_sim.v
elif [ "$1" = "synth_ecp5_wide_ffs" ]; then elif [ "$1" = "synth_ecp5_wide_ffs" ]; then
...@@ -58,14 +64,19 @@ elif [ "$1" = "synth_greenpak4_wide_ffs" ]; then ...@@ -58,14 +64,19 @@ elif [ "$1" = "synth_greenpak4_wide_ffs" ]; then
else else
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v
fi fi
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
grep 'ERROR' testbench.log grep 'ERROR' testbench.log
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
touch .stamp touch .stamp
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -9,16 +9,27 @@ mkdir $1/work_$2 ...@@ -9,16 +9,27 @@ mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
sed -i 's/reg =/dummy =/' ./synth.v sed -i 's/reg =/dummy =/' ./synth.v
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
grep 'ERROR' testbench.log grep 'ERROR' testbench.log
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
touch .stamp touch .stamp
#!/bin/bash #!/bin/bash
set -ex set -x
source $1/config source $1/config
mkdir $1/work_$2 mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
...@@ -36,18 +36,28 @@ for fn in $SIM; do ...@@ -36,18 +36,28 @@ for fn in $SIM; do
iverilog_cmd="$iverilog_cmd ../sim/$fn" iverilog_cmd="$iverilog_cmd ../sim/$fn"
done done
$iverilog_cmd $iverilog_cmd
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
vvp -N sim | pv -l > output.txt vvp -N sim | pv -l > output.txt
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if [ "$2" = "falsify" ]; then if [ "$2" = "falsify" ]; then
if cmp output.txt ../work_sim/output.txt; then if cmp output.txt ../work_sim/output.txt; then
echo FAIL > ../../${1}_${2}.status echo FAIL > ../../${1}_${2}.status
else else
echo pass > ../../${1}_${2}.status echo PASS > ../../${1}_${2}.status
fi fi
elif [ "$2" != "sim" ]; then elif [ "$2" != "sim" ]; then
if cmp output.txt ../work_sim/output.txt; then if cmp output.txt ../work_sim/output.txt; then
echo pass > ../../${1}_${2}.status echo PASS > ../../${1}_${2}.status
else else
echo FAIL > ../../${1}_${2}.status echo FAIL > ../../${1}_${2}.status
fi fi
......
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -9,16 +9,26 @@ mkdir $1/work_$2 ...@@ -9,16 +9,26 @@ mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
sed -i 's/reg =/dummy =/' ./synth.v sed -i 's/reg =/dummy =/' ./synth.v
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
grep 'ERROR' testbench.log grep 'ERROR' testbench.log
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
touch .stamp touch .stamp
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -9,16 +9,26 @@ mkdir $1/work_$2 ...@@ -9,16 +9,26 @@ mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
sed -i 's/reg =/dummy =/' ./synth.v sed -i 's/reg =/dummy =/' ./synth.v
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
grep 'ERROR' testbench.log grep 'ERROR' testbench.log
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
touch .stamp touch .stamp
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -9,11 +9,16 @@ mkdir $1/work_$2 ...@@ -9,11 +9,16 @@ mkdir $1/work_$2
cd $1/work_$2 cd $1/work_$2
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if grep 'Assert' result.log || grep 'failed in' result.log || grep 'fail' result.log || grep 'ERROR' result.log; then if grep 'Assert' result.log || grep 'failed in' result.log || grep 'fail' result.log || grep 'ERROR' result.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
touch .stamp touch .stamp
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
test -f scripts/$2.ys test -f scripts/$2.ys
...@@ -41,12 +41,12 @@ if [ "$1" = "issue_00089" ] ||\ ...@@ -41,12 +41,12 @@ if [ "$1" = "issue_00089" ] ||\
fi fi
if yosys -ql yosys.log ../../scripts/$2.ys; then if yosys -ql yosys.log ../../scripts/$2.ys; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
if grep "$expected_string" yosys.log; then if grep "$expected_string" yosys.log; then
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
else else
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
fi fi
fi fi
...@@ -120,17 +120,22 @@ elif [ "$1" = "issue_00502" ] ||\ ...@@ -120,17 +120,22 @@ elif [ "$1" = "issue_00502" ] ||\
fi fi
yosys -ql yosys.log ../../scripts/$2.ys; yosys -ql yosys.log ../../scripts/$2.ys;
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if grep "$expected_string" result.log; then if grep "$expected_string" result.log; then
if [ $expected = "1" ]; then if [ $expected = "1" ]; then
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
else else
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
fi fi
else else
if [ $expected = "1" ]; then if [ $expected = "1" ]; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
fi fi
...@@ -155,14 +160,26 @@ else ...@@ -155,14 +160,26 @@ else
fi fi
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v $iverilog_adds iverilog -o testbench ../testbench.v synth.v ../../common.v ../../../../../techlibs/common/simcells.v ../../../../../techlibs/common/simlib.v $iverilog_adds
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
grep 'ERROR' testbench.log grep 'ERROR' testbench.log
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo fail > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
fi fi
......
#!/bin/bash #!/bin/bash
set -ex set -x
test -d $1 test -d $1
if [ "$2" != "verify" -a "$2" != "falsify" ]; then if [ "$2" != "verify" -a "$2" != "falsify" ]; then
...@@ -13,11 +13,31 @@ cd $1/work_$2 ...@@ -13,11 +13,31 @@ cd $1/work_$2
if [ "$2" = "verify" ]; then if [ "$2" = "verify" ]; then
iverilog -o testbench ../testbench.v ../../common.v ../top.v iverilog -o testbench ../testbench.v ../../common.v ../top.v
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
elif [ "$2" = "falsify" ]; then elif [ "$2" = "falsify" ]; then
iverilog -DBUG -o testbench ../testbench.v ../../common.v ../top.v iverilog -DBUG -o testbench ../testbench.v ../../common.v ../top.v
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
else else
yosys -ql yosys.log ../../scripts/$2.ys yosys -ql yosys.log ../../scripts/$2.ys
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
iverilog -o testbench ../testbench.v ../../common.v synth.v $(yosys-config --datdir/simcells.v) iverilog -o testbench ../testbench.v ../../common.v synth.v $(yosys-config --datdir/simcells.v)
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
fi fi
if [ "$2" = "falsify" ]; then if [ "$2" = "falsify" ]; then
...@@ -26,7 +46,7 @@ if [ "$2" = "falsify" ]; then ...@@ -26,7 +46,7 @@ if [ "$2" = "falsify" ]; then
elif ! grep 'ERROR' testbench.log || grep 'OKAY' testbench.log; then elif ! grep 'ERROR' testbench.log || grep 'OKAY' testbench.log; then
echo FAIL > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
else else
if ! vvp -N testbench > testbench.log 2>&1; then if ! vvp -N testbench > testbench.log 2>&1; then
...@@ -35,7 +55,7 @@ else ...@@ -35,7 +55,7 @@ else
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
echo FAIL > ${1}_${2}.status echo FAIL > ${1}_${2}.status
else else
echo pass > ${1}_${2}.status echo PASS > ${1}_${2}.status
fi fi
fi fi
......
#!/bin/bash #!/bin/bash
set -ex set -x
trap "echo FAIL > $1.status" ERR trap "echo FAIL > $1.status" ERR
yosys -p " yosys -p "
...@@ -19,6 +19,11 @@ yosys -p " ...@@ -19,6 +19,11 @@ yosys -p "
miter -equiv -flatten A B miter miter -equiv -flatten A B miter
sat -verify -prove trigger 0 miter sat -verify -prove trigger 0 miter
" "
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
echo PASS > $1.status echo PASS > $1.status
#!/bin/bash #!/bin/bash
set -ex set -x
test -f $1.sv test -f $1.sv
trap "echo FAIL > $1.status" ERR trap "echo FAIL > $1.status" ERR
...@@ -23,6 +23,11 @@ while read t; do ...@@ -23,6 +23,11 @@ while read t; do
echo "$1.sv" echo "$1.sv"
} > $1.$t.sby } > $1.$t.sby
sby -f $1.$t.sby sby -f $1.$t.sby
if [ $? != 0 ] ; then
echo FAIL > ${1}_${2}.status
touch .stamp
exit 0
fi
done < <( egrep '^module (pass|fail)_[0-9][0-9]' $1.sv | gawk '{ print $2; }'; ) done < <( egrep '^module (pass|fail)_[0-9][0-9]' $1.sv | gawk '{ print $2; }'; )
echo PASS > $1.status echo PASS > $1.status
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment