This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CLA compiler didn't generate 3 MNOP'S after MSTOP. [F28377D]

Hi everyone,

I have a question about CLA delay slot.

When I compile my .cla code, CLA compiler didn't generate 3 MNOP'S after MSTOP.

Do I have to add 3 MNOP'S after MSTOP instruction?

or

Has the compiler determined it isn't necessary?

I see below.

processors.wiki.ti.com/.../Control_Law_Accelerator_(C2000_CLA)_FAQ

Q: In the examples I noticed there are 3 MNOP's after each MSTOP. Why is this done? Is it required?

There is a restriction that an MSTOP not endup within 3 instructions of a branch.
The MNOPS have been added to make sure this requirement is always met even
when the program RAM following a task is not initialized. If you know
for sure there is not a branch within 3 instructions after the MSTOP,
then you can remove the MNOPS.

Best regarads,

Mino.M

  • Hi Mino,

    If the condition that there are no branches within 3 instructions of the MSTOP is met, we can safely do without the trailing 3 MNOPs.

    I don't know if the compiler guarantees that; i will move this over to the compiler forum and maybe one of our compiler experts can comment on it.
  • The compiler will not put a branch after the MSTOP, but may put other instructions there. If it does not put any instructions there, it will put 3 MNOPs. I do not know which requirement the wiki entry is referring to; unfortunately, it does not cite the technical documentation.

    Do you have a test case where you believe the compiler is generating invalid assembly code?
  • Mino Montana said:

    Do I have to add 3 MNOP'S after MSTOP instruction?

    or

    Has the compiler determined it isn't necessary?

    You do not need to add any MNOP instructions.  The compiler has determined it isn't necessary.

    Thanks and regards,

    -George

  • Thank you for your answer.

    Best ragards,

    Mino.M