diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-02-01 11:23:09 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-02-01 11:23:09 +0100 |
commit | 931ee6aa4161cecc46f0370623415116cf1a1d69 (patch) | |
tree | 7b00961856e83ea1483790ade4a6f3fbc27d8e57 /testsuite/synth/dff02/tb_dff08d.vhdl | |
parent | 1fe0dce8f25255bcf9a3a3cfe317f763f1e410ce (diff) | |
download | ghdl-931ee6aa4161cecc46f0370623415116cf1a1d69.tar.gz ghdl-931ee6aa4161cecc46f0370623415116cf1a1d69.tar.bz2 ghdl-931ee6aa4161cecc46f0370623415116cf1a1d69.zip |
testsuite/synth: add more tests for #1122
Diffstat (limited to 'testsuite/synth/dff02/tb_dff08d.vhdl')
-rw-r--r-- | testsuite/synth/dff02/tb_dff08d.vhdl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/synth/dff02/tb_dff08d.vhdl b/testsuite/synth/dff02/tb_dff08d.vhdl new file mode 100644 index 000000000..b096a8de2 --- /dev/null +++ b/testsuite/synth/dff02/tb_dff08d.vhdl @@ -0,0 +1,55 @@ +entity tb_dff08d is +end tb_dff08d; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_dff08d is + signal clk : std_logic; + signal rst : std_logic; + signal en : std_logic; + signal din : std_logic_vector (7 downto 0); + signal dout : std_logic_vector (7 downto 0); +begin + dut: entity work.dff08d + port map ( + q => dout, + d => din, + en => en, + clk => clk, + rst => rst); + + process + procedure pulse is + begin + clk <= '0'; + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + end pulse; + begin + wait for 1 ns; + assert dout = x"aa" severity failure; + + rst <= '1'; + pulse; + assert dout = x"aa" severity failure; + + rst <= '0'; + din <= x"38"; + pulse; + assert dout = x"38" severity failure; + + din <= x"af"; + pulse; + assert dout = x"af" severity failure; + + en <= '1'; + rst <= '1'; + din <= x"b5"; + pulse; + assert dout = x"aa" severity failure; + + wait; + end process; +end behav; |