From a5fe2565b72c3e80f981a9694072233876bf7c9a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 26 Jun 2013 12:34:06 +0200 Subject: [PATCH] Added vivado support to xsthammer --- tests/xsthammer/.gitignore | 3 +++ tests/xsthammer/Makefile | 10 +++++++++- tests/xsthammer/run-check.sh | 25 +++++++++++++++++++------ tests/xsthammer/run-vivado.sh | 26 ++++++++++++++++++++++++++ tests/xsthammer/xl_cells.v | 12 ++++++++++++ 5 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 tests/xsthammer/run-vivado.sh diff --git a/tests/xsthammer/.gitignore b/tests/xsthammer/.gitignore index 207ebd403..c3bb9ccb9 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 ab7aebdc3..55d94d456 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 3dd63b599..17e7d9382 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 " >&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 000000000..87ee53cb4 --- /dev/null +++ b/tests/xsthammer/run-vivado.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "Usage: $0 " >&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 775c84d24..d2badcfff 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 -- 2.30.2