Altera_Forum
Honored Contributor
15 years agoSimulating a VHDL array
Modelsim-Altera returns an error when I try to drive the 'x' inputs in the code below:
"Error: (vsim-3455) Can force arrays only if they are one-dimensional arrays of character enums." Here is the listing: library ieee; use ieee.std_logic_1164.all; package pkg_array is type row is array(7 downto 0) of std_logic; type vec_array is array(integer range <>) of row; end pkg_array; library ieee; use ieee.std_logic_1164.all; use work.pkg_array.all; entity gen_mux is generic (n: integer := 2); -- Set the number of 8 bit inputs port( x: in vec_array(0 to (2**n - 1)); sel: in integer range 0 to (2**n - 1); y: out row); end gen_mux; architecture description of gen_mux is begin y <= x(sel); end description; Is there a better way to do this? Or is there a way to write this so Modelsim will allow the x arrays to be driven? Thanks for any help, Steve