From d71a4391c20867d7e7ccc3a71a90cc4743fef610 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 15 Apr 2022 11:42:06 +0200 Subject: testsuite/gna: add a test for previous commit --- testsuite/gna/bug0129/repro1.vhdl | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 testsuite/gna/bug0129/repro1.vhdl (limited to 'testsuite/gna/bug0129/repro1.vhdl') diff --git a/testsuite/gna/bug0129/repro1.vhdl b/testsuite/gna/bug0129/repro1.vhdl new file mode 100644 index 000000000..0f91edfac --- /dev/null +++ b/testsuite/gna/bug0129/repro1.vhdl @@ -0,0 +1,52 @@ +library IEEE; +use IEEE.std_logic_1164.all; + +entity repro1 is + port (tready : inout std_logic); +end; + +architecture RTL of repro1 is + +-- signal tready : std_logic; + signal cnt : natural; + signal cnt_next : natural; +begin + + p_main: process (all) + + procedure count ( + constant r_ctr : in natural; + variable v_ctr : out natural + ) is + begin + if tready = '1' then + v_ctr := r_ctr + 1; + else + v_ctr := r_ctr; + end if; + end procedure; + + variable v : natural; + + begin + report "execution of process p_main, cnt=" & natural'image(cnt); + count (cnt, v); + + cnt_next <= v; + end process p_main; + + process + begin + tready <= '1'; + cnt <= 1; + wait for 1 ns; + assert cnt_next = 2 severity failure; + cnt <= 2; + wait for 1 ns; + assert cnt_next = 3 severity failure; + tready <= '0'; + wait for 1 ns; + assert cnt_next = 2 severity failure; + wait; + end process; +end; -- cgit v1.2.3