aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue265/ex1_top.vhdl
blob: 3771353bae8fef3cb6b020192353276674032634 (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
library IEEE;
use     IEEE.std_logic_1164.all;

entity ex1_top is
end entity;

architecture a of ex1_top is
  signal A : boolean;
  
  function conv_inst_top(p : std_logic) return boolean is
  begin
    return (p = '0'); -- inverter
  end function;
  
  function conv_top_inst(p : boolean) return std_logic is
  begin
    if (p = FALSE) then
      return '0'; -- identity
    elsif (p = TRUE) then
      return '1'; -- identity
    else
      return 'X'; -- error
    end if;
  end function;
begin
  A <= TRUE;

  inst : entity work.ex1_entity
    port map (
      conv_inst_top(X) => conv_top_inst(A)
    );
end architecture;