Added vivado support to xsthammer

This commit is contained in:
Clifford Wolf 2013-06-26 12:34:06 +02:00
parent 101491132f
commit a5fe2565b7
5 changed files with 69 additions and 7 deletions

View File

@ -3,5 +3,8 @@ generate.lst
rtl
xst
xst_temp
vivado
vivado_temp
check
check_temp
check_vivado

View 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

View 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

View File

@ -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

View 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