yosys/tests/memories/run-test.sh

20 lines
654 B
Bash
Raw Normal View History

2014-07-18 06:25:19 -05:00
#!/bin/bash
set -e
bash ../tools/autotest.sh -G *.v
for f in `egrep -l 'expect-(wr|rd)-ports' *.v`; do
echo -n "Testing expectations for $f .."
../../yosys -qp "proc; opt; memory -nomap;; dump -outfile ${f%.v}.dmp t:\$mem" $f
if grep -q expect-wr-ports $f; then
2014-07-18 06:45:25 -05:00
grep -q "parameter \\\\WR_PORTS $(gawk '/expect-wr-ports/ { print $3; }' $f)\$" ${f%.v}.dmp ||
2014-07-18 06:25:19 -05:00
{ echo " ERROR: Unexpected number of write ports."; false; }
fi
if grep -q expect-rd-ports $f; then
2014-07-18 06:45:25 -05:00
grep -q "parameter \\\\RD_PORTS $(gawk '/expect-rd-ports/ { print $3; }' $f)\$" ${f%.v}.dmp ||
2014-07-18 06:25:19 -05:00
{ echo " ERROR: Unexpected number of read ports."; false; }
fi
echo " ok."
done