- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i have write a C program with 20 line of code, i try optimize it with NIOS II compliler option like -Os, -g3 i obtain 7700 bytes but is not sufficient for my design, because i use an onchip memory. my question is: can I optimize my program for obtain a smaller size ? Nios II compiler contain others options for program optimisation? thks for all membersLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the 7700 bytes you mention code space or data space?
Optimization will attempt to reduce code size but not have much of an effect on data size. Since it's only 20 lines of C, perhaps you could post it so members could take a look and suggest any code style optimizations . Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried customizing the system library? This can make a relatively big difference when your actual program is quite small.
For example, in the system library you can disable C++ support as well as enable "reduced device drivers" and "small C library".- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thk kevin and vernmid (http://www.alteraforum.com/forum/member.php?u=3282) it is the best idea!
i try this and it work well. my mrogram become very small from 7700 bytes to 2096 bytes. thks for all members
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