DSPRelated.com
Forums

ADSP-21065L Secondary DAG2 weird behavior

Started by jaime_aranguren March 19, 2003
Hello,

Hopefully. some of the experienced ADSP programmers here can help.

Within an interrupt service routine (ISR), I enable all the secondary
registers, like this:

// Enable secondary registers!!
bit set MODE1 SRRFL | SRRFH | SRD1L | SRD1H | SRD2L | SRD2H;
nop;

Then (somewhere), I calculate the base address of some data in PM
which I work with, stored in R3:

i13 = r3;
f4 = pm(i13, 1);
f8 = pm(i13, 1);
f12 = pm(i13, -2); // Leave I3 with base address

Unfortunately, it doesn't work right. As I could see by debuggin with
the emulator, the "base address" is 0x009870. But when I fetch data
from PM I13 becomes 0xC09871 and 0xC9872 respectively, instead of
0x009871 and 0x009872 respectively, as it should be.

Could someone please tell me why, and how to solve it?

A workaround I wrote was:

i13 = r3;
r3 = r3+1, f4 = pm(i13, 0);
i13 = r3;
r3 = r3+1, f8 = pm(i13, 0);
i13 = r3;
f12 = pm(i13, 0);

Which is extremely ugly, at least in my own opinion.

Looking forward to your kind help.

JaaC
www.sanjaac.com



That is weird. I can't explain the problem you're having, but perhaps a
better workaround would be as follows:

i13 = r3;
f4 = pm(0, i13); // Pre-modify read
f8 = pm(1, i13); // Pre-modify read
f13 = pm(2, i13); // Pre-modify read

The pre-modify read doesn't change the i13 register, but the read occurs at
i13 + the modifier.

I don't have my instruction reference handy, but check that you are enabling
all of the secondary registers that you are using. Also make sure L13 is
set properly (probably to zero in your case).

Maybe there's something different between using DM and PM. Don't think so
though.

Good luck,
Pat

> -----Original Message-----
> From: jaime_aranguren [mailto:]
> Sent: Tuesday, March 18, 2003 5:38 PM
> To:
> Subject: [adsp] ADSP-21065L Secondary DAG2 weird behavior > Hello,
>
> Hopefully. some of the experienced ADSP programmers here can help.
>
> Within an interrupt service routine (ISR), I enable all the secondary
> registers, like this:
>
> // Enable secondary registers!!
> bit set MODE1 SRRFL | SRRFH | SRD1L | SRD1H | SRD2L | SRD2H;
> nop;
>
> Then (somewhere), I calculate the base address of some data in PM
> which I work with, stored in R3:
>
> i13 = r3;
> f4 = pm(i13, 1);
> f8 = pm(i13, 1);
> f12 = pm(i13, -2); // Leave I3 with base address
>
> Unfortunately, it doesn't work right. As I could see by debuggin with
> the emulator, the "base address" is 0x009870. But when I fetch data
> from PM I13 becomes 0xC09871 and 0xC9872 respectively, instead of
> 0x009871 and 0x009872 respectively, as it should be.
>
> Could someone please tell me why, and how to solve it?
>
> A workaround I wrote was:
>
> i13 = r3;
> r3 = r3+1, f4 = pm(i13, 0);
> i13 = r3;
> r3 = r3+1, f8 = pm(i13, 0);
> i13 = r3;
> f12 = pm(i13, 0);
>
> Which is extremely ugly, at least in my own opinion.
>
> Looking forward to your kind help.
>
> JaaC
> www.sanjaac.com >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only
> the author of this message will receive your answer. You
> need to do a "reply all" if you want your answer to be
> distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/