Andy Green wrote:
> When I build with SDCC, the IRAM is full - see .mem below.
>
> Since I'm using --model-large, what is it putting in IRAM? Is there a
> way to find out what variables are being put in there? (and then to move
> them out to xdata?!)
>   
You are getting "spill locations".  When SDCC doesn't have register 
space on hand for local variables, it will create spill locations in 
iram to hold them. 

You can look for 'sloc' in your .lst, .rst and .map files for more 
information on where spill locations are allocated.  The  find the .lst 
and .rst files most helpful in tracking down these issues.  With them 
you can see what it is that you are doing that causes spill locations to 
be allocated.

If your subroutines are complex and work with lots of data, you can 
exhaust your registers pretty quickly.  Manipulation of multiple generic 
pointers or long ints will often lead to spill locations.

I have found that I can reduce spill locations by several tricks:
*  Make variables global instead of local.
* Break complex math on longs into multiple single operations.  Don't do 
"foo = (3 * bar) + baz;"  Do this instead:
foo = 3;
foo *= bar;
foo += baz;
* Avoid generic pointers.
* Break complex subroutines into smaller pieces.

I hope this helps.

--Mark Swayne

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to