- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo together,
I have a QSys System with a Nios II and an EPCS controller, using a Cyclone IV. The CIV boots from an EPCS-Flash and starts the Software. Now I want to outsource some Functions to the free memory of the EPCS-Flash. So that functions which are used rare, are running from flash. Is this possible? How? I thought I could do it in a way like this: int custom_func(int n) __attribute__ ((section((".onchipmem"))) int custom_func(int n) { … } But which section must be used for the epcs flash. And how to call a function which lies in the flash? Last but not least, how could I specify the used region in the flash? Because the Hw-image and the Sw-image should not be destroyed? Thanks SimLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Code can't be executed from a serial flash. How is this supposed to work? It must be loaded to RAM before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, and how could I do so?
How could I locate some functions in the epcs flash and copy them temporary in the onchip memory to execute?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While technically possible, you'll need to write a lot of infrastructure to do this. Code overlays haven't been used much since 32bit address spaces and paged memory became common.
I'm not even sure the gnu linker will put multiple code blocks at the same physical adress, but at different virtual addresses. You might be better off trying to reduce the code size by ensuring everything is compiled with the optimiser (try -O2, -O3 and -Os, and possibly mark some functions as 'noinline'), reducing the use of libc (especially stdio and malloc) to the minimum. Even changes to the C source (eg careful use of local variables to avoid repeated memory accesses) can reduce the code size.
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