Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Memory size

Hello,

I have a bemicro Cyclone III development kit. It features an on-chip ram and an external ram. I've built an SoPC system on it, using both memories.

My objective now is to find the total memory size (on-chip ram + ext ram) into .ptf generated by SOPC Builder and to compare it with the size of the .elf file.

My first question may be stupid, but does SOPC Builder or an another tool know the ext memory size ? It doesn't seem so.

My second question is : using Nios II IDE, via the system library, I've selected which memory I want to use to store Program Memory, Heap Memory, Stack Memory, ... Is there a way to know how full is a memory ?

For example, if I'd program the Heap Memory section and the Stack Memory section into my external memory, it will contain Heap Memory size + Stack Memory size. How can I get those sizes ?

Julien.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To find the actual use, run 'objdump -p' on the elf image, that defines the memory areas that the JTAG loader (and other loaders) copy from the program file into system memory.

    You might also want to look at the 'objdump -h' output and teh symbol table.

    Note that the ldscript the IDE tools use will link all initialised data onto the end of the code segment, and add startup code to copy that to the requested memory block. This doesn't work if you are loading code into tightly-coupled instruction memory - as it is unlikely to have enough space for all the data.

    I've forgotten the PATH for objdump! but it is in the directory tree somewhere.