From f9102057180443575edcebe71edb6c3eb1fc571d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 3 Nov 2019 07:40:18 +0100 Subject: testsuite/synth/var01: add more tests. --- testsuite/synth/var01/tb_var01a.vhdl | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 testsuite/synth/var01/tb_var01a.vhdl (limited to 'testsuite/synth/var01/tb_var01a.vhdl') diff --git a/testsuite/synth/var01/tb_var01a.vhdl b/testsuite/synth/var01/tb_var01a.vhdl new file mode 100644 index 000000000..3712f1d8b --- /dev/null +++ b/testsuite/synth/var01/tb_var01a.vhdl @@ -0,0 +1,51 @@ +entity tb_var01a is +end tb_var01a; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_var01a is + signal clk : std_logic; + signal mask : std_logic_vector (1 downto 0); + signal val : std_logic_vector (7 downto 0); + signal res : std_logic_vector (7 downto 0); +begin + dut: entity work.var01a + port map ( + clk => clk, + mask => mask, + val => val, + res => res); + + process + procedure pulse is + begin + clk <= '0'; + wait for 1 ns; + clk <= '1'; + wait for 1 ns; + end pulse; + begin + mask <= "11"; + val <= x"12"; + pulse; + assert res = x"12" report "res=" & to_hstring (res) severity failure; + + mask <= "10"; + val <= x"9a"; + pulse; + assert res = x"92" severity failure; + + mask <= "00"; + val <= x"00"; + pulse; + assert res = x"92" severity failure; + + mask <= "01"; + val <= x"de"; + pulse; + assert res = x"9e" severity failure; + + wait; + end process; +end behav; -- cgit v1.2.3