Ivan00
New Contributor
4 years agoBug report: synthesis optimizes out the signal if data type is declared in generic package
When the data type is declared in the generic package, the synthesis tool removes the signal completely when array slice is used on the right side of the assignment. I have condensed it to the following minimal example. The output signal o_bug in this example does not have any driver:
package parallel_pixel_type_pkg is new work.chr3_pkg_generic generic map(PARALLEL_INPUT_CHANNELS => 1); library ieee; use ieee.std_logic_1164.all; use work.parallel_pixel_type_pkg.all; entity bug is port( i : in std_logic_vector(17 downto 0); o_bug : out std_logic_vector(16 downto 0); o_ok : out std_logic_vector(17 downto 0) ); end entity; architecture rtl of bug is signal sp : test_type_t; begin sp.pixel_data(0) <= i; o_bug <= sp.pixel_data(0)(16 downto 0); -- BUG: o_bug is not connected to i o_ok <= sp.pixel_data(0); -- OK end rtl;
Generic package looks like this:
-- library ieee; use ieee.std_logic_1164.all; package chr3_pkg_generic is generic(PARALLEL_INPUT_CHANNELS : integer); type spectrum_arr_t is array (integer range <>) of std_logic_vector(17 downto 0); type test_type_t is record pixel_data : spectrum_arr_t(PARALLEL_INPUT_CHANNELS - 1 downto 0); end record; end package chr3_pkg_generic; --
I am using Quartus Prime Pro 19.3 and 21.3 on Windows 10. I am also attaching the project archive with the example.