2013-06-10 05:37:05 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
mkdir -p check
|
|
|
|
|
|
|
|
rm -rf check_temp
|
|
|
|
mkdir check_temp
|
|
|
|
cd check_temp
|
|
|
|
|
|
|
|
for job in $( ls ../rtl | sed 's,\.v$,,' )
|
|
|
|
do
|
|
|
|
{
|
|
|
|
echo "module top(a, b, y1, y2);"
|
|
|
|
sed -r '/^(input|output) / !d; /output/ { s/ y;/ y1;/; p; }; s/ y1;/ y2;/;' ../rtl/$job.v
|
|
|
|
echo "${job}_rtl rtl_variant (.a(a), .b(b), .y(y1));"
|
2013-06-10 06:57:10 -05:00
|
|
|
echo "${job}_xst xst_variant (.a(a), .b(b), .y(y2));"
|
2013-06-10 05:37:05 -05:00
|
|
|
echo "endmodule"
|
|
|
|
} > ${job}_top.v
|
|
|
|
|
|
|
|
{
|
|
|
|
echo "read_verilog -DGLBL ../xst/$job.v"
|
|
|
|
echo "rename $job ${job}_xst"
|
|
|
|
|
|
|
|
echo "read_verilog ../rtl/$job.v"
|
|
|
|
echo "rename $job ${job}_rtl"
|
|
|
|
|
|
|
|
echo "read_verilog ${job}_top.v"
|
|
|
|
echo "read_verilog ../xl_cells.v"
|
|
|
|
|
|
|
|
echo "hierarchy -top top"
|
|
|
|
echo "flatten top"
|
|
|
|
echo "hierarchy -top top"
|
|
|
|
echo "opt_clean"
|
|
|
|
|
|
|
|
echo "write_ilang ${job}_top.il"
|
|
|
|
} > ${job}_top.ys
|
|
|
|
|
|
|
|
{
|
|
|
|
echo "read_ilang ${job}_top.il"
|
|
|
|
echo "sat -verify -prove y1 y2 top"
|
|
|
|
} > ${job}_cmp.ys
|
|
|
|
|
|
|
|
yosys ${job}_top.ys
|
2013-06-10 06:57:10 -05:00
|
|
|
|
2013-06-10 05:37:05 -05:00
|
|
|
if yosys -l ${job}.log ${job}_cmp.ys; then
|
|
|
|
mv ${job}.log ../check/${job}.log
|
2013-06-10 06:57:10 -05:00
|
|
|
rm -f ../check/${job}.err
|
2013-06-10 05:37:05 -05:00
|
|
|
else
|
|
|
|
mv ${job}.log ../check/${job}.err
|
2013-06-10 06:57:10 -05:00
|
|
|
rm -f ../check/${job}.log
|
2013-06-10 05:37:05 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|