2013-06-10 05:37:05 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "Usage: $0 <job_id>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
job="$1"
|
|
|
|
set --
|
|
|
|
|
|
|
|
set -e
|
2013-06-13 10:23:51 -05:00
|
|
|
mkdir -p check check_temp/$job
|
|
|
|
cd check_temp/$job
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
{
|
|
|
|
echo "module ${job}_top(a, b, y_rtl, y_xst);"
|
2013-06-13 10:23:51 -05:00
|
|
|
sed -r '/^(input|output) / !d; /output/ { s/ y;/ y_rtl;/; p; }; s/ y_rtl;/ y_xst;/;' ../../rtl/$job.v
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "${job}_rtl rtl_variant (.a(a), .b(b), .y(y_rtl));"
|
|
|
|
echo "${job}_xst xst_variant (.a(a), .b(b), .y(y_xst));"
|
|
|
|
echo "endmodule"
|
|
|
|
} > ${job}_top.v
|
2013-06-10 09:17:09 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
for mode in nomap techmap; do
|
2013-06-10 05:37:05 -05:00
|
|
|
{
|
2013-06-13 10:23:51 -05:00
|
|
|
echo "read_verilog -DGLBL ../../xst/$job.v"
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "rename $job ${job}_xst"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-13 10:23:51 -05:00
|
|
|
echo "read_verilog ../../rtl/$job.v"
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "rename $job ${job}_rtl"
|
|
|
|
if [ $mode = techmap ]; then
|
|
|
|
echo "techmap ${job}_rtl"
|
|
|
|
fi
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "read_verilog ${job}_top.v"
|
2013-06-13 10:23:51 -05:00
|
|
|
echo "read_verilog ../../xl_cells.v"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "hierarchy -top ${job}_top"
|
2013-06-13 12:51:13 -05:00
|
|
|
echo "flatten ${job}_xst"
|
|
|
|
echo "flatten ${job}_rtl"
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "flatten ${job}_top"
|
|
|
|
echo "opt_clean"
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-13 12:51:13 -05:00
|
|
|
echo "rename ${job}_xst ${job}_xst_${mode}"
|
|
|
|
echo "rename ${job}_rtl ${job}_rtl_${mode}"
|
2013-06-11 12:49:35 -05:00
|
|
|
echo "rename ${job}_top ${job}_top_${mode}"
|
2013-06-13 12:51:13 -05:00
|
|
|
echo "dump -outfile ${job}_top_${mode}.il ${job}_xst_${mode} ${job}_rtl_${mode} ${job}_top_${mode}"
|
2013-06-11 12:49:35 -05:00
|
|
|
} > ${job}_top_${mode}.ys
|
2013-06-13 10:23:51 -05:00
|
|
|
../../../../yosys -q ${job}_top_${mode}.ys
|
2013-06-11 12:49:35 -05:00
|
|
|
done
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
{
|
|
|
|
echo "read_ilang ${job}_top_nomap.il"
|
|
|
|
echo "read_ilang ${job}_top_techmap.il"
|
2013-06-20 05:49:10 -05:00
|
|
|
echo "sat -timeout 60 -verify-no-timeout -show a,b,y_rtl,y_xst -prove y_rtl y_xst ${job}_top_nomap"
|
|
|
|
echo "sat -timeout 60 -verify-no-timeout -show a,b,y_rtl,y_xst -prove y_rtl y_xst ${job}_top_techmap"
|
2013-06-17 04:30:25 -05:00
|
|
|
if [[ $job != expression_* ]]; then
|
2013-06-19 02:30:37 -05:00
|
|
|
echo "eval -brute_force_equiv_checker ${job}_rtl_nomap ${job}_xst_nomap"
|
|
|
|
echo "eval -brute_force_equiv_checker ${job}_rtl_techmap ${job}_xst_techmap"
|
2013-06-17 04:30:25 -05:00
|
|
|
fi
|
2013-06-11 12:49:35 -05:00
|
|
|
} > ${job}_cmp.ys
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-13 10:23:51 -05:00
|
|
|
if ../../../../yosys -l ${job}.log ${job}_cmp.ys; then
|
|
|
|
mv ${job}.log ../../check/${job}.log
|
|
|
|
rm -f ../../check/${job}.err
|
2013-06-11 12:49:35 -05:00
|
|
|
else
|
2013-06-13 10:23:51 -05:00
|
|
|
mv ${job}.log ../../check/${job}.err
|
|
|
|
rm -f ../../check/${job}.log
|
2013-06-11 12:49:35 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-06-10 05:37:05 -05:00
|
|
|
|
2013-06-11 12:49:35 -05:00
|
|
|
exit 0
|
2013-06-10 05:37:05 -05:00
|
|
|
|