Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20735 Discussions

Nios II not accessing custom external SRAM

Altera_Forum
Honored Contributor II
1,104 Views

I created an SRAM_512x16 component in SOPC builder using the New Component tool. I instantiated it in SOPC Builder and connected it to the system through an Avalon-MM Tristate Bridge to the Nios II CPU. I can use System Console to write and read to and from the SRAM with the Nios II CPU turned off, however when I try to run software with the Nios II for Eclipse SBT it tries to write the .ELF file to the SRAM, but verification fails. 

 

I also wrote a hardware-level VHDL system to exercise every bit in every memory location of the external SRAM without using SOPC Builder, and it works perfectly. 

 

When I created the SRAM_512x16 component in SOPC Builder I used signals only with no HDL. I have tried a variety of Read/Write timing configurations with no success. 

 

The Nios II CPU does recognize the component as SRAM in the Reset Vector and Exception Vector memory assignments. Even that much requires a rather obscure check-box to be selected in the Deprecated section of the Interfaces tab of the SPOC Builder Component Editor. The Deprecated section is not expanded when the Component Editor is opened. The rest of the section are already expended, so it is easy for a "newbie" to overlook the very important "Memory device" check box. If this box isn't check, the "set_interface_property sram_tristate_slave isMemoryDevice" line of the component TCL file defaults to "False" so the component does not show up in the Nios II CPU Reset and Exception vector memory list.  

 

PLEASE HELP! I have been stuck on this for over a week and have run out of ideas on how to fix it.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
223 Views

If you have enough space on the FPGA, add an onchip memory and compile a memory test software template. Put the software in the onchip memory and have it test the SRAM.

0 Kudos
Altera_Forum
Honored Contributor II
223 Views

Open the tcl file for the custom external SRAM and make sure ismemorydevice is set to true 

 

set_interface_property avalon_tristate_slave ismemorydevice true 

 

In the component editor tab labeled interface, there should be a check box in the deprecated section (on newer SOPC version) that allows specification of the component as a memory device.
0 Kudos
Reply