diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-10-02 19:21:00 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-10-02 19:21:21 +0200 |
commit | d6a6572439a1f3d7d8c55ae181b978d693ab85d2 (patch) | |
tree | 6aaebdf0043acab8768145d87a1347247c90f205 /testsuite/issues/issue158/repro1.vhdl | |
parent | a0b84cc52e26bfaf35a947a8e7e76b576b4d92c0 (diff) | |
download | ghdl-yosys-plugin-d6a6572439a1f3d7d8c55ae181b978d693ab85d2.tar.gz ghdl-yosys-plugin-d6a6572439a1f3d7d8c55ae181b978d693ab85d2.tar.bz2 ghdl-yosys-plugin-d6a6572439a1f3d7d8c55ae181b978d693ab85d2.zip |
testsuite: add a test for #158
Diffstat (limited to 'testsuite/issues/issue158/repro1.vhdl')
-rw-r--r-- | testsuite/issues/issue158/repro1.vhdl | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testsuite/issues/issue158/repro1.vhdl b/testsuite/issues/issue158/repro1.vhdl new file mode 100644 index 0000000..b3450cc --- /dev/null +++ b/testsuite/issues/issue158/repro1.vhdl @@ -0,0 +1,56 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity MUX_uint4 is + port( + cond : in std_logic_vector(0 downto 0); + iftrue : in std_logic_vector(3 downto 0); + iffalse : in std_logic_vector(3 downto 0); + return_output : out std_logic_vector(3 downto 0)); +end; +architecture arch of MUX_uint4 is +begin + return_output <= iftrue when cond = "1" else iffalse; +end arch; + +library ieee; +use ieee.std_logic_1164.all; + +entity repro1 is + port( + clk : in std_logic; + CLOCK_ENABLE : in std_logic_vector(0 downto 0); + module_to_clk_cross : out std_ulogic); +end; + +architecture arch of repro1 is + type variables_t is record + c3_8e8a_cond : std_logic_vector(0 downto 0); + c3_8e8a_iffalse : std_logic_vector(3 downto 0); + c3_8e8a_iftrue : std_logic_vector(3 downto 0); + c3_8e8a_return_output : std_logic_vector(3 downto 0); + end record; + + signal c3_8e8a_cond : std_logic_vector(0 downto 0); + signal c3_8e8a_iftrue : std_logic_vector(3 downto 0); + signal c3_8e8a_iffalse : std_logic_vector(3 downto 0); + signal c3_8e8a_return_output : std_logic_vector(3 downto 0); +begin + c3_8e8a : entity work.MUX_uint4 port map ( + c3_8e8a_cond, + c3_8e8a_iftrue, + c3_8e8a_iffalse, + c3_8e8a_return_output); + + process (CLOCK_ENABLE) is + variable read_pipe : variables_t; + variable write_pipe : variables_t; + begin + write_pipe := read_pipe; + c3_8e8a_cond <= write_pipe.c3_8e8a_cond; + c3_8e8a_iftrue <= write_pipe.c3_8e8a_iftrue; + c3_8e8a_iffalse <= write_pipe.c3_8e8a_iffalse; + write_pipe.c3_8e8a_return_output := c3_8e8a_return_output; + read_pipe := write_pipe; + end process; +end arch; |