DSPRelated.com
Forums

It's compulsory to use external mem

Started by ahma...@yahoo.com March 25, 2008
Jeff
As you said it is more better to set all sections specially stack,bss and cinit in internal mem. but I want to write my code under CST framework which remains only 4KW for user data memory. Also my code (MELPe encoder)has very large initialized tables which cause my .cinit and .bss sections to be more than one page. I do not know how can I map them in my limited data memory. ??

I know that in run time initialization .cinit is copied to .bss section for general arrays. and for each function its initialized array are copied from .const to stack at the beggining of the function. I do not know why .bss and .cinit are so large simultaneously. and I know addressing for data mem is restricted to 16-bit (except using I/O pins). Is it possible to use program mem for .bss or stack?
regards
Ahmad-

> As you said it is more better to set all sections specially stack, bss and
> cinit in internal mem. but I want to write my code under CST framework
> which remains only 4KW for user data memory. Also my code (MELPe encoder)
> has very large initialized tables which cause my .cinit and .bss sections
> to be more than one page. I do not know how can I map them in my limited
> data memory. ??

Well I can't help you with CST framework; I don't know it. Also I can say that for
MELPe, 5403 (underlying CST chip) doesn't have enough onchip memory for 1200 and 600
bps bitrates, and probably 2400 bps will be very difficult. For 2400 bps, at least
64k x 16 onchip memory is required, and that's only if all done in hand-coded asm
language. For MELPe 1200/600 bps, at least 128k x 16 onchip memory is required due
to codebook tables. Probably you should be using a C5416, not a C5403. How much
onchip memory do you have?

> I know that in run time initialization .cinit is copied to .bss section
> for general arrays. and for each function its initialized array are
> copied from .const to stack at the beggining of the function. I do not
> know why .bss and .cinit are so large simultaneously. and I know
> addressing for data mem is restricted to 16-bit (except using I/O pins).
> Is it possible to use program mem for .bss or stack?

Is this a student project? Or commercial? If commercial, I think your company
should consider to get working C5416 MELPe run-time binary and/or source license from
one of the DSP algorithm vendors out there. Then you could try to port to CST
platform.

-Jeff
Jeff;
Its my student project. My C54CST EVM board has 32kw off chip data ram 224kw off chip program ram and 1MW off chip program flash rom also the CST framework remains 37kw of internal ram for user application. So I have memory but my data mem is limited. could I transfer codebook table to program mem?

if I want to use off chip mem for program which is more proper ram or flash rom?

regards
Ahmad-

> Its my student project. My C54CST EVM board has 32kw off chip data ram
> 224kw off chip program ram and 1MW off chip program flash rom also the
> CST framework remains 37kw of internal ram for user application. So I
> have memory but my data mem is limited.

This is enough memory as long as it's fast, hopefully zero wait-state. What internal
clock rate is the DSP running? What is the memory speed? 10 nsec? Faster?

> could I transfer codebook table to program mem?

Yes, but for C code access you will need to write C-callable asm. lang. functions
that use TBLR instructions to access program memory, something like:

int rdpmem(long int addr);
void wrpmem(long int addr, int data);

> if I want to use off chip mem for program which is more proper ram
> or flash rom?

To get it working, definitely RAM. Once it's working you could experiment with Flash
for codebook tables. The tables are not accessed that often so probably Flash would
work even though it's slow. But it's not a good idea to try and debug that before
the overall algorithm is working.

-Jeff