Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Vhdl Ram

 
Thread Tools Search this Thread
Old 09-20-2006, 08:54 PM   #1
Default Vhdl Ram


Hello,

I am having trouble with a RAM component that I created from a datasheet. The code for the component can be found below. The trouble I am having occurs when I try to write into the memory. If the chip enable (cen) is placed low before the write enable (wen), when the write enable goes low, the input goes undefined. This happens when there is data already in the memory or not. If both cen and wen are placed low at the same time, the write occurs as it should. Any insight as to what causes this problem would be appreciated. Thanks.



ENTITY mil_11570287_2_1024x4_sram_b IS

PORT(
addr : IN std_logic_vector (9 DOWNTO 0);
cen : IN std_logic;
wen : IN std_logic;
I : INOUT std_logic_vector (4 DOWNTO 1)
);

END mil_11570287_2_1024x4_sram_b ;


ARCHITECTURE arch OF mil_11570287_2_1024x4_sram_b IS

type mem_array is array(0 to 1023) of std_logic_vector(4 downto 1);
signal sram_values: mem_array;

BEGIN

process(cen, wen, I, sram_values, addr)
begin
if cen = '0' then
if wen = '0' then
sram_values(conv_integer(unsigned(addr))) <= I;
else
I <= sram_values(conv_integer(unsigned(addr)));
end if;
else
I <= (others => 'Z');
end if;
end process;

END ARCHITECTURE arch;


bmartiniello
bmartiniello is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump