DSPRelated.com
Forums

SHARC: Linker, libraries, etc. Advise needed

Started by Unknown March 17, 2005
Hello guys,

Working on ADSP-21065L, VisualDSP++ 3.5 Nov'04 update.

I my application I'd get good benefit form the sprintf function, which one 
links to with #include <stdio.h>. However, I don't need the full of the 
library.

But (as expected) the full library plus my code do not fit within the 
internal memory of the '065L.

I tried to change the .ldf in order to make some part of Block1 (0xc000 to 
0xc100) available for code. The ldf was not the problem. The problem is that 
I couldn't make this new segment (which I named seg_pmco2) visible for the 
linker to use it for placing some part of the code within it.

So, my questions are:

1. How can I make another PM segment, defined in Block 1, visible to the 
linker for (automatically) placing code within it?
2. The source code for the sprintf function is available in a file named 
sprint.c. How can I build ONLY THIS FUNCTIONwithin my project? It has the 
following includes:

#include "_stdio.h"

#include "stdio.h"
#include "stdarg.h"

#include "adi_threads.h"

I suspect that it would call many things more, again, not fitting into the 
065's internal memory.

All of your comments/suggestions are very welcome.

TIA

-- 
------------------------------
Jaime Andr&#4294967295;s Aranguren Cardona
jaac@sanjaac.com
SanJaaC Electronics
Soluciones en DSP
www.sanjaac.com


Hi,

After struggling for a while, I could make it fit. I created another
section on the LDF, named seg_pmco2, from 0xC000 to 0xC7FF. The
original seg_pmco is configured to overflow into seg_pmco2.
Now it fits. But very few free space remains available, simply calling
sprintf took around 2kWords.

Maybe overlays are a solution if the program gets even bigger. I've
read it works via DMA. The only external memory I have is SDRAM. Is it
possible to mix them to make overlays work? If so, how?

Any pointers are very welcome.

JaaC

Jaime Andr=E9s Aranguren Cardona wrote:
> Hello guys, > > Working on ADSP-21065L, VisualDSP++ 3.5 Nov'04 update. > > I my application I'd get good benefit form the sprintf function,
which one
> links to with #include <stdio.h>. However, I don't need the full of
the
> library. > > But (as expected) the full library plus my code do not fit within the
> internal memory of the '065L. > > I tried to change the .ldf in order to make some part of Block1
(0xc000 to
> 0xc100) available for code. The ldf was not the problem. The problem
is that
> I couldn't make this new segment (which I named seg_pmco2) visible
for the
> linker to use it for placing some part of the code within it. > > So, my questions are: > > 1. How can I make another PM segment, defined in Block 1, visible to
the
> linker for (automatically) placing code within it? > 2. The source code for the sprintf function is available in a file
named
> sprint.c. How can I build ONLY THIS FUNCTIONwithin my project? It has
the
> following includes: > > #include "_stdio.h" > > #include "stdio.h" > #include "stdarg.h" > > #include "adi_threads.h" > > I suspect that it would call many things more, again, not fitting
into the
> 065's internal memory. > > All of your comments/suggestions are very welcome. > > TIA > > -- > ------------------------------ > Jaime Andr=E9s Aranguren Cardona > jaac@sanjaac.com > SanJaaC Electronics > Soluciones en DSP > www.sanjaac.com
we use the '65L for development and found that we very quickly needed to use
overlays to make all of the code fit. The overlays work by transferring data
from external memory into internal memory when required. Alternatively, you
can also run code directly from external memory.
We use our own overlay manager, but i'm sure AD have their own version that
they can supply you.
I would suggest finding the EE note that describes overlays and checkout the
example code that AD supply. Also upgrade to v4.0 ;)

Brett.

"Jaime Andr&#4294967295;s Aranguren Cardona" <jaime.aranguren@gmail.com> wrote in
message news:1111135539.058947.304820@z14g2000cwz.googlegroups.com...
Hi,

After struggling for a while, I could make it fit. I created another
section on the LDF, named seg_pmco2, from 0xC000 to 0xC7FF. The
original seg_pmco is configured to overflow into seg_pmco2.
Now it fits. But very few free space remains available, simply calling
sprintf took around 2kWords.

Maybe overlays are a solution if the program gets even bigger. I've
read it works via DMA. The only external memory I have is SDRAM. Is it
possible to mix them to make overlays work? If so, how?

Any pointers are very welcome.

JaaC

Jaime Andr&#4294967295;s Aranguren Cardona wrote:
> Hello guys, > > Working on ADSP-21065L, VisualDSP++ 3.5 Nov'04 update. > > I my application I'd get good benefit form the sprintf function,
which one
> links to with #include <stdio.h>. However, I don't need the full of
the
> library. > > But (as expected) the full library plus my code do not fit within the
> internal memory of the '065L. > > I tried to change the .ldf in order to make some part of Block1
(0xc000 to
> 0xc100) available for code. The ldf was not the problem. The problem
is that
> I couldn't make this new segment (which I named seg_pmco2) visible
for the
> linker to use it for placing some part of the code within it. > > So, my questions are: > > 1. How can I make another PM segment, defined in Block 1, visible to
the
> linker for (automatically) placing code within it? > 2. The source code for the sprintf function is available in a file
named
> sprint.c. How can I build ONLY THIS FUNCTIONwithin my project? It has
the
> following includes: > > #include "_stdio.h" > > #include "stdio.h" > #include "stdarg.h" > > #include "adi_threads.h" > > I suspect that it would call many things more, again, not fitting
into the
> 065's internal memory. > > All of your comments/suggestions are very welcome. > > TIA > > -- > ------------------------------ > Jaime Andr&#4294967295;s Aranguren Cardona > jaac@sanjaac.com > SanJaaC Electronics > Soluciones en DSP > www.sanjaac.com
Thanks, Brett.

Do you know if overlays can go in SDRAM, in an external bank different than 
bank0, say bank3 ans in the EzKit?

Regards,

-- 
------------------------------
Jaime Andr&#4294967295;s Aranguren Cardona
jaac@sanjaac.com
SanJaaC Electronics
Soluciones en DSP
www.sanjaac.com


"brett" <brett_w2931@hotmail.com> escribi&#4294967295; en el mensaje 
news:x4idnYXchY2k0qHfRVn-ug@adelphia.com...
> we use the '65L for development and found that we very quickly needed to > use > overlays to make all of the code fit. The overlays work by transferring > data > from external memory into internal memory when required. Alternatively, > you > can also run code directly from external memory. > We use our own overlay manager, but i'm sure AD have their own version > that > they can supply you. > I would suggest finding the EE note that describes overlays and checkout > the > example code that AD supply. Also upgrade to v4.0 ;) > > Brett. > > "Jaime Andr&#4294967295;s Aranguren Cardona" <jaime.aranguren@gmail.com> wrote in > message news:1111135539.058947.304820@z14g2000cwz.googlegroups.com... > Hi, > > After struggling for a while, I could make it fit. I created another > section on the LDF, named seg_pmco2, from 0xC000 to 0xC7FF. The > original seg_pmco is configured to overflow into seg_pmco2. > Now it fits. But very few free space remains available, simply calling > sprintf took around 2kWords. > > Maybe overlays are a solution if the program gets even bigger. I've > read it works via DMA. The only external memory I have is SDRAM. Is it > possible to mix them to make overlays work? If so, how? > > Any pointers are very welcome. > > JaaC > > Jaime Andr&#4294967295;s Aranguren Cardona wrote: >> Hello guys, >> >> Working on ADSP-21065L, VisualDSP++ 3.5 Nov'04 update. >> >> I my application I'd get good benefit form the sprintf function, > which one >> links to with #include <stdio.h>. However, I don't need the full of > the >> library. >> >> But (as expected) the full library plus my code do not fit within the > >> internal memory of the '065L. >> >> I tried to change the .ldf in order to make some part of Block1 > (0xc000 to >> 0xc100) available for code. The ldf was not the problem. The problem > is that >> I couldn't make this new segment (which I named seg_pmco2) visible > for the >> linker to use it for placing some part of the code within it. >> >> So, my questions are: >> >> 1. How can I make another PM segment, defined in Block 1, visible to > the >> linker for (automatically) placing code within it? >> 2. The source code for the sprintf function is available in a file > named >> sprint.c. How can I build ONLY THIS FUNCTIONwithin my project? It has > the >> following includes: >> >> #include "_stdio.h" >> >> #include "stdio.h" >> #include "stdarg.h" >> >> #include "adi_threads.h" >> >> I suspect that it would call many things more, again, not fitting > into the >> 065's internal memory. >> >> All of your comments/suggestions are very welcome. >> >> TIA >> >> -- >> ------------------------------ >> Jaime Andr&#4294967295;s Aranguren Cardona >> jaac@sanjaac.com >> SanJaaC Electronics >> Soluciones en DSP >> www.sanjaac.com > >
Hello,

brett wrote:
> we use the '65L for development and found that we very quickly needed
to use
> overlays to make all of the code fit. The overlays work by
transferring data
> from external memory into internal memory when required.
Alternatively, you
> can also run code directly from external memory.
I think I'll go for overlays, storing part of my code in external SDRAM. I've read EE-66, which indeed has example code. But all of this is very specific to assembly coding. MOST of my aplication is C code, and I don't know beforehand the size of the functions that would go into overlays, and I would like it to be versatile enough to let me put/remove code from them, rather the same way the LDF does it for placing instructions/data into the internal SRAM, without the programmer having to take much care of some mechanics of the process., the linker does the job. Do you have any example C project which uses overlays, and that you could share as a starting point for me? Or where else could I find it?
> We use our own overlay manager, but i'm sure AD have their own
version that
> they can supply you. > I would suggest finding the EE note that describes overlays and
checkout the
> example code that AD supply. Also upgrade to v4.0 ;)
I have VDSP++ 4.0 in one machine, but honestly I have't found the real need to switch to it. I still use VDSP++ 3.5 in two machines, basically because in one of them I have a SummitICE installed, which is not supportted in VDSP++ 4.0, and which I don't want to throw away.
> Brett.
Regards, JaaC