From 047a8c2a033ac21ac17b5d05584795f83cfcd776 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 18 Feb 2018 07:39:30 +0100 Subject: Add reproducer for #529 --- testsuite/gna/issue529/impure1.vhdl | 38 +++++++++++++++++++++++++++++++++++++ testsuite/gna/issue529/impure2.vhdl | 27 ++++++++++++++++++++++++++ testsuite/gna/issue529/testsuite.sh | 14 ++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 testsuite/gna/issue529/impure1.vhdl create mode 100644 testsuite/gna/issue529/impure2.vhdl create mode 100755 testsuite/gna/issue529/testsuite.sh (limited to 'testsuite/gna/issue529') diff --git a/testsuite/gna/issue529/impure1.vhdl b/testsuite/gna/issue529/impure1.vhdl new file mode 100644 index 000000000..7cd3181d2 --- /dev/null +++ b/testsuite/gna/issue529/impure1.vhdl @@ -0,0 +1,38 @@ +library ieee; + use ieee.std_logic_1164.all; + +entity impure_ex is +port ( + clk : in std_logic; + arg : in std_logic; + res : out std_logic +); +end impure_ex; + +architecture rtl of impure_ex is + + -- An impure function called from a combinatorial process with "all" + -- sensitivity triggers an exception. + impure function foo return std_logic is + begin + return arg; + end function foo; + + signal ns : std_logic; + +begin + + --comb_process : process(res) -- this works + comb_process : process(all) + begin + ns <= res XOR foo; + end process; + + process(clk) + begin + if rising_edge(clk) then + res <= ns; + end if; + end process; + +end rtl; diff --git a/testsuite/gna/issue529/impure2.vhdl b/testsuite/gna/issue529/impure2.vhdl new file mode 100644 index 000000000..83f37ccc0 --- /dev/null +++ b/testsuite/gna/issue529/impure2.vhdl @@ -0,0 +1,27 @@ +entity impure_ex2 is +port ( + clk : in bit; + arg : in bit; + res : out bit +); +end impure_ex2; + +architecture rtl of impure_ex2 is + + -- An impure function called from a combinatorial process with "all" + -- sensitivity triggers an exception. + impure function foo return bit is + begin + return arg; + end function foo; + + signal ns : bit; + +begin + + --comb_process : process(res) -- this works + comb_process : process(all) + begin + ns <= res XOR foo; + end process; +end rtl; diff --git a/testsuite/gna/issue529/testsuite.sh b/testsuite/gna/issue529/testsuite.sh new file mode 100755 index 000000000..d5acb6a05 --- /dev/null +++ b/testsuite/gna/issue529/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze impure1.vhdl +elab_simulate impure_ex + +analyze impure2.vhdl +elab_simulate impure_ex2 + +clean + +echo "Test successful" -- cgit v1.2.3