aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/ticket24/testsuite.sh
blob: 136317e17c28ef18b5e0dee33f6ed85eef6584b4 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/sh

. ../../testenv.sh

GHDL_STD_FLAGS="-fpsl"
analyze psl.vhdl
elab psl
if ghdl_has_feature psl psl; then
  simulate psl --psl-report=psl.out

  if ! diff --strip-trailing-cr psl.out psl.ref > /dev/null; then
      echo "report mismatch"
      exit 1
  fi

  rm -f psl.out
fi
clean

# Using vhdl 08
GHDL_STD_FLAGS="-fpsl --std=08"
analyze psl.vhdl
elab -fpsl psl
if ghdl_has_feature psl psl; then
  simulate psl --psl-report=psl.out

  diff --strip-trailing-cr -q psl.out psl.ref

  rm -f psl.out
fi
clean

# Usage example (python 2.7):
#
# import json
# d=json.load(open("psl.out"))
# print d['summary']
#  {u'assert-pass': 2, u'cover': 1, ... }
# print d['summary']['assert']

echo "Test successful"