BlackHelicopter
Full Member level 2
- Joined
- Jun 3, 2010
- Messages
- 137
- Helped
- 13
- Reputation
- 26
- Reaction score
- 16
- Trophy points
- 1,298
- Activity points
- 2,207
Not sure what's going on here but I believe I'm encountering a bus contention issue while trying to simulate SRAM. When I look at the memory content section in ModelSim it shows address 1 = "XX00", when it should be "A500". Here's the VHDL code I'm using to model SRAM. I've also posted a waveform from the simulation as well.
The only conclusion I can draw is that I think it's because OE_F goes high at the same time WE_F goes low. Does this seem like a valid reason why memory would show up as "XX00"? To me it seems like everything should be working fine?
The only conclusion I can draw is that I think it's because OE_F goes high at the same time WE_F goes low. Does this seem like a valid reason why memory would show up as "XX00"? To me it seems like everything should be working fine?
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 entity tb_sram_model is port ( sram_addr : in std_logic_vector(18 downto 0); sram_oe : in std_logic; sram_we : in std_logic; sram_data : inout std_logic_vector(15 downto 0); sram_ce : in std_logic ); end tb_sram_model; architecture arch of tb_sram_model is type memory is array(0 to 2**sram_addr'length) of std_logic_vector(sram_data'range); signal sram : memory := (others => (others => '1')); signal address : integer range 0 to 2**sram_addr'length; begin address <= to_integer(unsigned(sram_addr)); sram_data <= sram(address) when sram_oe = '0' else (others => 'Z'); -- write to sram on rising egde of WE process (sram_we) begin if rising_edge(sram_we) then sram(address) <= sram_data; end if; end process; end arch;