Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Discussion Groups

Discussion Groups | Analog Devices DSPs | Initialized variables in program memory

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

Initialized variables in program memory - tlit...@itwbe.com - Aug 14 10:45:27 2006



Hi all,

I am using VisualDSP++ 3.0 with an Apex-ICE and a 21161N Sharc dsp. I am having trouble
initializing an array of filter coefficients in an asm file if the array is placed in program
memory. This is how I declared it:

.segment /pm seg_pmco;
.VAR fir_coefs[NUM_FIR_TAPS] =
	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};

I get no warnings or errors from the assembler or linker but the array does not get initialized
to any particular values when the program is loaded.

If I put the array in data memory as below, it seems to get initialized to the correct values
just fine.

.segment /dm seg_dmda;
.VAR fir_coefs[NUM_FIR_TAPS] =
	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};

Does anybody know if there is something else I need to do to put an initialized variable
(basically a constant in this case) in the program memory? By the way, seg_pmco and seg_dmda
are both in the Sharc's internal memory so there are no concerns about any external memory
quirks.

Thanks in advance,
Terry Litinas



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

RE: Initialized variables in program memory - George Kadziolka - Aug 14 12:38:02 2006

Hi,

'seg_pmco' is 48 bits wide and is meant for code.  32 bit data in the same
block of memory as code would be in 'seg_pmda'.

George

-----Original Message-----
From: a...@yahoogroups.com [mailto:a...@yahoogroups.com] On Behalf Of
t...@itwbe.com
Sent: Saturday, August 12, 2006 10:41 AM
To: a...@yahoogroups.com
Subject: [adsp] Initialized variables in program memory

Hi all,

I am using VisualDSP++ 3.0 with an Apex-ICE and a 21161N Sharc dsp. I am
having trouble initializing an array of filter coefficients in an asm file
if the array is placed in program memory. This is how I declared it:

..segment /pm seg_pmco;
..VAR fir_coefs[NUM_FIR_TAPS] =
	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};

I get no warnings or errors from the assembler or linker but the array does
not get initialized to any particular values when the program is loaded.

If I put the array in data memory as below, it seems to get initialized to
the correct values just fine.

..segment /dm seg_dmda;
..VAR fir_coefs[NUM_FIR_TAPS] =
	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};

Does anybody know if there is something else I need to do to put an
initialized variable (basically a constant in this case) in the program
memory? By the way, seg_pmco and seg_dmda are both in the Sharc's internal
memory so there are no concerns about any external memory quirks.

Thanks in advance,
Terry Litinas



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

RE: Initialized variables in program memory - tlit...@itwbe.com - Aug 15 9:15:20 2006

I created a 32 bit seg_pmda in program memory and everything works fine. Thanks George!!!

Terry Litinas

Hi,
>
>'seg_pmco' is 48 bits wide and is meant for code.  32 bit data in the same
>block of memory as code would be in 'seg_pmda'.
>
>George
>
>-----Original Message-----
>From: a...@yahoogroups.com [mailto:a...@yahoogroups.com] On Behalf Of
>t...@itwbe.com
>Sent: Saturday, August 12, 2006 10:41 AM
>To: a...@yahoogroups.com
>Subject: [adsp] Initialized variables in program memory
>
>Hi all,
>
>I am using VisualDSP++ 3.0 with an Apex-ICE and a 21161N Sharc dsp. I am
>having trouble initializing an array of filter coefficients in an asm file
>if the array is placed in program memory. This is how I declared it:
>
>..segment /pm seg_pmco;
>..VAR fir_coefs[NUM_FIR_TAPS] =
>	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
>	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};
>
>I get no warnings or errors from the assembler or linker but the array does
>not get initialized to any particular values when the program is loaded.
>
>If I put the array in data memory as below, it seems to get initialized to
>the correct values just fine.
>
>..segment /dm seg_dmda;
>..VAR fir_coefs[NUM_FIR_TAPS] =
>	{0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
>	0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625};
>
>Does anybody know if there is something else I need to do to put an
>initialized variable (basically a constant in this case) in the program
>memory? By the way, seg_pmco and seg_dmda are both in the Sharc's internal
>memory so there are no concerns about any external memory quirks.
>
>Thanks in advance,
>Terry Litinas



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )