Progress xsthammer scripts

This commit is contained in:
Clifford Wolf 2013-06-10 16:17:09 +02:00
parent 7d790febb0
commit 9026511821
3 changed files with 37 additions and 27 deletions

View File

@ -5,27 +5,27 @@
#include <string>
const char *arg_types[][2] = {
{ "{dir} [3:0] {name}", "{name}" },
{ "{dir} [4:0] {name}", "{name}" },
{ "{dir} [5:0] {name}", "{name}" },
{ "{dir} signed [3:0] {name}", "{name}" },
{ "{dir} signed [4:0] {name}", "{name}" },
{ "{dir} signed [5:0] {name}", "{name}" }
{ "{dir} [3:0] {name}", "{name}" }, // 00
{ "{dir} [4:0] {name}", "{name}" }, // 01
{ "{dir} [5:0] {name}", "{name}" }, // 02
{ "{dir} signed [3:0] {name}", "{name}" }, // 03
{ "{dir} signed [4:0] {name}", "{name}" }, // 04
{ "{dir} signed [5:0] {name}", "{name}" } // 05
};
const char *ops[] = {
"+",
"-",
"*",
"&&",
"||",
"&",
"|",
"^",
"<<",
">>",
"<<<",
">>>",
"+", // 00
"-", // 01
"*", // 02
"&&", // 03
"||", // 04
"&", // 05
"|", // 06
"^", // 07
"<<", // 08
">>", // 09
"<<<", // 10
">>>", // 11
};
void strsubst(std::string &str, const std::string &match, const std::string &replace)

View File

@ -7,13 +7,17 @@ rm -rf check_temp
mkdir check_temp
cd check_temp
for job in $( ls ../rtl | sed 's,\.v$,,' )
if [ $# -eq 0 ]; then
set -- $( ls ../rtl | sed 's,\.v$,,' )
fi
for job
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));"
echo "${job}_xst xst_variant (.a(a), .b(b), .y(y2));"
echo "module top(a, b, y_rtl, y_xst);"
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));"
echo "endmodule"
} > ${job}_top.v
@ -23,6 +27,7 @@ do
echo "read_verilog ../rtl/$job.v"
echo "rename $job ${job}_rtl"
# echo "techmap ${job}_rtl"
echo "read_verilog ${job}_top.v"
echo "read_verilog ../xl_cells.v"
@ -37,17 +42,18 @@ do
{
echo "read_ilang ${job}_top.il"
echo "sat -verify -prove y1 y2 top"
echo "sat -verify -show a,b,y_rtl,y_xst -prove y_rtl y_xst top"
} > ${job}_cmp.ys
yosys ${job}_top.ys
../../../yosys ${job}_top.ys
if yosys -l ${job}.log ${job}_cmp.ys; then
if ../../../yosys -l ${job}.log ${job}_cmp.ys; then
mv ${job}.log ../check/${job}.log
rm -f ../check/${job}.err
else
mv ${job}.log ../check/${job}.err
rm -f ../check/${job}.log
# break
fi
done

View File

@ -8,7 +8,11 @@ rm -rf xst_temp
mkdir xst_temp
cd xst_temp
for job in $( ls ../rtl | sed 's,\.v$,,' )
if [ $# -eq 0 ]; then
set -- $( ls ../rtl | sed 's,\.v$,,' )
fi
for job
do
cat > $job.xst <<- EOT
run