aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-16 07:30:00 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-16 07:30:00 +0200
commit57cf7923209710dd45870ae42d38581747f81e99 (patch)
treef55c9ec2b82c76a14e94e9f92cb641e5ea665e1e
parentc033bff91ebf329f3876d70b49588e1d785fc1f7 (diff)
downloadghdl-57cf7923209710dd45870ae42d38581747f81e99.tar.gz
ghdl-57cf7923209710dd45870ae42d38581747f81e99.tar.bz2
ghdl-57cf7923209710dd45870ae42d38581747f81e99.zip
testsuite/gna: add a test for #1371
-rw-r--r--testsuite/gna/issue1371/incr_psl.vhdl26
-rwxr-xr-xtestsuite/gna/issue1371/testsuite.sh10
2 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/gna/issue1371/incr_psl.vhdl b/testsuite/gna/issue1371/incr_psl.vhdl
new file mode 100644
index 000000000..87e0d8c0b
--- /dev/null
+++ b/testsuite/gna/issue1371/incr_psl.vhdl
@@ -0,0 +1,26 @@
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.NUMERIC_STD.ALL;
+
+-- This could be combinational but GHDL does not support @(True) PSL yet
+entity incr_psl is
+ Port (
+ clk: in STD_LOGIC;
+ in_val: in UNSIGNED(7 downto 0);
+ out_val: out UNSIGNED(7 downto 0)
+ );
+end entity;
+
+architecture Behavioral of incr_psl is
+ signal out_val_internal: UNSIGNED(7 downto 0);
+begin
+ out_val_internal <= in_val + 1;
+ out_val <= out_val_internal;
+ -- psl default clock is rising_edge(clk);
+
+ -- The combination of the two below work
+ -- psl assert always (in_val = 0 -> out_val_internal = 1);
+ -- psl assert always (out_val_internal = 1 -> in_val = 0);
+ -- This causes an error
+ -- psl assert always (in_val = 0 <-> out_val_internal = 1);
+end Behavioral;
diff --git a/testsuite/gna/issue1371/testsuite.sh b/testsuite/gna/issue1371/testsuite.sh
new file mode 100755
index 000000000..c13fca038
--- /dev/null
+++ b/testsuite/gna/issue1371/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=-fpsl
+analyze incr_psl.vhdl
+
+clean
+
+echo "Test successful"