VHDL generics can have a default value.
The rules for how they are overridden in instantiations and declarations seems to be rather complex, so I wanted to ask about the easiest and safest practices to lower the risk of simulation and synthesis mismatches due to avoidable code bugs or tool issues.
Here is a simple example. What would you do?
Definition:
entity counter is
generic(
G_NBITS : integer range 1 to 8 := 3
);
...
Declaration:
architecture behav of counter_tb is
component counter is
generic(
G_NBITS : integer range 1 to 8 := 4
);
Instantiation:
begin
counter_inst0 : counter
generic map (
G_NBITS => 5
)