Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

SRAM Addressing in QSYS

Altera_Forum
Honored Contributor II
1,135 Views

Hello I'm using a DE2-115 board with 2 MB SRAM (Address width 20. Data width 16). 

 

I used Qsys "Generic tri state controller" to attach the memory to the NIOS processor. 

 

Problem: How to access the entire 2MB RAM from c code ? Qsys give to the sram only a 20 bit address on its data bus (instead a 21 bit) so in C code I can access only the first MB. 

 

The following example generates errors:  

sram_mem= (void*)SSRAM_BASE; 

memset(sram_mem,0,2097152); 

 

 

Thanks  

Tiziano
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
127 Views

finally I foud the answare my self: 

 

set address width to 21 in generic tri state controller and detach the less significant bit (bit 0) from the sram addr bus.
Altera_Forum
Honored Contributor II
127 Views

 

--- Quote Start ---  

finally I foud the answare my self: 

 

set address width to 21 in generic tri state controller and detach the less significant bit (bit 0) from the sram addr bus. 

--- Quote End ---  

 

 

address width in generic tri state controller is the byte address arrange of SRAM, not the address bus width. Typically, SRAM has two bits byte-enable input, that's to say, the address bus width + log2(byte-enable width) is the address width of byte. 

Therefore, do not connect MLB of the address from generic tri state controller to any wire, let it free.
Altera_Forum
Honored Contributor II
127 Views

Hey on your SRAM what did you do with the SRAM_UB_N and SRAM_LB_N pins? Also, did you have to modify any of the values in the module assignments section? For example memory size, memory units (which I don't understand what a memory unit is) etc...?

Reply