- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Can I use DDR2 as a program memory (option in system library properties) and also as storage memory for some data?? I'm interesting if I can specify some area for program memory and use other space. Thanks a lot ADLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure can. Just tell the tools you wish to do that in the same area.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Avatar for your replay :).
I know that I can choose varios memory devices for program memory (all I' ve specified in the system), but I want to be be sure that when writing some thata I'm not colliding with program's data. To be clear ... when using IOWR_32DIRECT for writing DDR2 how can I be sure that address I want to use is available? Which addresses is nios system using for program (always starting from address 0x0 or can reserve space for that?) thanks AD- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The simple answer is you can't be sure that memory is not being used. Now you could do some profiling to determine how much of the RAM is used by code and how big your stack is, etc. Not a good method.
If you want to make sure that you are accessing memory appropriately than simply allocate a chunk of memory by creating an array or using malloc or something like that. Then you don't need to worry about where in memory it is located. If you've specified in the IDE system library settings to use your DDR2 for Read-only, Read/write, stack and heap memory, then it will automatically be located in the DDR2. You can also use compiler directives to specify what section of memory you would like a global variable to be located in.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help. In my case the best solution is to declare an array and with compiler directives locate it in ddr2.
AD
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