Added vivado support to xsthammer
authorClifford Wolf <clifford@clifford.at>
Wed, 26 Jun 2013 10:34:06 +0000 (12:34 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 26 Jun 2013 10:34:06 +0000 (12:34 +0200)
tests/xsthammer/.gitignore
tests/xsthammer/Makefile
tests/xsthammer/run-check.sh
tests/xsthammer/run-vivado.sh [new file with mode: 0644]
tests/xsthammer/xl_cells.v

index 207ebd403c763c12f3d597d9654318e05caa04d0..c3bb9ccb9feaef9cc79a3159afc7e8cd3df80d7f 100644 (file)
@@ -3,5 +3,8 @@ generate.lst
 rtl
 xst
 xst_temp
+vivado
+vivado_temp
 check
 check_temp
+check_vivado
index ab7aebdc3b843ed40eab11a4844df13fd7449814..55d94d4566ab2e67290457dd11106bd0e7e963bf 100644 (file)
@@ -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
 
index 3dd63b59978054e845ed086724c149a083ba5d07..17e7d9382eb4b873693127c403bfa33dd76df308 100644 (file)
@@ -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 (file)
index 0000000..87ee53c
--- /dev/null
@@ -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
+
index 775c84d24d7f1cb0222c961d485e039e38b026a0..d2badcfff8ab07f8af745abe062891c9c3571a1a 100644 (file)
@@ -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