2013-06-10 05:37:05 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
set -e
|
2013-06-10 05:37:05 -05:00
|
|
|
mkdir -p check
|
|
|
|
|
|
|
|
rm -rf check_temp
|
|
|
|
mkdir check_temp
|
|
|
|
cd check_temp
|
|
|
|
|
2013-06-10 09:17:09 -05:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
set -- $( ls ../rtl | sed 's,\.v$,,' )
|
|
|
|
fi
|
|
|
|
|
|
|
|
for job
|
2013-06-10 05:37:05 -05:00
|
|
|
do
|
|
|
|
{
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "module ${job}_top(a, b, y_rtl, y_xst);"
|
2013-06-10 09:17:09 -05:00
|
|
|
sed -r '/^(input|output) / !d; /output/ { s/ y;/ y_rtl;/; p; }; s/ y_rtl;/ y_xst;/;' ../rtl/$job.v
|
|
|
|
echo "${job}_rtl rtl_variant (.a(a), .b(b), .y(y_rtl));"
|
|
|
|
echo "${job}_xst xst_variant (.a(a), .b(b), .y(y_xst));"
|
2013-06-10 05:37:05 -05:00
|
|
|
echo "endmodule"
|
|
|
|
} > ${job}_top.v
|
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
for mode in nomap techmap; do
|
|
|
|
{
|
|
|
|
echo "read_verilog -DGLBL ../xst/$job.v"
|
|
|
|
echo "rename $job ${job}_xst"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "read_verilog ../rtl/$job.v"
|
|
|
|
echo "rename $job ${job}_rtl"
|
|
|
|
if [ $mode = techmap ]; then
|
|
|
|
echo "techmap ${job}_rtl"
|
|
|
|
fi
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "read_verilog ${job}_top.v"
|
|
|
|
echo "read_verilog ../xl_cells.v"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "hierarchy -top ${job}_top"
|
|
|
|
echo "flatten ${job}_top"
|
|
|
|
echo "hierarchy -top ${job}_top"
|
|
|
|
echo "opt_clean"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "rename ${job}_top ${job}_top_${mode}"
|
|
|
|
echo "write_ilang ${job}_top_${mode}.il"
|
|
|
|
} > ${job}_top_${mode}.ys
|
|
|
|
../../../yosys -q ${job}_top_${mode}.ys
|
|
|
|
done
|
2013-06-10 05:37:05 -05:00
|
|
|
|
|
|
|
{
|
2013-06-10 14:07:22 -05:00
|
|
|
echo "read_ilang ${job}_top_nomap.il"
|
|
|
|
echo "read_ilang ${job}_top_techmap.il"
|
|
|
|
echo "sat -verify -show a,b,y_rtl,y_xst -prove y_rtl y_xst ${job}_top_nomap"
|
|
|
|
echo "sat -verify -show a,b,y_rtl,y_xst -prove y_rtl y_xst ${job}_top_techmap"
|
2013-06-10 05:37:05 -05:00
|
|
|
} > ${job}_cmp.ys
|
|
|
|
|
2013-06-10 09:17:09 -05:00
|
|
|
if ../../../yosys -l ${job}.log ${job}_cmp.ys; then
|
2013-06-10 05:37:05 -05:00
|
|
|
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 09:17:09 -05:00
|
|
|
# break
|
2013-06-10 05:37:05 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|