Added frontend (-f) option to autotest.sh
authorClifford Wolf <clifford@clifford.at>
Sat, 15 Feb 2014 14:40:17 +0000 (15:40 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 15 Feb 2014 14:40:17 +0000 (15:40 +0100)
tests/tools/autotest.sh

index 7bccd9a5abf360bcf9cf26c1c2f8cd0ab32fb8ac..0e6c357c7aebface9e93f4c19e2fa4c286c3e614 100755 (executable)
@@ -6,6 +6,7 @@ use_xsim=false
 use_modelsim=false
 verbose=false
 keeprunning=false
+frontend="verilog"
 backend_opts="-noattr -noexpr"
 scriptfiles=""
 scriptopt=""
@@ -15,7 +16,7 @@ if [ ! -f $toolsdir/cmp_tbdata -o $toolsdir/cmp_tbdata.c -nt $toolsdir/cmp_tbdat
        ( set -ex;  gcc -Wall -o $toolsdir/cmp_tbdata $toolsdir/cmp_tbdata.c; ) || exit 1
 fi
 
-while getopts xml:wkvrs:p: opt; do
+while getopts xml:wkvrf:s:p: opt; do
        case "$opt" in
                x)
                        use_xsim=true ;;
@@ -31,13 +32,15 @@ while getopts xml:wkvrs:p: opt; do
                        verbose=true ;;
                r)
                        backend_opts="$backend_opts -norename" ;;
+               f)
+                       frontend="$OPTARG" ;;
                s)
                        [[ "$OPTARG" == /* ]] || OPTARG="$PWD/$OPTARG"
                        scriptfiles="$scriptfiles $OPTARG" ;;
                p)
                        scriptopt="$OPTARG" ;;
                *)
-                       echo "Usage: $0 [-x|-m] [-w] [-k] [-v] [-r] [-l libs] [-s script] [-p cmdstring] verilog-files\n" >&2
+                       echo "Usage: $0 [-x|-m] [-w] [-k] [-v] [-r] [-l libs] [-f frontend] [-s script] [-p cmdstring] verilog-files\n" >&2
                        exit 1
        esac
 done
@@ -111,10 +114,10 @@ do
                if [ -n "$scriptfiles" ]; then
                        test_passes
                elif [ -n "$scriptopt" ]; then
-                       test_passes -p "$scriptopt"
+                       test_passes -f "$frontend" -p "$scriptopt"
                else
-                       test_passes -p "hierarchy; proc; opt; memory; opt; fsm; opt"
-                       test_passes -p "hierarchy; proc; opt; memory; opt; fsm; opt; techmap; opt; abc -dff; opt"
+                       test_passes -f "$frontend" -p "hierarchy; proc; opt; memory; opt; fsm; opt"
+                       test_passes -f "$frontend" -p "hierarchy; proc; opt; memory; opt; fsm; opt; techmap; opt; abc -dff; opt"
                fi
                touch ../${bn}.log
        }