- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 TizianoLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page