Im trying to simulate a RAM memory with Quartus and Modelsim by Altera. The problem is that when i assing values to data_inout in the test bench and simulate, the wave is always in 'U' state. It doesnt take any value when i do data_inout <= "0000000000001010"; for example or if i use data_inout <= aux_data; All i want is to test that it write some values on the array and then read them for a college exercise, nothing fancy. Any idea how to simulate it?
Thanks.
library IEEE;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity ram_program is
port(
dir : in std_logic_vector (7 downto 0);
read_write,cs : in std_logic;
data_inout : inout std_logic_vector (15 downto 0)
);
end entity ram_program;
architecture code_ram_program of ram_program is
type tipo_ram is array (255 downto 0) of std_logic_vector (15 downto 0);
signal ram : tipo_ram;
begin
MEM_RAM: process (cs,read_write,datos_in_out,dir)
begin
if (cs = '1' and read_write = '1') then
ram(to_integer(unsigned(dir))) <= data_inout;
end if;
if (cs = '1' and read_write = '0') then
data_inout <= ram(to_integer(unsigned(dir)));
end if;
end process MEM_RAM;
end architecture code_ram_program;