From 90265118215ae74384732edc9cf3fb57b6978756 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 10 Jun 2013 16:17:09 +0200 Subject: [PATCH] Progress xsthammer scripts --- tests/xsthammer/generate.cc | 36 ++++++++++++++++++------------------ tests/xsthammer/run-check.sh | 22 ++++++++++++++-------- tests/xsthammer/run-xst.sh | 6 +++++- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/tests/xsthammer/generate.cc b/tests/xsthammer/generate.cc index 2e50398ed..9f236c34a 100644 --- a/tests/xsthammer/generate.cc +++ b/tests/xsthammer/generate.cc @@ -5,27 +5,27 @@ #include 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) diff --git a/tests/xsthammer/run-check.sh b/tests/xsthammer/run-check.sh index de7c33b4b..4f4658a96 100644 --- a/tests/xsthammer/run-check.sh +++ b/tests/xsthammer/run-check.sh @@ -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 diff --git a/tests/xsthammer/run-xst.sh b/tests/xsthammer/run-xst.sh index bcd12ea3f..00c46a752 100644 --- a/tests/xsthammer/run-xst.sh +++ b/tests/xsthammer/run-xst.sh @@ -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 -- 2.30.2