aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1886/tb_test.vhdl
blob: 148c67435b90dd2e4d44a16dd59cd52fe74448ce (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
entity tb_test is
end tb_test;

library ieee;
use ieee.std_logic_1164.all;

architecture behav of tb_test is
  signal crnum_in : std_ulogic_vector(2 downto 0) := "000";
  signal cr_in    : std_ulogic_vector(31 downto 0);
  signal crf_out  : std_ulogic_vector(3 downto 0);
begin
  dut: entity work.test
    port map (crnum_in, cr_in, crf_out);

  process
  begin
    cr_in <= x"01234567";

    crnum_in <= "000";
    wait for 1 ns;
    assert crf_out = x"0" severity failure;

    crnum_in <= "001";
    wait for 1 ns;
    assert crf_out = x"1" severity failure;

    crnum_in <= "100";
    wait for 1 ns;
    assert crf_out = x"4" severity failure;

    crnum_in <= "111";
    wait for 1 ns;
    assert crf_out = x"7" severity failure;

    wait;
  end process;
end behav;