blob: 232419e065f4a28809c6ee3128958c4081d45885 (
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
|
package pkg2 is
generic (
type atyp;
function plus (a: atyp) return natural is <>);
function wrap (a : atyp) return natural;
end pkg2;
package body pkg2 is
function wrap (a : atyp) return natural is
begin
return plus (a);
end wrap;
end pkg2;
entity tb_pkg2 is
end;
architecture behav of tb_pkg2 is
constant plus : natural := 5;
package my_pkg2 is new work.pkg2
generic map (atyp => bit_vector, plus => plus);
constant c : natural := my_pkg2.wrap("0101");
begin
assert c = 4 severity failure;
end behav;
|