package bar is
function gen_baz(l: positive) return bit_vector;
end;
package body bar is
function gen_baz(l: positive) return bit_vector is begin
return 10X"240";
end;
end;
package qux is
generic (
X: positive;
BAZ: bit_vector := work.bar.gen_baz(X)
);
subtype baz_t is bit_vector(BAZ'high downto BAZ'low);
function get_qux(state: baz_t) return baz_t;
end;
package body qux is
function get_qux(state: baz_t) return baz_t is begin
return 10D"501";
end;
end;
entity test is end;
architecture test of test is
package pkg is new work.qux generic map (X => 10);
signal s0: pkg.baz_t;
begin
process begin
s0 <= pkg.baz_t'value(10D"500");
s0 <= pkg.get_qux(s0);
wait;
end process;
end;
gdb$ p dump(tree_container(decl))
use STD.STANDARD.all;
architecture WORK.TEST-TEST of TEST is
package PKG is
-- Instantiated from WORK.QUX
generic (
constant X : in POSITIVE;
constant BAZ : in BIT_VECTOR := GEN_BAZ(10) );
generic map (10, GEN_BAZ(10));
subtype BAZ_T is BIT_VECTOR(BAZ'HIGH downto BAZ'LOW);
function GET_QUX ( constant STATE : in BAZ_T ) return BAZ_T;
-- WORK.TEST-TEST.PKG.GET_QUX(24WORK.TEST-TEST.PKG.BAZ_T)24WORK.TEST-TEST.PKG.BAZ_T
function GET_QUX ( constant STATE : in BAZ_T ) return BAZ_T is
-- WORK.TEST-TEST.PKG.GET_QUX(24WORK.TEST-TEST.PKG.BAZ_T)24WORK.TEST-TEST.PKG.BAZ_T
begin
return "0111110101";
end function;
end package;
signal S0 : BAZ_T;
begin
process is
begin
S0 <= reject 0 ps inertial BAZ_T'VALUE("0111110100");
S0 <= reject 0 ps inertial GET_QUX(S0);
wait;
end process;
end architecture;
Elaborating the following program
fails with the following error:
I think the root of the problem is that
tree_container
is getting the architecture instead of the package instance: