diff options
-rw-r--r-- | iirs_utils.adb | 3 | ||||
-rw-r--r-- | testsuite/gna/bug21078/foo.vhdl | 68 | ||||
-rwxr-xr-x | testsuite/gna/bug21078/testsuite.sh | 9 |
3 files changed, 79 insertions, 1 deletions
diff --git a/iirs_utils.adb b/iirs_utils.adb index 904b42120..35cbbef23 100644 --- a/iirs_utils.adb +++ b/iirs_utils.adb @@ -191,7 +191,8 @@ package body Iirs_Utils is | Iir_Kind_Simple_Aggregate | Iir_Kind_Dereference | Iir_Kind_Implicit_Dereference - | Iir_Kind_Unit_Declaration => + | Iir_Kind_Unit_Declaration + | Iir_Kinds_Concurrent_Statement => return Adecl; when Iir_Kind_Simple_Name | Iir_Kind_Selected_Name => diff --git a/testsuite/gna/bug21078/foo.vhdl b/testsuite/gna/bug21078/foo.vhdl new file mode 100644 index 000000000..c490c8f4b --- /dev/null +++ b/testsuite/gna/bug21078/foo.vhdl @@ -0,0 +1,68 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity foo is +end entity; + +architecture fum of foo is + + signal ia: std_logic_vector(15 downto 0); + signal clock: std_logic:='0'; + signal cw: unsigned(15 downto 0):=(others => '0'); +begin + + -- counter and cw are converted to UNSIGNED to use numeric_std "+" + + +CTR: process (clock) + + variable counter : unsigned (15 downto 0) := x"0000"; + variable op : std_logic_vector (7 downto 0); + + begin + + if clock'event and clock='1' then + + op := std_logic_vector(cw (15 downto 8)); + + -- This if statement is misbehaving + if (op = x"20") then + counter := counter + cw (7 downto 0); + end if; + + counter := counter + 2; + + ia <= std_logic_vector(counter); + + end if; + + end process; + +CLK: process + begin + if Now <= 200 ns then + wait for 10 ns; + clock <= not clock; + else + wait; + end if; + + end process; + +STIMULUS: + process (clock) + begin + if clk'event and clock = '1' then + if Now = 110 ns then + cw <= X"200F"; + else + cw <= (others => '0'); + end if; + end if; + end process; + +end architecture; + + + diff --git a/testsuite/gna/bug21078/testsuite.sh b/testsuite/gna/bug21078/testsuite.sh new file mode 100755 index 000000000..88cd64e80 --- /dev/null +++ b/testsuite/gna/bug21078/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze_failure foo.vhdl + +clean + +echo "Test successful" |