mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-09 17:31:59 +00:00
tests: report time per target, eliminate interleaving lines on stdout
This commit is contained in:
parent
d5053033e4
commit
7f030c986c
13 changed files with 14 additions and 19 deletions
2
Makefile
2
Makefile
|
@ -954,7 +954,7 @@ makefile-tests: $(MK_TEST_DIRS:%=makefile-tests/%)
|
||||||
+cd $(dir $*) && bash run-test.sh
|
+cd $(dir $*) && bash run-test.sh
|
||||||
# this one spawns submake on each
|
# this one spawns submake on each
|
||||||
makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
|
makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
|
||||||
$(MAKE) -C $* -f run-test.mk
|
stdbuf -oL -eL $(MAKE) -C $* -f run-test.mk
|
||||||
+@echo "...passed tests in $*"
|
+@echo "...passed tests in $*"
|
||||||
|
|
||||||
test: makefile-tests abcopt-tests seed-tests
|
test: makefile-tests abcopt-tests seed-tests
|
||||||
|
|
|
@ -43,7 +43,7 @@ for dbits in $dbits_list; do
|
||||||
{
|
{
|
||||||
echo "bram1_$id/ok:"
|
echo "bram1_$id/ok:"
|
||||||
echo " @cd bram1_$id && bash run.sh"
|
echo " @cd bram1_$id && bash run.sh"
|
||||||
echo " @echo -n '[$id]'"
|
echo " @echo '[$id]'"
|
||||||
echo " @touch \$@"
|
echo " @touch \$@"
|
||||||
} >> bram1.mk
|
} >> bram1.mk
|
||||||
all_list="$all_list bram1_$id/ok"
|
all_list="$all_list bram1_$id/ok"
|
||||||
|
|
|
@ -10,12 +10,12 @@ for arch in ../../techlibs/*; do
|
||||||
arch_name=$(basename -- $arch)
|
arch_name=$(basename -- $arch)
|
||||||
if [ "${defines[$arch_name]}" ]; then
|
if [ "${defines[$arch_name]}" ]; then
|
||||||
for def in ${defines[$arch_name]}; do
|
for def in ${defines[$arch_name]}; do
|
||||||
echo -n "Test $path -D$def ->"
|
echo "Test $path -D$def ->"
|
||||||
iverilog -t null -I$arch -D$def -DNO_ICE40_DEFAULT_ASSIGNMENTS $path
|
iverilog -t null -I$arch -D$def -DNO_ICE40_DEFAULT_ASSIGNMENTS $path
|
||||||
echo " ok"
|
echo " ok"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo -n "Test $path ->"
|
echo "Test $path ->"
|
||||||
iverilog -t null -I$arch -g2005-sv $path
|
iverilog -t null -I$arch -g2005-sv $path
|
||||||
echo " ok"
|
echo " ok"
|
||||||
fi
|
fi
|
||||||
|
@ -23,7 +23,7 @@ for arch in ../../techlibs/*; do
|
||||||
done
|
done
|
||||||
|
|
||||||
for path in "../../techlibs/common/simcells.v" "../../techlibs/common/simlib.v"; do
|
for path in "../../techlibs/common/simcells.v" "../../techlibs/common/simlib.v"; do
|
||||||
echo -n "Test $path ->"
|
echo "Test $path ->"
|
||||||
iverilog -t null $path
|
iverilog -t null $path
|
||||||
echo " ok"
|
echo " ok"
|
||||||
done
|
done
|
||||||
|
|
|
@ -29,10 +29,9 @@ python3 generate.py -c $count $seed
|
||||||
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
||||||
idx=$( printf "%05d" $i )
|
idx=$( printf "%05d" $i )
|
||||||
echo "temp/uut_${idx}.log: temp/uut_${idx}.ys temp/uut_${idx}.v"
|
echo "temp/uut_${idx}.log: temp/uut_${idx}.ys temp/uut_${idx}.v"
|
||||||
echo " @echo -n '[$i]'"
|
|
||||||
echo " @../../yosys -ql temp/uut_${idx}.out temp/uut_${idx}.ys"
|
echo " @../../yosys -ql temp/uut_${idx}.out temp/uut_${idx}.ys"
|
||||||
echo " @mv temp/uut_${idx}.out temp/uut_${idx}.log"
|
echo " @mv temp/uut_${idx}.out temp/uut_${idx}.log"
|
||||||
echo " @grep -q 'SAT proof finished' temp/uut_${idx}.log && echo -n K || echo -n T"
|
echo " @grep -q 'SAT proof finished' temp/uut_${idx}.log && echo K || echo T"
|
||||||
all_targets="$all_targets temp/uut_${idx}.log"
|
all_targets="$all_targets temp/uut_${idx}.log"
|
||||||
done
|
done
|
||||||
echo "$all_targets"
|
echo "$all_targets"
|
||||||
|
|
|
@ -9,8 +9,7 @@ generate_target() {
|
||||||
echo "all: $target_name"
|
echo "all: $target_name"
|
||||||
echo ".PHONY: $target_name"
|
echo ".PHONY: $target_name"
|
||||||
echo "$target_name:"
|
echo "$target_name:"
|
||||||
printf "\t@%s\n" "$test_command"
|
printf "\t@/usr/bin/env time -f \"PASS $target_name %%e seconds\" $test_command >/dev/null 2>/dev/null\n"
|
||||||
printf "\t@echo 'Passed %s'\n" "$target_name"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# $ generate_ys_test ys_file [yosys_args]
|
# $ generate_ys_test ys_file [yosys_args]
|
||||||
|
|
|
@ -17,7 +17,7 @@ shift "$((OPTIND-1))"
|
||||||
${MAKE:-make} -f ../tools/autotest.mk SEED="$seed" EXTRA_FLAGS="$abcopt" *.v
|
${MAKE:-make} -f ../tools/autotest.mk SEED="$seed" EXTRA_FLAGS="$abcopt" *.v
|
||||||
|
|
||||||
for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
|
for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
|
||||||
echo -n "Testing expectations for $f .."
|
echo "Testing expectations for $f .."
|
||||||
../../yosys -f verilog -qp "proc; opt; memory -nomap;; dump -outfile ${f%.v}.dmp t:\$mem_v2" $f
|
../../yosys -f verilog -qp "proc; opt; memory -nomap;; dump -outfile ${f%.v}.dmp t:\$mem_v2" $f
|
||||||
if grep -q expect-wr-ports $f; then
|
if grep -q expect-wr-ports $f; then
|
||||||
grep -q "parameter \\\\WR_PORTS $(gawk '/expect-wr-ports/ { print $3; }' $f)\$" ${f%.v}.dmp ||
|
grep -q "parameter \\\\WR_PORTS $(gawk '/expect-wr-ports/ { print $3; }' $f)\$" ${f%.v}.dmp ||
|
||||||
|
|
|
@ -32,7 +32,6 @@ python3 generate.py -c $count $seed
|
||||||
echo "all: test-$idx"
|
echo "all: test-$idx"
|
||||||
echo "test-$idx:"
|
echo "test-$idx:"
|
||||||
printf "\t@%s\n" \
|
printf "\t@%s\n" \
|
||||||
"echo -n [$i]" \
|
|
||||||
"../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys"
|
"../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys"
|
||||||
done
|
done
|
||||||
} > temp/makefile
|
} > temp/makefile
|
||||||
|
|
|
@ -21,7 +21,6 @@ python3 generate.py -c $count $seed
|
||||||
cd temp
|
cd temp
|
||||||
echo "running tests.."
|
echo "running tests.."
|
||||||
for ((i = 0; i < $count; i++)); do
|
for ((i = 0; i < $count; i++)); do
|
||||||
echo -n "[$i]"
|
|
||||||
idx=$( printf "%05d" $i )
|
idx=$( printf "%05d" $i )
|
||||||
../../../yosys -qq uut_${idx}.ys
|
../../../yosys -qq uut_${idx}.ys
|
||||||
iverilog -o uut_${idx}_tb uut_${idx}_tb.v uut_${idx}.v uut_${idx}_syn.v
|
iverilog -o uut_${idx}_tb uut_${idx}_tb.v uut_${idx}.v uut_${idx}_syn.v
|
||||||
|
|
|
@ -24,7 +24,6 @@ python3 generate.py -c $count $seed
|
||||||
|
|
||||||
echo "running tests.."
|
echo "running tests.."
|
||||||
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do
|
||||||
echo -n "[$i]"
|
|
||||||
idx=$( printf "%05d" $i )
|
idx=$( printf "%05d" $i )
|
||||||
../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys
|
../../yosys -ql temp/uut_${idx}.log temp/uut_${idx}.ys
|
||||||
done
|
done
|
||||||
|
|
|
@ -7,7 +7,7 @@ if [ $# != 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Test: $1 ->"
|
echo "Test: $1 ->"
|
||||||
../../yosys $1.ys >$1.log_stdout 2>$1.log_stderr || {
|
../../yosys $1.ys >$1.log_stdout 2>$1.log_stderr || {
|
||||||
echo "ERROR!"
|
echo "ERROR!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,7 +9,7 @@ STDERRFILE=${TESTNAME}.log_stderr
|
||||||
echo "" > $STDOUTFILE
|
echo "" > $STDOUTFILE
|
||||||
echo "" > $STDERRFILE
|
echo "" > $STDERRFILE
|
||||||
|
|
||||||
echo -n "Test: ${TESTNAME} -> "
|
echo "Test: ${TESTNAME} -> "
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ do
|
||||||
status_prefix="Test: $bn "
|
status_prefix="Test: $bn "
|
||||||
else
|
else
|
||||||
status_prefix=""
|
status_prefix=""
|
||||||
echo -n "Test: $bn "
|
echo "Test: $bn "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ext" == sv ]; then
|
if [ "$ext" == sv ]; then
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo -n " TOP first - "
|
echo " TOP first - "
|
||||||
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
||||||
read_verilog << EOV
|
read_verilog << EOV
|
||||||
module TOP(a, y);
|
module TOP(a, y);
|
||||||
|
@ -22,7 +22,7 @@ echo -n " TOP first - "
|
||||||
hierarchy -auto-top
|
hierarchy -auto-top
|
||||||
EOY
|
EOY
|
||||||
|
|
||||||
echo -n " TOP last - "
|
echo " TOP last - "
|
||||||
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
||||||
read_verilog << EOV
|
read_verilog << EOV
|
||||||
module aoi12(a, y);
|
module aoi12(a, y);
|
||||||
|
@ -41,7 +41,7 @@ echo -n " TOP last - "
|
||||||
hierarchy -auto-top
|
hierarchy -auto-top
|
||||||
EOY
|
EOY
|
||||||
|
|
||||||
echo -n " no explicit top - "
|
echo " no explicit top - "
|
||||||
../../yosys -s - <<- EOY | grep "Automatically selected noTop as design top module."
|
../../yosys -s - <<- EOY | grep "Automatically selected noTop as design top module."
|
||||||
read_verilog << EOV
|
read_verilog << EOV
|
||||||
module aoi12(a, y);
|
module aoi12(a, y);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue