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
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
#!/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
set --
set -e
-mkdir -p check check_temp/$job
+mkdir -p $checkdir check_temp/$job
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"
} > ${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
--- /dev/null
+#!/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
+