aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/vpi/vpi003/testsuite.sh
blob: 508ad6b65dc3f721a91cf87cec7687dc495c9521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh

. ../../testenv.sh

analyze mydesign.vhdl
elab myentity

if ghdl_has_feature myentity vpi; then
  $GHDL --vpi-compile -v gcc -c vpi1.c
  $GHDL --vpi-link -v gcc -o vpi1.vpi vpi1.o

  add_vpi_path

  simulate myentity --vpi=./vpi1.vpi | tee myentity.out
  if grep -q Error myentity.out; then
      echo "Error in output"
      exit 1;
  fi
  if grep -q error myentity.out; then
      echo "error in output"
      exit 1;
  fi

  rm -f vpi1.vpi vpi1.o
fi
clean

echo "Test successful"