Allow generic subprograms to be mapped to subprograms with different signatures, where parameters left open make up the function signature.
Is your capability/feature request related to a problem?
Currently, if a user wishes to map a generic subprograms it must map to an existing function with matching signature. In some cases, this may mean the user needs to create a wrapper subprogram purely to map the subprogram to a generic. When mapping a generic method to a method from a protected type, it may not be possible to create such a wrapper subprogram.
Describe the solution you'd like
All the user needs to provide are values in a generic map for the function being mapped. Anything left open or mapped to box <> ? or some other mechanism will then create the signature required to make the generic
for example assume the user has this generic interface:
generic (
type t;
function to_string(x : t) return string;
);
The to_string function for time has an overload with a "UNIT" parameter. I want this instantiation to always print out with us. So ideally you could just write:
generic map (
t => time,
to_string => to_string( value => open, unit => 1 us); -- maybe use <> instead?
Describe alternatives you've considered
Currently the user needs to create a wrapper function:
function to_string_only_us(value : time) return string is
begin
return to_string(value, 1 us);
end function;
....
generic map (
t => time,
to_string => to_string_only_us
);
Additional context
Now that VHDL 2019 allowed subtype declarations in situ (particularly for generic protected types) could this not also be done for method signatures?