entity blabla is
generic(
register_width : integer := 32;
--Assuming register_width > 4
constant AVAILABLE_FOR_USER : integer := register_width - 4 --allowed in 2008
);
port (
clk : in std_logic;
rst : in std_logic;
reg : out std_logic_vector(AVAILABLE_FOR_USER-1 downto 0)
);
end blabla;
What would be the reason for using a constant in a common block if an instance can simply override it?
Is there a way to create a constant based on a generic type that cannot be overridden during instance creation?
or my example above, I can just substitute the calculation every time I want to use a constant, but it does not seem elegant, and if my state changes, it can cause a lot of errors and possible errors, which it increases
source
share