2023-08-11 20:59:39 -05:00
|
|
|
#!/usr/bin/env bash
|
2015-08-12 05:56:20 -05:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
rm -rf test_cells.tmp
|
|
|
|
mkdir -p test_cells.tmp
|
|
|
|
cd test_cells.tmp
|
|
|
|
|
|
|
|
# don't test $mul to reduce runtime
|
2020-04-21 05:51:58 -05:00
|
|
|
# don't test $div/$mod/$divfloor/$modfloor to reduce runtime and avoid "div by zero" message
|
|
|
|
../../../yosys -p 'test_cell -n 5 -w test all /$alu /$fa /$lcu /$lut /$macc /$mul /$div /$mod /$divfloor /$modfloor'
|
2015-08-12 05:56:20 -05:00
|
|
|
|
|
|
|
cat > template.txt << "EOT"
|
|
|
|
%module main
|
|
|
|
INVARSPEC ! bool(_trigger);
|
|
|
|
EOT
|
|
|
|
|
|
|
|
for fn in test_*.il; do
|
|
|
|
../../../yosys -p "
|
|
|
|
read_ilang $fn
|
|
|
|
rename gold gate
|
|
|
|
synth
|
|
|
|
|
|
|
|
read_ilang $fn
|
|
|
|
miter -equiv -flatten gold gate main
|
|
|
|
hierarchy -top main
|
|
|
|
write_smv -tpl template.txt ${fn#.il}.smv
|
|
|
|
"
|
|
|
|
nuXmv -dynamic ${fn#.il}.smv > ${fn#.il}.out
|
|
|
|
done
|
|
|
|
|
|
|
|
grep '^-- invariant .* is false' *.out || echo 'All OK.'
|
|
|
|
|