Progress xsthammer scripts
authorClifford Wolf <clifford@clifford.at>
Mon, 10 Jun 2013 14:17:09 +0000 (16:17 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 10 Jun 2013 14:17:09 +0000 (16:17 +0200)
tests/xsthammer/generate.cc
tests/xsthammer/run-check.sh
tests/xsthammer/run-xst.sh

index 2e50398eda49c693b2e159649690bcad199386db..9f236c34abcc11e05198c67a01f83e5ba33c7618 100644 (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)
index de7c33b4b4625b45e0ae6eb3ff982ab30a43ee1c..4f4658a9661b538017e03b4073efd5c60c2e32e2 100644 (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
 
index bcd12ea3f0d450752e5b1381c0d0b46b79474e11..00c46a75225508a96e859d60692651dad794540d 100644 (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