Is it possible to do partial assignment to a record type on initialization?
Something like:
type t_foo is record
a : integer;
b : std_logic;
end record;
signal bar : t_foo := (b => '0');
In case of a normal signal assignment I could do:
bar.b <= '1';
This is however not possible when initializing a signal or constant. To me it looks like all record members must be assigned when setting the initial value or none at all.
There is probably a workaround possible using functions, but is there a simpler/better/native way?
Since it is possible to have default values for function parameters, one possible workaround to achieve a "partial initialization" can be the use of a init function:
When calling the function only those parameters which should have non-default values are supplied, the other parameters will remain unchanged.
EDIT: fixed variable assignment.