diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-03-26 18:37:16 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-03-27 08:46:30 +0100 |
commit | ba2d9a39cb0c90c49f44d0d52258e8cc4920e15e (patch) | |
tree | 23bd085596edb6d38b6e6cd90bf55269348ed33d /testsuite/synth/issue1675/tb_accumwr.vhdl | |
parent | c6d3502d93ee22092799d3d4747be57bdd541e38 (diff) | |
download | ghdl-ba2d9a39cb0c90c49f44d0d52258e8cc4920e15e.tar.gz ghdl-ba2d9a39cb0c90c49f44d0d52258e8cc4920e15e.tar.bz2 ghdl-ba2d9a39cb0c90c49f44d0d52258e8cc4920e15e.zip |
testsuite/synth: Add a test case. For #1675
Diffstat (limited to 'testsuite/synth/issue1675/tb_accumwr.vhdl')
-rw-r--r-- | testsuite/synth/issue1675/tb_accumwr.vhdl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/synth/issue1675/tb_accumwr.vhdl b/testsuite/synth/issue1675/tb_accumwr.vhdl new file mode 100644 index 000000000..ead0fe966 --- /dev/null +++ b/testsuite/synth/issue1675/tb_accumwr.vhdl @@ -0,0 +1,41 @@ +entity tb_accumwr is +end tb_accumwr; + +library ieee; +use ieee.std_logic_1164.all; + +use work.pkg.all; + +architecture behav of tb_accumwr is + signal clk : std_logic; + signal rst : std_logic; + signal en : std_logic; + signal res : std_logic_vector(15 downto 0); +begin + dut: entity work.accumwr + port map (clk, rst, en, res); + + process + procedure pulse is + begin + clk <= '0'; + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + end pulse; + begin + rst <= '1'; + en <= '0'; + pulse; + assert res = x"0000" severity failure; + + rst <= '0'; + pulse; + assert res = x"0000" severity failure; + + en <= '1'; + pulse; + assert res = x"0001" severity failure; + wait; + end process; +end behav; |