From 28539541edc2df0c5e27034281cc20fe92ccb699 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 3 Jul 2013 11:19:18 +0200 Subject: [PATCH] Progress in xsthammer --- tests/xsthammer/Makefile | 13 +++++++++++-- tests/xsthammer/generate.cc | 11 ++++++++--- tests/xsthammer/run-check.sh | 2 +- tests/xsthammer/run-vivado.sh | 5 ++--- tests/xsthammer/run-xst.sh | 1 + 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tests/xsthammer/Makefile b/tests/xsthammer/Makefile index 55d94d456..83edcccea 100644 --- a/tests/xsthammer/Makefile +++ b/tests/xsthammer/Makefile @@ -31,6 +31,15 @@ clean: mrproper: clean rm -rf rtl xst check -.PHONY: test vivado check_xl_cells clean mrproper -.PRECIOUS: check/%.log xst/%.v rtl/%.v generate.lst +backup: + mkdir -p ~/.yosys/xhammer + tar cvzf ~/.yosys/xhammer/xst_files.tar.gz xst + tar cvzf ~/.yosys/xhammer/vivado_files.tar.gz vivado + +restore: + tar xvzf ~/.yosys/xhammer/xst_files.tar.gz + tar xvzf ~/.yosys/xhammer/vivado_files.tar.gz + +.PHONY: test vivado check_xl_cells clean mrproper backup restore +.PRECIOUS: check/%.log xst/%.v vivado/%.v rtl/%.v generate.lst diff --git a/tests/xsthammer/generate.cc b/tests/xsthammer/generate.cc index 672ad86a1..6efd4c97d 100644 --- a/tests/xsthammer/generate.cc +++ b/tests/xsthammer/generate.cc @@ -4,7 +4,7 @@ #define GENERATE_TERNARY_OPS #define GENERATE_CONCAT_OPS #undef GENERATE_REPEAT_OPS // disabled because of XST bug -#undef GENERATE_EXPRESSIONS +#define GENERATE_EXPRESSIONS #include #include @@ -109,8 +109,7 @@ void print_expression(FILE *f, int budget, uint32_t mask = 0) do { mode = xorshift32() % num_modes; } while (((1 << mode) & mask) == 0); - - fprintf(f, "/* %d */", mode); + // fprintf(f, "/* %d */", mode); budget--; switch (mode) @@ -123,7 +122,13 @@ void print_expression(FILE *f, int budget, uint32_t mask = 0) case 1: fprintf(f, "("); print_expression(f, budget/2, mask); + #if 1 + // FIXME: relational operators disabled because there is an xst bug.. + do k = xorshift32() % num_binary_ops; while ((k >= 9 && k <= 12) || (k >= 3 && k <= 6)); + fprintf(f, "%s", binary_ops[k]); + #else fprintf(f, "%s", binary_ops[xorshift32() % num_binary_ops]); + #endif print_expression(f, budget/2, mask); fprintf(f, ")"); break; diff --git a/tests/xsthammer/run-check.sh b/tests/xsthammer/run-check.sh index 17e7d9382..64f0da6d7 100644 --- a/tests/xsthammer/run-check.sh +++ b/tests/xsthammer/run-check.sh @@ -75,10 +75,10 @@ done if ../../../../yosys -l ${job}.log ${job}_cmp.ys; then mv ${job}.log ../../$checkdir/${job}.log rm -f ../../$checkdir/${job}.err + touch ../../$checkdir/${job}.log else mv ${job}.log ../../$checkdir/${job}.err rm -f ../../$checkdir/${job}.log - exit 1 fi exit 0 diff --git a/tests/xsthammer/run-vivado.sh b/tests/xsthammer/run-vivado.sh index 87ee53cb4..e8f574858 100644 --- a/tests/xsthammer/run-vivado.sh +++ b/tests/xsthammer/run-vivado.sh @@ -18,9 +18,8 @@ cat > $job.tcl <<- EOT write_verilog ../../vivado/$job.v EOT -. /opt/Xilinx/14.5/ISE_DS/settings64.sh - -vivado -mode batch -source $job.tcl +/opt/Xilinx/Vivado/2013.2/bin/vivado -mode batch -source $job.tcl +sync exit 0 diff --git a/tests/xsthammer/run-xst.sh b/tests/xsthammer/run-xst.sh index b421e2954..dfa0d55ba 100644 --- a/tests/xsthammer/run-xst.sh +++ b/tests/xsthammer/run-xst.sh @@ -29,5 +29,6 @@ xst -ifn $job.xst netgen -w -ofmt verilog $job.ngc $job cp $job.v ../../xst/$job.v +sync exit 0 -- 2.30.2