It also depends upon the third instruction following these; check out
example 7-27. The write to AR2 in your first instruction causes a conflict so the DSP delays the update of AR4 in your second intruction to allow the first to complete. If the next instruction uses AR4 it will be wrong and possibly go off in the weeds somewhere. Inserting 2 NOPs between 1/2 works, as does 1 NOP between 2/3. It does help that your indirect-offset addressing adds a cycle, but it really depends what that third instruction is; sometimes it will work fine- sometimes not. I've been bit by these until I learned to turn on the "Warn on Pipeline Conflicts" setting in code composer. I figured CC was inserting the required NOPs and just warning me so I could rearrange the code myself. It would be so easy (albeit inefficient) for the assembler to fix this as it already detected the conflicts; it never occurred to me it would generate disfunctional code! > Date: Mon, 04 Feb 2002 13:29:23 -0000 > From: "brcn2" <> > Subject: latency between STLM and MVDK > > Hi all, > > The Cpu&Peripherals book says that there are some restricitons using > STLM when writing to an AR. One of these is that* > "the next instruction must write to any ARx..." > > Then why do I have > > STLM A, AR2 > MVDK *sp(db),AR4 > > in almost all of my working asm programs. > The answer: Because I learned this from dsplib and also that nothing > went wrong..until now, where I have a program which crashes(never > halts and finally freezes the Code Composer ) if I don't put two NOPs > in between these commands. > > Any comments? > > *page 7-36, table 7-3, category 2 > > Burcin Bektas > DSP Software Engineer > METU/TUBITAK |