Ehancing stack for a core?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am
Contact:

Ehancing stack for a core?

Postby Interactive_Matter » Wed Apr 20, 2011 1:10 pm

Hi,

If I install my code how I want to install it on my XMOS the linker denies to link it. It says that there is not enough stack available on one core. I do not know if the memory is completely filled up on that core.

Is it possible to increase the stack space (at the cost of variable space)?

Thanks

Marcus
m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Postby m_y » Wed Apr 20, 2011 2:50 pm

The stack space isn't of fixed size. Starting from the lowest memory address and working upwards there is text (code), initialised data, bss (uninitialised data), heap (malloc-able memory) and finally stack (which value abuts the highest usable address in memory).

The size of text, data and bss are dependent only on what's declared in your program. The stack size is the maximum your program will ever use, as derived from a static analysis. The heap size is whatever's left between the top end of bss and the bottom of the stack space.

The linker error you're seeing is because text, data, bss and stack won't all fit in 64KB. The only way to make them fit is to make at least one of them smaller.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Postby Folknology » Wed Apr 20, 2011 4:45 pm

Xmap should break it down for you so you can see where the resources are being used up - tools guide 13.6, use -report option


Then you can choose to reduce the memory usage or move stuff to other cores and use channels to share data between them.

regards
Al
Last edited by Folknology on Wed Apr 20, 2011 5:04 pm, edited 1 time in total.
m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Postby m_y » Wed Apr 20, 2011 5:02 pm

If you're looking for a breakdown of memory usage when something is too big to fit then the linker's --map option is also a good bet.

To use, add this to the compile line: "-Xmapper --map -Xmapper mapfile". After a link (even a failed link) you get a file called "mapfile" which contains lots of information about what function and data are are on each core and how much space each uses.
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am
Contact:

Postby Interactive_Matter » Wed Apr 20, 2011 6:07 pm

That is what I expected - but not wanted - to hear ;)
It is just too much data on that poor core. Will solve the problem with shifting processes to other cores

But thanks for your help - especially analyzing it is very helpful!
robertxmos
Experienced Member
Posts: 100
Joined: Fri Oct 23, 2015 10:23 am

Postby robertxmos » Tue Nov 14, 2017 11:20 am

> Will solve the problem with shifting processes to other cores
... on other tiles.
The memory is per tile, so pick a core on another tile... assuming you have more than one tile (8 cores).

Return to “Development Tools and Programming”

Who is online

Users browsing this forum: No registered users and 17 guests