A
A. Kong
Guest
Hi, all,
I wonder if anyone can suggest what actually is wrong with this fragment
of code:
==============================
entity memory is
port(
address: in std_logic_vector(31 downto 0);
write_data : in std_logic_vector(31 downto 0);
MemWrite, MemRead: in std_logic;
clk, reset: in std_logic;
read_data ut std_logic_vector(31 downto 0));
end memory;
architecture behavioral of memory is
type mem_array is array(63 downto 0) of std_logic_vector(31 downto 0);
begin
....
if MemWrite = '0' then
mem_array(addr) := write_data;
else
read_data <= data_mem(addr);
end if;
....
==============================
At the line 'mem_array(addr) := write_data;' xilinx complaints:
Line xx. The expression
can not be converted to type mem_array.
But both write_data and mem_array(addr) are std_logic_vector(31 downto
0). There should be no conversion to mem_array.
I am using Xilinx Project Navigator 4.2Wp3.x
Cheers,
Anthony
I wonder if anyone can suggest what actually is wrong with this fragment
of code:
==============================
entity memory is
port(
address: in std_logic_vector(31 downto 0);
write_data : in std_logic_vector(31 downto 0);
MemWrite, MemRead: in std_logic;
clk, reset: in std_logic;
read_data ut std_logic_vector(31 downto 0));
end memory;
architecture behavioral of memory is
type mem_array is array(63 downto 0) of std_logic_vector(31 downto 0);
begin
....
if MemWrite = '0' then
mem_array(addr) := write_data;
else
read_data <= data_mem(addr);
end if;
....
==============================
At the line 'mem_array(addr) := write_data;' xilinx complaints:
Line xx. The expression
can not be converted to type mem_array.
But both write_data and mem_array(addr) are std_logic_vector(31 downto
0). There should be no conversion to mem_array.
I am using Xilinx Project Navigator 4.2Wp3.x
Cheers,
Anthony