aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/testenv.sh116
1 files changed, 58 insertions, 58 deletions
diff --git a/testsuite/testenv.sh b/testsuite/testenv.sh
index 070d3eb8f..4de0838a4 100644
--- a/testsuite/testenv.sh
+++ b/testsuite/testenv.sh
@@ -30,8 +30,8 @@ ANSI_GREEN="\033[32m"
if [ -z "$ENABLECOLOR" ]; then unset ANSI_NOCOLOR ANSI_RED ANSI_BLUE ANSI_GREEN; fi
if [ x"$GHDL" = x ]; then
- echo "error: GHDL environment variable is not defined"
- exit 4
+ echo "error: GHDL environment variable is not defined"
+ exit 4
fi
PYTHON=${PYTHON:-python3}
@@ -39,107 +39,107 @@ PYTHON=${PYTHON:-python3}
# Analyze files (no error expected)
analyze ()
{
- echo "analyze $@"
- "$GHDL" -a $GHDL_STD_FLAGS $GHDL_FLAGS "$@"
+ echo "analyze $@"
+ "$GHDL" -a $GHDL_STD_FLAGS $GHDL_FLAGS "$@"
}
# Analyze files (failure expected)
analyze_failure ()
{
- echo "try to analyze $@"
- # for arg in $@; do echo "arg: $arg"; done
- if ! "$GHDL" -a --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS "$@" ; then
- echo "Failure expected"
- return 1
- fi
+ echo "try to analyze $@"
+ # for arg in $@; do echo "arg: $arg"; done
+ if ! "$GHDL" -a --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS "$@" ; then
+ echo "Failure expected"
+ return 1
+ fi
}
# Elaborate a design (no error expected)
# Note: somewhat deprecated, use elab_simulate instead.
elab ()
{
- echo "elaborate $@"
- "$GHDL" -e $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
+ echo "elaborate $@"
+ "$GHDL" -e $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
}
# Elaborate a design (failure expected)
# Note: somewhat deprecated, use elab_simulate_failure instead.
elab_failure ()
{
- echo "elaborate (failure expected) $@"
- "$GHDL" -e --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
+ echo "elaborate (failure expected) $@"
+ "$GHDL" -e --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
}
# Simulate a design (no error expected)
# Note: somewhat deprecated, use elab_simulate instead.
simulate ()
{
- echo "simulate $@ ($GHDL_FLAGS $@ $GHDL_SIMFLAGS)" >&2
- "$GHDL" -r $GHDL_STD_FLAGS $GHDL_FLAGS "$@" $GHDL_SIMFLAGS
- #./$@
+ echo "simulate $@ ($GHDL_FLAGS $@ $GHDL_SIMFLAGS)" >&2
+ "$GHDL" -r $GHDL_STD_FLAGS $GHDL_FLAGS "$@" $GHDL_SIMFLAGS
+ #./$@
}
# Simulate a design (failure expected)
# Note: somewhat deprecated, use elab_simulate_failure instead.
simulate_failure ()
{
- echo "simulate (failure expected) $@" >&2
- "$GHDL" -r $GHDL_STD_FLAGS $GHDL_FLAGS $@ --expect-failure
- #./$@
+ echo "simulate (failure expected) $@" >&2
+ "$GHDL" -r $GHDL_STD_FLAGS $GHDL_FLAGS $@ --expect-failure
+ #./$@
}
# Elaborate and simulate a design (no error expected)
elab_simulate ()
{
- echo "elaborate and simulate $@"
- "$GHDL" --elab-run $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
+ echo "elaborate and simulate $@"
+ "$GHDL" --elab-run $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS $@
}
# Elaborate and simulate a design (failure expected)
elab_simulate_failure ()
{
- echo "elaborate and simulate (failure expected) $@"
- "$GHDL" --elab-run $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS \
- $@ --expect-failure
+ echo "elaborate and simulate (failure expected) $@"
+ "$GHDL" --elab-run $GHDL_STD_FLAGS $GHDL_FLAGS $GHDL_ELABFLAGS \
+ $@ --expect-failure
}
synth()
{
- echo "Synthesis of $@" >&2
- "$GHDL" --synth $GHDL_STD_FLAGS $GHDL_FLAGS $@
+ echo "Synthesis of $@" >&2
+ "$GHDL" --synth $GHDL_STD_FLAGS $GHDL_FLAGS $@
}
synth_failure ()
{
- echo "try to synthesize $@"
- # for arg in $@; do echo "arg: $arg"; done
- if ! "$GHDL" --synth --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS "$@" ; then
- echo "Failure expected"
- return 1
- fi
+ echo "try to synthesize $@"
+ # for arg in $@; do echo "arg: $arg"; done
+ if ! "$GHDL" --synth --expect-failure $GHDL_STD_FLAGS $GHDL_FLAGS "$@" ; then
+ echo "Failure expected"
+ return 1
+ fi
}
# Synthesis of a single file and analyze the result
synth_analyze()
{
- synth $1.vhdl -e > syn_$1.vhdl
- analyze syn_$1.vhdl
+ synth $1.vhdl -e > syn_$1.vhdl
+ analyze syn_$1.vhdl
}
# Analyze and test $1
# Then synthesize and test the result
synth_tb()
{
- t=$1
+ t=$1
- analyze $t.vhdl tb_$t.vhdl
- elab_simulate tb_$t
- clean
+ analyze $t.vhdl tb_$t.vhdl
+ elab_simulate tb_$t
+ clean
- synth $t.vhdl -e $t > syn_$t.vhdl
- analyze syn_$t.vhdl tb_$t.vhdl
- elab_simulate tb_$t --ieee-asserts=disable-at-0
- clean
+ synth $t.vhdl -e $t > syn_$t.vhdl
+ analyze syn_$t.vhdl tb_$t.vhdl
+ elab_simulate tb_$t --ieee-asserts=disable-at-0
+ clean
}
# Check if a feature is present
@@ -156,28 +156,28 @@ ghdl_is_interpretation ()
# Run a program
run ()
{
- echo "run $@"
- eval $@
+ echo "run $@"
+ eval $@
}
# Run a program (failure expected)
run_failure ()
{
- echo "run (failure expected) $@"
- if eval $@; then
- echo "failure expected";
- false;
- fi
+ echo "run (failure expected) $@"
+ if eval $@; then
+ echo "failure expected";
+ false;
+ fi
}
# Be sure vpi can be used
add_vpi_path()
{
if [ "$OS" = "Windows_NT" ]; then
- # Need to put the directory containing libghdlvpi.dll in the path.
- vpi_lib=`$GHDL --vpi-library-dir-unix`
- echo vpi_lib: $vpi_lib
- PATH="$PATH:$vpi_lib"
+ # Need to put the directory containing libghdlvpi.dll in the path.
+ vpi_lib=`$GHDL --vpi-library-dir-unix`
+ echo vpi_lib: $vpi_lib
+ PATH="$PATH:$vpi_lib"
fi
}
@@ -190,11 +190,11 @@ clean ()
else
case "$1" in
--std=*)
- echo "Remove work library"
- "$GHDL" --remove $1 ;;
+ echo "Remove work library"
+ "$GHDL" --remove $1 ;;
*)
- echo "Remove $1 library"
- "$GHDL" --remove $GHDL_STD_FLAGS --work=$1 ;;
+ echo "Remove $1 library"
+ "$GHDL" --remove $GHDL_STD_FLAGS --work=$1 ;;
esac
fi
}