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.

C2000, CGTools 6.1.3 assembler error E5369

In our assembly code (for F28335) we have the following lines

    mov32      R0H,ACC
    movl       XAR7,#_FPUsinTable
    movh       AR0,ACC<<1
    mov32      R6H, *+XAR7[AR0]
    movl       XAR7,#_FPUcosTable
    ui16tof32  R1H,R0H

that trigger the error

"asm_isr.asm", ERROR!   at line 838: [E5369] Due to FPU pipeline restriction,
                                             this instruction is illegal in the
                                             5 delay slots of:  [mov32
                                             R0H,ACC, line 833]
            ui16tof32  R1H,R0H


since we switched from CGTools 5.2.10 to 6.1.3.

As far as I can see, the code (compiled with 5.2.10) does what it is supposed to do. I don't see a difference in the program output between the code compiled with 5.2.10 and the code compiled with 6.1.3 after inserting a nop instruction before the offending ui16tof32 instruction.

Is our code (without the nop) dangerous or is the error message an indication that the assembler of CGTools 6.1.3 is too restrictive?

Regards,

Johannes

  • Update: In another project I get the E5369 error message for a C file compiled with CGTools 6.1.3 and the following options (path and file names changed):

    -q -pdr -pdv -pden -pds880 -o2 -fr"..." -i"..." -d"_DEBUG" -d"LARGE_MODEL" -d"__TMS320F28XX__"  -ml -v28 --float_support=fpu32 -mf2 --gen_func_subsections -@"../Debug.lkf" "file.c"

    Regards,

    Johannes

  • 5 delay slots are needed to protect against a hardware silicon exception.  If a memory-mapped register write (MOV32 R0H, ACC) is followed by either FRACF32, UI16TOF32, or F32TOUI32 and there are less than 5 delay cycles in between, R0H may be updated with the result of the latter instruction instead of the data on the write data bus.  These were the only affected instructions.

    Only active branches of the compiler are updated so the fix was not applied to v.5.2.

    Anna Youssefi

  • Also, please grab the latest update (currently 6.1.4) because after the initial fix was applied, a second update was made.  In some cases the compiler missed adding the additional delay cycle and the assembler caught it and issued a complaint.  That was fixed shortly before 6.1.3 was released and I don't know if it made it in to the release. If you were getting the warning with compiler-generated code, it is likely to be from that scenario.

    If any problem persists with compiler-generated code after the latest compiler version is used, please let me know.

    Thank you,

    Anna Youssefi

  • The problem persists with 6.1.4. The following code

    extern unsigned long p2(void);
    extern float foo(float, float);
    void Test(unsigned long k[], float dt) {
      k[0] = p2() ?  0 : (unsigned long) foo(1, dt);
    }

    triggers the error:

    [ui32test.c] "C:\Programme\Texas Instruments\C2000 Code Generation Tools 6.1.4\bin\cl2000" -g -k -pdsw225 -o2 -fr... -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 --float_support=fpu32 -@"Debug.lkf" "ui32test.c"
    "ui32test.asm", ERROR!   at line 107: [E5369] Due to FPU pipeline restriction,
                                                  this instruction is illegal in
                                                  the 5 delay slots of:  [MOV32    
                                                  R1H,XAR2              ; [CPU_]
                                                  |5|, line 100]
                F32TOUI32 R0H,R0H               ; [CPU_] |5|

    1 Assembly Error, No Assembly Warnings

    Regards, Johannes

  • Thank you for the test case.  I can reproduce your result.  I filed SDSCM00047353 in the SDOWP system to have this addressed.  Feel free to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • This situation turns out to be an error in the Assembler.  The Assembler is only counting the latency of the CALL instruction (4 cycles), instead of the total latency consumed by the call (return and latency of callee function).  Therefore, there should be no error statement and the code is safe.

    If the code is still generating an object file, you can use it safely.  If no object file is being generated, the only current workaround is to insert a NOP in the assembly or to restructure the source to generate a different instruction sequence.

  • Anna Youssefi said:
    If the code is still generating an object file, you can use it safely.

    No object file is generated when this error occurs.

    When compiled without -o2, the error doesn't occur.

    Regards, Johannes

  • Hi George (and all);

    I checked the incident report SDSCM00047353  and it says the status is FIXED, in release 6.1.5 of C2000 Code Generation Tools.

    I downloaded and installed C2000 CGTools v6.1.5 from this link: https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm

    I selected Compiler version: TI v6.1.5 and built my project, and got same error [E5369].

    Same project, compiler version TI v6.2.3, build fails with same error E5369.

    Same project, compiler version TI v5.2.15, builds successfully with no errors.

    So... some permutation of this bug seems to persist.  Can I provide any further information which might help to pinpoint the remaining problem?

    Thanks very much,

    Amos Gaynes

  • My guess is that this bug is only partially fixed, and you have found another way to trigger it.  I'd appreciate if you would send us a test case so we could investigate.  You probably need to preprocess like this.  Please include the exact version and options you are using.

    Thanks and regards,

    -George

  • Hi George,

    While compiling the attached file I am getting the error as mentioned in this post. I can reproduce the issue with the compile version 6.2.5.

    I have used the below command from the commandline to compile the file:

    "C:/TI/ccsv5/tools/compiler/c2000_6.1.6/bin/cl2000"  -ml --float_support=fpu32 -v28 -I"C:/TI/ccsv5/tools/compiler/c2000_6.1.6/include" main.c

    /*
     * main.c
     */
    int main(void) {
    	long rtb_Add;
    	  float tmp =7;
    	rtb_Add = tmp < 0.0F ? -(long)(unsigned long)-tmp : (long)(unsigned long)tmp;
    
    }
    

  • Thank you for submitting a test case.  I can reproduce your result.  While it appears similar to the previous complaints on this this thread, the circumstances are different enough that a I filed a new entry SDSCM00050302 in the SDOWP system.  You are welcome to track it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • The assembler is in error here; the ECN cannot be triggered by the compiler-generated code.  In this case, the assembly code has a MOV32, followed by an unconditional branch to another location, followed by a F32TOUI32.  The assembler incorrectly emits the ECN error because it does not realize that control flow cannot reach the F32TOUI32 from the MOV32.  The fix will be in C2000 compiler version 6.1.9 and 6.2.8.  See http://processors.wiki.ti.com/index.php/Pending_Compiler_Releases

  • Hi. I faced the same problem today. This post was useful.

    The problem was with new CGTool / compiler version "c2000_6.2.7"
    Problem got solved by switching back to an older compiler version 6.0.2.

  • You should upgrade to version 6.2.8 or later. SDSCM00050302 is fixed in that version