diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-03-15 07:47:24 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-03-15 07:47:24 +0100 |
commit | 7a71af5845b0789d2a8169336d0e07a4c27beb1d (patch) | |
tree | 106fa04deadc42134bdae05130e07f49a6e51f74 /testsuite/ghdl-issues/issue2392/dut.vhdl | |
parent | dbd1c189a8fff1e7c322ffd7264ea339bf911115 (diff) | |
download | ghdl-yosys-plugin-7a71af5845b0789d2a8169336d0e07a4c27beb1d.tar.gz ghdl-yosys-plugin-7a71af5845b0789d2a8169336d0e07a4c27beb1d.tar.bz2 ghdl-yosys-plugin-7a71af5845b0789d2a8169336d0e07a4c27beb1d.zip |
testsuite: add a test for #2392
Diffstat (limited to 'testsuite/ghdl-issues/issue2392/dut.vhdl')
-rw-r--r-- | testsuite/ghdl-issues/issue2392/dut.vhdl | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/ghdl-issues/issue2392/dut.vhdl b/testsuite/ghdl-issues/issue2392/dut.vhdl new file mode 100644 index 0000000..d21c825 --- /dev/null +++ b/testsuite/ghdl-issues/issue2392/dut.vhdl @@ -0,0 +1,51 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity dut is + port( + clk_in: in std_logic; + + a1_in: in std_logic; + b1_out: out std_logic := '0'; + + a2_in: in std_logic; + b2_out: out std_logic := '0' + ); +end; + +architecture rtl of dut is + signal cnt: integer range 0 to 20 := 0; + + signal a2_prev: std_logic := '0'; +begin + process(clk_in) + begin + if rising_edge(clk_in) then + if cnt /= 20 then + cnt <= cnt + 1; + end if; + end if; + end process; + + process(clk_in) + begin + if rising_edge(clk_in) then + a2_prev <= a2_in; + + b1_out <= not a1_in; + if cnt = 20 then + b1_out <= a1_in; + end if; + end if; + end process; + + process(all) + begin + b2_out <= a2_prev; + if cnt = 20 then + b2_out <= not a2_in; + end if; + -- b2_out <= not a2_in; + end process; +end; + |