summaryrefslogtreecommitdiff
path: root/tests/xsthammer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/xsthammer')
-rw-r--r--tests/xsthammer/.gitignore3
-rw-r--r--tests/xsthammer/Makefile10
-rw-r--r--tests/xsthammer/run-check.sh25
-rw-r--r--tests/xsthammer/run-vivado.sh26
-rw-r--r--tests/xsthammer/xl_cells.v12
5 files changed, 69 insertions, 7 deletions
diff --git a/tests/xsthammer/.gitignore b/tests/xsthammer/.gitignore
index 207ebd40..c3bb9ccb 100644
--- a/tests/xsthammer/.gitignore
+++ b/tests/xsthammer/.gitignore
@@ -3,5 +3,8 @@ generate.lst
rtl
xst
xst_temp
+vivado
+vivado_temp
check
check_temp
+check_vivado
diff --git a/tests/xsthammer/Makefile b/tests/xsthammer/Makefile
index ab7aebdc..55d94d45 100644
--- a/tests/xsthammer/Makefile
+++ b/tests/xsthammer/Makefile
@@ -3,12 +3,20 @@ include generate.lst
test: $(TARGETS)
+vivado: $(addprefix check_vivado/,$(notdir $(TARGETS)))
+
check/%.log: rtl/%.v xst/%.v
bash run-check.sh $(notdir $(basename $<))
+check_vivado/%.log: rtl/%.v vivado/%.v
+ bash run-check.sh -vivado $(notdir $(basename $<))
+
xst/%.v: rtl/%.v
bash run-xst.sh $(notdir $(basename $<))
+vivado/%.v: rtl/%.v
+ bash run-vivado.sh $(notdir $(basename $<))
+
generate.lst: generate.cc
clang -Wall -o generate generate.cc -lstdc++
./generate
@@ -23,6 +31,6 @@ clean:
mrproper: clean
rm -rf rtl xst check
-.PHONY: test check_xl_cells clean mrproper
+.PHONY: test vivado check_xl_cells clean mrproper
.PRECIOUS: check/%.log xst/%.v rtl/%.v generate.lst
diff --git a/tests/xsthammer/run-check.sh b/tests/xsthammer/run-check.sh
index 3dd63b59..17e7d938 100644
--- a/tests/xsthammer/run-check.sh
+++ b/tests/xsthammer/run-check.sh
@@ -1,5 +1,14 @@
#!/bin/bash
+use_vivado=false
+checkdir="check"
+
+if [ "$1" = "-vivado" ]; then
+ use_vivado=true
+ checkdir="check_vivado"
+ shift
+fi
+
if [ $# -eq 0 ]; then
echo "Usage: $0 <job_id>" >&2
exit 1
@@ -9,7 +18,7 @@ job="$1"
set --
set -e
-mkdir -p check check_temp/$job
+mkdir -p $checkdir check_temp/$job
cd check_temp/$job
{
@@ -22,7 +31,11 @@ cd check_temp/$job
for mode in nomap techmap; do
{
- echo "read_verilog -DGLBL ../../xst/$job.v"
+ if $use_vivado; then
+ echo "read_verilog ../../vivado/$job.v"
+ else
+ echo "read_verilog -DGLBL ../../xst/$job.v"
+ fi
echo "rename $job ${job}_xst"
echo "read_verilog ../../rtl/$job.v"
@@ -60,11 +73,11 @@ done
} > ${job}_cmp.ys
if ../../../../yosys -l ${job}.log ${job}_cmp.ys; then
- mv ${job}.log ../../check/${job}.log
- rm -f ../../check/${job}.err
+ mv ${job}.log ../../$checkdir/${job}.log
+ rm -f ../../$checkdir/${job}.err
else
- mv ${job}.log ../../check/${job}.err
- rm -f ../../check/${job}.log
+ mv ${job}.log ../../$checkdir/${job}.err
+ rm -f ../../$checkdir/${job}.log
exit 1
fi
diff --git a/tests/xsthammer/run-vivado.sh b/tests/xsthammer/run-vivado.sh
new file mode 100644
index 00000000..87ee53cb
--- /dev/null
+++ b/tests/xsthammer/run-vivado.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 <job_id>" >&2
+ exit 1
+fi
+
+job="$1"
+set --
+
+set -e
+mkdir -p vivado vivado_temp/$job
+cd vivado_temp/$job
+
+cat > $job.tcl <<- EOT
+ read_verilog ../../rtl/$job.v
+ synth_design -part xc7k70t -top $job
+ write_verilog ../../vivado/$job.v
+EOT
+
+. /opt/Xilinx/14.5/ISE_DS/settings64.sh
+
+vivado -mode batch -source $job.tcl
+
+exit 0
+
diff --git a/tests/xsthammer/xl_cells.v b/tests/xsthammer/xl_cells.v
index 775c84d2..d2badcff 100644
--- a/tests/xsthammer/xl_cells.v
+++ b/tests/xsthammer/xl_cells.v
@@ -1,4 +1,16 @@
+module IBUF(O, I);
+output O;
+input I;
+assign O = I;
+endmodule
+
+module OBUF(O, I);
+output O;
+input I;
+assign O = I;
+endmodule
+
module GND(G);
output G = 0;
endmodule