Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Memory works in simulation, but not on HW?

Altera_Forum
Honored Contributor II
1,546 Views

Hello guys, I used the megafunction wizard to create 1-Port RAM. Then I managed to make the input and output bus as a single bi-directional bus. So the top level entity is :  

entity SRAM is port  

OE : in std_logic;  

WR : in std_logic;  

Data_Bus : inout std_logic_vector (7 downto 0);  

Address_Bus: in std_logic_vector (7 downto 0) ; 

clk : in std_logic 

); 

Now in simulation (Timing and functional) , everything is working ok. I can write and read properly from the RAM after providing the clock. But now I assigned pins for the IOs , and tried to use it with microcontroller, but it is not working . I have not used any dedicated IOs and the IO bank is powered .  

What can the problem be ?
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
863 Views

If I understand correctly you use an external (no NIOS etc.) microcontroller. Do you synchronise the clocks and data or how do you interface this?

0 Kudos
Altera_Forum
Honored Contributor II
863 Views

Well , it works on the rising edge of the clock, so its very simple, u just activate WR or OE for read or write , then put the address and at the first coming rising edge, data is either sampled for write , or output for read. I'm using normal microcontroller, and I even wait for multiple clocks before i sample the data. Like I said it is working fine in simulation. See the attachment of the simulation results.  

Thx in advance man.
0 Kudos
Altera_Forum
Honored Contributor II
863 Views

Just a couple of questions/statements that might help: 

Have you simulated what happens if both OE and WR are low and high? 

Also, sometimes, IO is active-low which means you have to invert the signal. 

Are you sure the microcontroller code is correct? Can you check with a scope or LEDs? 

[edit]Oh, and are you sure about your connections? All wires connected to the correct pins?[/edit]
0 Kudos
Altera_Forum
Honored Contributor II
863 Views

The signals are active low, it 's my own design, and of course the WR and OE can not be active at the same time (Data contention hazards might occur). I'm sure they can not be active at the same time as im using advanced microcontroller from ST and it has memory controller as a peripheral, so WR and OE can not be active at the same time. I will recheck the IOs mapping , and will change the whole IOs and see how things go .

0 Kudos
Reply