moonshine8995
Newbie level 6
Code:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
use ieee.numeric_std.all;
use work.CONV_PACK_Top.all;
entity mux_top is
Port ( sel : in STD_LOGIC_VECTOR (31 downto 0);
mux_in : in T_2D;
mux_out : out STD_LOGIC_VECTOR (31 downto 0));
end mux_top;
architecture Behavioral of mux_top is
begin
process(sel)
begin
mux_out <= mux_in(to_integer(unsigned(sel)));
--output_4a <= to_integer(unsigned(sel));
end process;
end Behavioral;
i got error for line
Code:
process(sel) and mux_out <= mux_in(to_integer(unsigned(sel)));
the error is Fatal error in Process line__17.
mux_in is a 2D array which as 30 in put than all of them are 32bit.
i tried with for generate
Code:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
use ieee.numeric_std.all;
use work.CONV_PACK_Top.all;
entity mux_top is
Port ( sel : in STD_LOGIC_VECTOR (31 downto 0);
mux_in : in T_2D;
mux_out : out STD_LOGIC_VECTOR (31 downto 0));
end mux_top;
architecture Behavioral of mux_top is
begin
GEN: for i in 0 to 29 generate
mux_out <= mux_in(i);
end generate;
mux_out <= mux_in(sel);
end Behavioral;
thanks for helping me.