aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2288/tb_minimal.vhdl
blob: e241c2560bddacd8ba6f3b936e638dbfef18ec41 (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
library ieee;
use ieee.std_logic_1164.all;

entity tb_minimal is
end tb_minimal;

architecture rtl of tb_minimal is
begin
  MAIN_PROC : process

    function fun return std_ulogic_vector is
      variable v_return : std_ulogic_vector(0 to 3) := x"A";
    begin
      return v_return;
    end function fun;

    variable v_result       : std_ulogic_vector(0 to 7);
    variable v_some_data    : std_ulogic_vector(0 to 3) := x"B";
    variable v_fun_result : std_ulogic_vector(0 to 3);
  begin

    -- working:
    -- v_fun_result := fun;
    -- v_result     := std_ulogic_vector'(v_some_data, v_fun_result);

    -- not working:
    v_result       := std_ulogic_vector'(v_some_data, fun);

    report "result= 0x" & to_hstring(v_result);
    assert v_result = x"BA" severity failure;
    wait;
  end process;

end architecture;