aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-06-10 16:17:09 +0200
committerClifford Wolf <clifford@clifford.at>2013-06-10 16:17:09 +0200
commit90265118215ae74384732edc9cf3fb57b6978756 (patch)
tree936d9efbe8d98a3639c8b60647c53e8186de669c /tests
parent7d790febb040ae153a4db9be725f4d9709a49843 (diff)
downloadyosys-90265118215ae74384732edc9cf3fb57b6978756.tar.gz
yosys-90265118215ae74384732edc9cf3fb57b6978756.tar.bz2
yosys-90265118215ae74384732edc9cf3fb57b6978756.zip
Progress xsthammer scripts
Diffstat (limited to 'tests')
-rw-r--r--tests/xsthammer/generate.cc36
-rw-r--r--tests/xsthammer/run-check.sh22
-rw-r--r--tests/xsthammer/run-xst.sh6
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 <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)
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