aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/var01/tb_var04.vhdl
blob: 2de5ffcc22387b99feeef02d3a30378c59c10fe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
entity tb_var04 is
end tb_var04;

library ieee;
use ieee.std_logic_1164.all;

architecture behav of tb_var04 is
  signal clk : std_logic;
  signal mask : std_logic_vector (1 downto 0);
  signal val : std_logic_vector (15 downto 0);
  signal res : std_logic_vector (15 downto 0);
begin
  dut: entity work.var04
    port map (
      mask => mask,
      val => val,
      res => res);

  process
  begin
    mask <= "11";
    val <= x"aa_bb";
    wait for 1 ns;
    assert res = x"aa_bb" severity failure;

    mask <= "00";
    val <= x"12_34";
    wait for 1 ns;
    assert res = x"00_00" severity failure;

    mask <= "10";
    val <= x"12_34";
    wait for 1 ns;
    assert res = x"12_00" severity failure;

    wait;
  end process;
end behav;