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.

error in linear assemly module



i am using c6713dsk with ccs 3.1. i am trying to use foolowing linear assembly written dotproduct function in my c program:-

;Dotp4clasmfunc.sa  Linear assembly function to multiply two arrays       

.def   _DotProd ;ASM func called from C

_DotProd:      .cproc   ap,bp,count     ;start section linear asm           

.reg   a,b,prod,sum    ;asm optimizer directive

            zero     sum          ;init sum of products  loop:      

ldw      *ap++,a         ;pointer to 1st array->a           

  ldw      *bp++,b       ;pointer to 2nd array->b     

   nop     4           

mpysp      a,b,prod        ;product= a*b           

  nop         3              

add      prod,sum,sum    ;sum of products-->sum              

sub      count,1,count   ;decrement counter  

[count]        b        loop            ;loop back if count # 0    

nop        5     

  .return  sum        ;return sum as result       

.endproc              ;end linear asm function    

but every time i rebuild my project it shows disqualifed loop : software pipeline disabled in thw file where i  define above program. also output is coming wrong.

But when i use c code for dot product, there is no problem . output is also right.

kindly advise me.

with regards,

ankit kumar

  • Ankit,

    When you compile the C code, keep the assembly output by setting the -k compiler switch. You may see the same "disqualified loop" statement in the comments of that assembly output. Read the Assembly Language Tools Reference Guide and the Optimizing Compiler User Guide to see what it says about "disqualified loop". Additional comments in the assembly output may also help you to understand why you are getting this.

    What compiler switches are you using for both cases, C code and linear assembly.

    Where does CCS show this disqualified loop message? I do not recall it being an error or warning message.

    Compare the assembly output from the linear assembly with the assembly output from the C code. How do they differ?

    To figure out why the output is different between the two cases, load some easily recognized data into your input arrays and single-step through the code while watching the interim results. If they were working the same and correctly, you should see the same values in both cases in the prod register after the first pass and second pass and so on.

    I thought that one of the benefits of using linear assembly was that you do not have to insert the NOPs after multi-cycle instructions. Am I correct, based on what you have read and studied about the linear assembler?

    Regards,
    RandyP