X
XYZ
Hi,
How to set a default value for an unconstrained port? Doing it this way
input : in std_logic_vector;
val : in std_logic_vector := (others => '0');
doesn't work as val'range is not known and obviously I end up with
ModelSim error "OTHERS choice can not be used in unconstrained array
aggregate."
I know, however, that val'range should be the same as input'range. Is
there any way to define a default value for val vector based on input
(input is constrained by higher entity). I need something like
val : in std_logic_vector := (input'range => '0')
I'm afraid that even if there exist different method than OTHERS to
create a vector I wouldn't be allowed to use input'range because of
"object 'input' cannot be used within the same interface as it is
declared" error.
Is it better to switch to generics rather than use unconstrained ports?
Thanks.
How to set a default value for an unconstrained port? Doing it this way
input : in std_logic_vector;
val : in std_logic_vector := (others => '0');
doesn't work as val'range is not known and obviously I end up with
ModelSim error "OTHERS choice can not be used in unconstrained array
aggregate."
I know, however, that val'range should be the same as input'range. Is
there any way to define a default value for val vector based on input
(input is constrained by higher entity). I need something like
val : in std_logic_vector := (input'range => '0')
I'm afraid that even if there exist different method than OTHERS to
create a vector I wouldn't be allowed to use input'range because of
"object 'input' cannot be used within the same interface as it is
declared" error.
Is it better to switch to generics rather than use unconstrained ports?
Thanks.