aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-12-13 13:35:52 +0100
committerTristan Gingold <tgingold@free.fr>2014-12-13 13:35:52 +0100
commit0c655ec98435f5d9bdfb51cab215002d794c263f (patch)
tree2bff5a580c0ec85a1537b70274bea0eeaf828c3c /testsuite/gna
parent6b0e4e8d1e42ac329e12fafa3758f3ccd106b436 (diff)
downloadghdl-0c655ec98435f5d9bdfb51cab215002d794c263f.tar.gz
ghdl-0c655ec98435f5d9bdfb51cab215002d794c263f.tar.bz2
ghdl-0c655ec98435f5d9bdfb51cab215002d794c263f.zip
Add ticket26 testcase.
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/ticket26/Makefile12
-rw-r--r--testsuite/gna/ticket26/psl_test_named_statement.vhd55
-rwxr-xr-xtestsuite/gna/ticket26/testsuite.sh17
3 files changed, 84 insertions, 0 deletions
diff --git a/testsuite/gna/ticket26/Makefile b/testsuite/gna/ticket26/Makefile
new file mode 100644
index 000000000..b00869606
--- /dev/null
+++ b/testsuite/gna/ticket26/Makefile
@@ -0,0 +1,12 @@
+psl_test_cover: psl_test_named_statement.vhd
+ ghdl -a --std=02 -fpsl psl_test_named_statement.vhd
+ ghdl -e --std=02 -fpsl psl_test_named_statement
+ ./psl_test_named_statement --stop-time=200ns
+
+all: clean psl_test_named_statement
+
+.PHONY: clean
+clean:
+ rm -f *.cf
+ rm -f *.o
+ rm -f psl_test_named_statement \ No newline at end of file
diff --git a/testsuite/gna/ticket26/psl_test_named_statement.vhd b/testsuite/gna/ticket26/psl_test_named_statement.vhd
new file mode 100644
index 000000000..d99626c1a
--- /dev/null
+++ b/testsuite/gna/ticket26/psl_test_named_statement.vhd
@@ -0,0 +1,55 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+
+
+entity psl_test_named_statement is
+end entity psl_test_named_statement;
+
+
+architecture test of psl_test_named_statement is
+
+
+ signal s_rst_n : std_logic := '0';
+ signal s_clk : std_logic := '0';
+ signal s_write : std_logic;
+ signal s_read : std_logic;
+
+
+begin
+
+
+ s_rst_n <= '1' after 100 ns;
+ s_clk <= not s_clk after 10 ns;
+
+
+ TestP : process is
+ begin
+ report "RUNNING psl_test_named_statement test case";
+ report "==========================================";
+ s_write <= '0'; -- named assertion should hit
+ s_read <= '0';
+ wait until s_rst_n = '1' and rising_edge(s_clk);
+ s_write <= '1';
+ wait until rising_edge(s_clk);
+ s_read <= '1'; -- assertion should hit
+ wait until rising_edge(s_clk);
+ s_write <= '0';
+ s_read <= '0';
+ wait;
+ end process TestP;
+
+
+ -- -psl statements
+
+ -- psl default clock is rising_edge(s_clk);
+
+ -- named statements seems to be not supported (ignored by GHDL)
+ -- psl RESET_CHECK : assert always not(s_rst_n) -> s_write;
+
+ -- statements without name work
+ -- - psl assert always s_write -> not(s_read);
+
+
+end architecture test;
diff --git a/testsuite/gna/ticket26/testsuite.sh b/testsuite/gna/ticket26/testsuite.sh
new file mode 100755
index 000000000..4d1d395c9
--- /dev/null
+++ b/testsuite/gna/ticket26/testsuite.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS="--std=02 -fpsl"
+analyze psl_test_named_statement.vhd
+elab_simulate psl_test_named_statement --stop-time=200ns 2>&1 | tee psl.out
+
+if ! grep -q "psl assertion error" psl.out; then
+ echo "missing psl error"
+ exit 1
+fi
+
+clean
+rm -f psl.out
+
+echo "Test successful"