yosys/tests/ice40/run-test.sh

34 lines
892 B
Bash
Raw Normal View History

2019-08-19 23:50:05 -05:00
set -e
2019-08-23 04:40:14 -05:00
if [ -f "../../techlibs/common/simcells.v" ]; then
COMMON_PREFIX=../../techlibs/common
TECHLIBS_PREFIX=../../techlibs
2019-08-21 13:52:07 -05:00
else
COMMON_PREFIX=/usr/local/share/yosys
TECHLIBS_PREFIX=/usr/local/share/yosys
fi
{
echo "all::"
for x in *.ys; do
echo "all:: run-$x"
echo "run-$x:"
echo " @echo 'Running $x..'"
2019-08-22 15:57:19 -05:00
echo " @../../yosys -ql ${x%.ys}.log $x -w 'Yosys has only limited support for tri-state logic at the moment.'"
2019-08-19 23:50:05 -05:00
done
2019-08-21 13:52:07 -05:00
for t in *_tb.v; do
echo "all:: run-$t"
echo "run-$t: ${t%_tb.v}_synth.v"
2019-08-21 13:52:07 -05:00
echo " @echo 'Running $t..'"
2019-08-22 16:03:02 -05:00
echo " @iverilog -o ${t%_tb.v}_testbench $t ${t%_tb.v}_synth.v common.v $TECHLIBS_PREFIX/ice40/cells_sim.v"
echo " @vvp -N ${t%_tb.v}_testbench"
2019-08-21 13:52:07 -05:00
done
for s in *.sh; do
if [ "$s" != "run-test.sh" ]; then
echo "all:: run-$s"
echo "run-$s:"
echo " @echo 'Running $s..'"
echo " @bash $s"
fi
done
} > run-test.mk
exec ${MAKE:-make} -f run-test.mk