test.vhd:
entity ent is generic (str : string); end entity; architecture a of ent is begin main : process begin report str; wait; end process; end architecture;
command line output:
ghdl -a test.vhd && ghdl --elab-run ent -gstr="hello world" error: entity "ent" cannot be at the top of a design test.vhd:2:12: (generic "str" has no default value) ghdl: compilation error
I see. Make sense. Give me a couple of days :-)
Now implemented.
Maybe the analyser should emit a warning for generics without a default value ???
Thanks, Tristan.
I think it better not warn about missing default values of generics on analysis.
Personally I tend to avoid having default values for generics which really should be explicitly set by the instantiating code such as
data_width : positive
and set default values for stuff which are optional such aswith_output_register : boolean := false
My idea was to warn only for the generics in the top-level unit. Still worth ?
In any case, we will see at usage.
Thanks,
Tristan.