- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi all,
i'd like to ask that whether nios can create array on a specific memory device or not. i have two sram memory device , let's name it sram1 & sram2 i run my system , stack, and heap on sram1 [ in this case, if i declare a global array, the memory allocation should be on sram1 ] anyway, i'd like to put an array on sram2 for special use. please tell me if there's any command that can indicate the memory device to put the array thanks in advance. btw, i roughly remembered that there's a command provided by gcc or something that matches my need.Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Is SRAM2 a part of normal available RAM ? You can explicitly point your array to an address in SRAM2 If SRAM2 is a special RAM, you can employ functions like IOWR()- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you are looking for the "section" attribute via GCC.
char foo __attribute__ ((section("FOO_SECTION")));
You then need to modify your linker script (via nios2-bsp-editor) to create a named section (e.g. "FOO_SECTION") which is located in the memory hardware of your choice. The GCC manual is here: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc.pdf Functions are discussed on page 238. Variables are discussed on page 249. You can also do it via the linker script if needed (e.g. if you want to manipulate binary objects instead of source code).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But be aware, that you have connected the DataMasterPort of the NIOS to this RAM, then you can address this Ram also, like you would address an other IP via NIOS...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for all the reply
what ted replied is the command i'm looking for thanks again- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because I am curious, what the meaning of "putting an array on sram2 for special use". sram2 is special ?

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