aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1218/tb_top.vhdl
blob: 590913c9bf0eb3f0cc43d68aae15880d80d9f064 (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
39
40
41
entity tb_top is
end tb_top;

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

architecture behav of tb_top is
  signal ch : integer range 0 to 7;
  signal din : unsigned(7 downto 0);
  signal dout : unsigned(7 downto 0);
begin
  dut: entity work.top
    port map (ch, din, dout);

  process
  begin
    report "test shift by 0 + 1";
    
    ch <= 0;
    din <= x"e7";
    wait for 1 ns;
    assert dout = x"73" severity failure;

    report "test shift by 3 + 1";
    
    ch <= 3;
    din <= x"7e";
    wait for 1 ns;
    assert dout = x"07" severity failure;

    report "test shift by 7 + 1";
    
    ch <= 7;
    din <= x"9b";
    wait for 1 ns;
    assert dout = x"00" severity failure;

    wait;
  end process;
end behav;