aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/func01/tb_func08.vhdl
blob: 792d9199292e0b0c1f9e5d029e19a4fbf7c4a60b (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
entity tb_func08 is
end tb_func08;

library ieee;
use ieee.std_logic_1164.all;

architecture behav of tb_func08 is
  signal v : std_ulogic_vector(31 downto 0);
  signal r : integer;
begin
  dut: entity work.func08
    port map (v, r);

  process
  begin
    v <= x"00000000";
    wait for 1 ns;
    assert r = 32 severity failure;

    v <= x"0000_0001";
    wait for 1 ns;
    assert r = 31 severity failure;

    v <= x"8000_0000";
    wait for 1 ns;
    assert r = 0 severity failure;

    v <= x"0001_00f0";
    wait for 1 ns;
    assert r = 15 severity failure;

    wait;
  end process;
end behav;