A map like or list comprehension behavior with others

Example:

   constant FREQS   : real_vector(0 to 3) := (10.0, 20.0, 30.0, 40.0);
   constant PERIODS : time_vector(0 to 3) := ...;

The periods are reciprocal of freqs. If I am not wrong, currently one has to implement a function to initialize PERIODS using FREQS. Something like this:

   function freqs_to_periods (freqs : real_vector(0 to 3)) return time_vector is
      variable periods : time_vector(freqs'range);
   begin
      for i in freqs'range loop
         periods(i) = seconds_to_time(1 / freqs(i));
      end loop;
      return periods;
   end function;

Of course for such a short array one can also directly type:

   constant PERIODS : time_vector(0 to 3) := (seconds_to_time(1/FREQS(0)), seconds_to_time(1/FREQS(1)), seconds_to_time(1/FREQS(2)), seconds_to_time(1/FREQS(3)));

However, this method is extremely long for long arrays.

It would be nice to be able to initialize an array with short single liner, something like:

   constant PERIODS : time_vector(0 to 3) := (others => seconds_to_time(FREQS(some_keyword_or_special_character)));

Introducing a new keyword can be invasive, but for example <> should not be. The final code would like this:

   constant PERIODS : time_vector(0 to 3) := (others => seconds_to_time(FREQS(<>)));

and would mean: "Initialize all items in PERIODS array with a corresponding item from FREQS array by applying seconds_to_time function.".

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information