- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I´m a newbie in Altera and now I got a problem. I want lo load my source code to control my IP Core. I have a cyclon III DEV Board which has maximum 3888kbits of on chip memory but my code is much bigger. So how can I handle this problem? Thanks for youre advice! RegardsLink Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use external memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or try to use small C lib and see if it fits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your advice!
But the point is that I already have a DDR2 SDRAM. My problem is now how to tell the core that the main function is not on the on-chip memory but in the SDRAM and also how can I load the Software on the SDRAM and not on the on-Chip memory. My idea was to load a small code on the on-chip mem which has the information that the main code is on the SDRAM. But I don´t know how to do this!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Option 1
If you want to move a whole memory section to ddr2 or to any another memory, select it in the BSP properties. e.g. : stack in onchip memory, code in ddr2, data in ddr2, ... Option 2 If you want to move a single function to a specific memory, add __attribute__ ((section (".my_memory"))) after the function declaration, where 'my_memory' is the name you assigned to your memory in sopc builder or Qsys. e.g. int function_in_ddr2(int param) __attribute__ ((section (".ddr2_ext_mem"))); Option 3 Use a custom linker scripts and map whatever you want wherever you need.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, if you want to have code/data into multiple sections, you need to consider how the 'load' process will work.
The JTAG loader uses the elf program headers to work out where to write each code/data area - so can load directly into the relevant area. The EPCS loader can only load one big chunk of data - so must load into external memory - code is added to alt_main() to copy the code/data to its correct physical address. The Altera linker scripts assume you are going to use (something like) the EPCS loader. This means they just don't work if you are trying to only use tightly coupled memory. You might also find that a lot of your code size it just bloat caused by using printf() and the malloc/free that happen in order to let you call printf().
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