Open albydnc opened 2 months ago
Where do g_NUM_WORDS
and log2ceil
come from here? I tried to reproduce this with the following but didn't get any error:
package pack is
function f (x : integer) return integer;
end package;
package body pack is
function f (x : integer) return integer is
begin
return x;
end function;
end package body;
-------------------------------------------------------------------------------
entity sub is
generic (type t);
end entity;
architecture test of sub is
signal s : t;
begin
end architecture;
-------------------------------------------------------------------------------
use work.pack.all;
entity issue926 is
generic ( g : integer := 42 );
end entity;
architecture test of issue926 is
begin
u: entity work.sub
generic map ( t => bit_vector(f(g) - 1 downto 0) );
end architecture;
I have an entity with a generic type. If I use a derived type using a function to derive its range (e.g.
std_logic_vector(log2ceil(g_N_WORDS) -1 downto 0)
I get this error:However, if I declare a subtype in the architecture, it succeeds:
It also succeeds if I use attribute subtype: