rust_hdl icon indicating copy to clipboard operation
rust_hdl copied to clipboard

Externally visible generics

Open kraigher opened this issue 6 years ago • 0 comments

There is uncertainty in the standard regarding externally visible generics:

Se GHDL issue: https://github.com/ghdl/ghdl/issues/440

package gpkg is
  generic (const : natural);
end package;

package ipkg is new work.gpkg generic map (const => 1);

entity ent is
end entity

architecture a of ent is
begin
  main : process
     -- Case 1
     assert work.ipkg.const = 1; -- Should this result in a 'no declaration of const' error?
     -- case 2     
     assert << constant @work.ipkg.const : natural>> = 1; -- Should this be visible?
  end process;
end architecture;

kraigher avatar Dec 06 '18 11:12 kraigher