Merge pull request #1146 from gsomlo/gls-test-abc-ext
authorClifford Wolf <clifford@clifford.at>
Fri, 28 Jun 2019 08:30:31 +0000 (10:30 +0200)
committerDavid Shah <dave@ds0.me>
Tue, 9 Jul 2019 17:44:57 +0000 (18:44 +0100)
tests: use optional ABCEXTERNAL when specified

Makefile
tests/aiger/run-test.sh
tests/memories/run-test.sh
tests/tools/autotest.sh

index 383ec9e5582defeda721559d293fd5501c3df588..bbae8c159377c3dc06e78f7fed10d2210ea02c89 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -666,6 +666,12 @@ else
 SEEDOPT=""
 endif
 
+ifneq ($(ABCEXTERNAL),)
+ABCOPT="-A $(ABCEXTERNAL)"
+else
+ABCOPT=""
+endif
+
 test: $(TARGETS) $(EXTRA_TARGETS)
        +cd tests/simple && bash run-test.sh $(SEEDOPT)
        +cd tests/hana && bash run-test.sh $(SEEDOPT)
@@ -674,13 +680,13 @@ test: $(TARGETS) $(EXTRA_TARGETS)
        +cd tests/share && bash run-test.sh $(SEEDOPT)
        +cd tests/fsm && bash run-test.sh $(SEEDOPT)
        +cd tests/techmap && bash run-test.sh
-       +cd tests/memories && bash run-test.sh $(SEEDOPT)
+       +cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
        +cd tests/bram && bash run-test.sh $(SEEDOPT)
        +cd tests/various && bash run-test.sh
        +cd tests/sat && bash run-test.sh
        +cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
        +cd tests/opt && bash run-test.sh
-       +cd tests/aiger && bash run-test.sh
+       +cd tests/aiger && bash run-test.sh $(ABCOPT)
        +cd tests/arch && bash run-test.sh
        @echo ""
        @echo "  Passed \"make test\"."
index 5246c1b489186ce2fe250aaa35284d233a7cc1bb..deaf48a3d7067f65af32ed8ec7f85f7cd0733efe 100755 (executable)
@@ -2,6 +2,16 @@
 
 set -e
 
+OPTIND=1
+abcprog="../../yosys-abc"    # default to built-in version of abc
+while getopts "A:" opt
+do
+    case "$opt" in
+       A) abcprog="$OPTARG" ;;
+    esac
+done
+shift "$((OPTIND-1))"
+
 # NB: *.aag and *.aig must contain a symbol table naming the primary
 #     inputs and outputs, otherwise ABC and Yosys will name them
 #     arbitrarily (and inconsistently with each other).
@@ -11,7 +21,7 @@ for aag in *.aag; do
     # (which would have been created by the reference aig2aig utility,
     #  available from http://fmv.jku.at/aiger/)
     echo "Checking $aag."
-    ../../yosys-abc -q "read -c ${aag%.*}.aig; write ${aag%.*}_ref.v"
+    $abcprog -q "read -c ${aag%.*}.aig; write ${aag%.*}_ref.v"
     ../../yosys -qp "
 read_verilog ${aag%.*}_ref.v
 prep
@@ -28,7 +38,7 @@ done
 
 for aig in *.aig; do
     echo "Checking $aig."
-    ../../yosys-abc -q "read -c $aig; write ${aig%.*}_ref.v"
+    $abcprog -q "read -c $aig; write ${aig%.*}_ref.v"
     ../../yosys -qp "
 read_verilog ${aig%.*}_ref.v
 prep
index d0537bb98731e823bc8e42228512abf5cfcbaee1..76acaa9cdfa5c96e1f12b2b66645f6229e61380f 100755 (executable)
@@ -4,15 +4,17 @@ set -e
 
 OPTIND=1
 seed=""    # default to no seed specified
-while getopts "S:" opt
+abcopt=""
+while getopts "A:S:" opt
 do
     case "$opt" in
+       A) abcopt="-A $OPTARG" ;;
        S) seed="-S $OPTARG" ;;
     esac
 done
 shift "$((OPTIND-1))"
 
-bash ../tools/autotest.sh $seed -G *.v
+bash ../tools/autotest.sh $abcopt $seed -G *.v
 
 for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
        echo -n "Testing expectations for $f .."
index 96d9cdda9b4979173253e272c55862afdcafa160..7b64b357f8c033049058221a3044e5de450d8d05 100755 (executable)
@@ -23,12 +23,13 @@ warn_iverilog_git=false
 # The tests are skipped if firrtl2verilog is the empty string (the default).
 firrtl2verilog=""
 xfirrtl="../xfirrtl"
+abcprog="$toolsdir/../../yosys-abc"
 
 if [ ! -f $toolsdir/cmp_tbdata -o $toolsdir/cmp_tbdata.c -nt $toolsdir/cmp_tbdata ]; then
        ( set -ex; ${CC:-gcc} -Wall -o $toolsdir/cmp_tbdata $toolsdir/cmp_tbdata.c; ) || exit 1
 fi
 
-while getopts xmGl:wkjvref:s:p:n:S:I:-: opt; do
+while getopts xmGl:wkjvref:s:p:n:S:I:A:-: opt; do
        case "$opt" in
                x)
                        use_xsim=true ;;
@@ -65,6 +66,8 @@ while getopts xmGl:wkjvref:s:p:n:S:I:-: opt; do
                        include_opts="$include_opts -I $OPTARG"
                        xinclude_opts="$xinclude_opts -i $OPTARG"
                        minclude_opts="$minclude_opts +incdir+$OPTARG" ;;
+               A)
+                       abcprog="$OPTARG" ;;
                -)
                        case "${OPTARG}" in
                            xfirrtl)
@@ -147,7 +150,7 @@ do
                if [[ "$ext" == "v" ]]; then
                        egrep -v '^\s*`timescale' ../$fn > ${bn}_ref.${ext}
                elif [[ "$ext" == "aig" ]] || [[ "$ext" == "aag" ]]; then
-                       "$toolsdir"/../../yosys-abc -c "read_aiger ../${fn}; write ${bn}_ref.${refext}"
+                       $abcprog -c "read_aiger ../${fn}; write ${bn}_ref.${refext}"
                else
                        refext=$ext
                        cp ../${fn} ${bn}_ref.${refext}