I have a shift register in my top module called Rrg and I want to instantiate Sbox module when Rrg(1) = '1' in the called EnCore module. I have warnings:
1)Condition in IF GENERATE must be static.
2)Uninitialized out port Do has no driver. This port will contribute value (U) to the signal network.
entity EncCore is
port (
di : in std_logic_vector(127 downto 0);
Rrg : in std_logic_vector(4 downto 0);
Do : out std_logic_vector(127 downto 0)
);
end EncCore;
architecture behavioral of EncCore is
begin
gen : if (Rrg(1)='1') generate
innergen : for i in 0 to 15 generate
sbox_inst : sbox
port map(
input_byte => di((i + 1)*8 - 1 downto i*8),
output_byte => Do((i + 1)*8 - 1 downto i*8)
);
end generate innergen;
end generate gen;
end architecture behavioral;