Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

How to know the code size ?!

Altera_Forum
Honored Contributor II
797 Views

hey mates 

My questions are : 

I need to use the OnCMemo for another purpose so I should know the space occupied by the code ! 

How do I know my code size after building ? 

How to know the beginning and end @ of the code downloaded in the OnCMemo? 

thnx
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
82 Views

what is OnCMemo?

Altera_Forum
Honored Contributor II
82 Views

 

--- Quote Start ---  

what is OnCMemo? 

--- Quote End ---  

 

Sorry ! On chip memory
Altera_Forum
Honored Contributor II
82 Views

When you compile with Eclipse in output window there is .elf size

Altera_Forum
Honored Contributor II
82 Views

So the reset @ of my cpu is the starting @ of the code ? the end is the start + the size of elf ?

Altera_Forum
Honored Contributor II
82 Views

You can run nios2-stackreport on your *elf file. It should give you the code size.  

 

For example: 

$ nios2-stackreport hello_world.elf  

Info: (hello_world.elf) 29 KBytes program size (code + initialized data). 

Info: 92 KBytes free for stack + heap. 

 

It shows me that the program size is 29KBytes. I have a 128KByte onchip-memory, thus it reported I have 92KBytes for stack and heap. 

 

You can reduce the size if you are sharing the onchip memory via nios2-bsp-editor/linker section.  

Or you can just split out the onchip memory to smaller size, ie 2 64KByte memory.
Reply