I'm designing a customizeable interpolation filter and I'm looking for the best way to pass the coefficients (rather supporting points) to the filter. Below you see the current implementation.
package lin_interpol_filter_unsigned_pack is
type supp_point_vector is array (integer range <>) of integer;
end package;
--! Use std libraries.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.lin_interpol_filter_unsigned_pack.all;
entity lin_interpol_filter_unsigned is
generic (
--! Determines number of interpolations steps by steps = 2 ^ <interpol_steps_exp_g>
interpol_steps_exp_g : integer := 6;
input_width_g : integer := 12;
output_width_g : integer := 12
);
port (
clk_i : in std_logic;
supp_points_vect_i : in supp_point_vector (0 to 2**interpol_steps_exp_g);
input_stream_i : in unsigned (input_width_g downto 0);
output_stream_o : out unsigned (output_width_g downto 0)
);
end;
The user would then have to pass the supporting points to the module as a constant. Now I'm worried that Vivado can't optimize the input port to the minimum bit-width, but instead uses the full (32bit?) integer range. Can I expect Vivado to minimize the bit width?
I'm not entirely happy with this approach. I would rather like the user to pass the supporting points as a generic, but the generic declaration would then be dependent on another generic (the interpol_steps_exp_g
generic) which isn't allowed. Is there maybe another way to pass the supporting points conveniently?
Thank you.