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.

Compiler/TMDSCNCD28388D: Problem with CLA assembler

Part Number: TMDSCNCD28388D
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Tool/software: TI C/C++ Compiler

Hi there

I  have developed some filter by CLA assembler for TMS320F2837x and tried to compile it for TMS320F2838x and have met next problem

for example some part of  *.asm file

  .cdecls C
   %{
        #include "cla_adc_Filter_shared.h"
        #include <f2838x_cla.h>
        #include <f2838x_piectrl.h>
        #include <f2838x_pie_defines.h>
        #include <f2838x_device.h>
        #include <stdint.h>
          extern float W5;
        extern float W4;
        extern float W3;
        extern float W2;
        extern float W1;
        extern float K;
        extern float g_fFk;
        extern uint16_t g_ui16Clear_Interrupt;
        extern volatile struct ADC_RESULT_REGS  AdcaResultRegs;
        extern volatile struct CLA_SOFTINT_REGS Cla1SoftIntRegs;
        extern volatile struct ADC_REGS AdcaRegs;
        extern int16_t  New_Filtered_DataA0;
        extern int16_t  New_Filtered_DataA1;
        extern int16_t  New_Filtered_DataA2;
        extern int16_t  New_Filtered_DataA3;
        extern int16_t  New_Filtered_DataA4;
        extern int16_t  New_Filtered_DataA5;
        extern uint32_t g_ui32Counters[6];
        extern int16_t Is_Data;     
/*************************************************************************************/
   %}
Array_LocationA_0:       .word   _New_Filtered_DataA0
Array_LocationA_1:       .word   _New_Filtered_DataA1
Array_LocationA_2:       .word   _New_Filtered_DataA2
Array_LocationA_3:       .word   _New_Filtered_DataA3
Array_LocationA_4:       .word   _New_Filtered_DataA4
Array_LocationA_5:       .word   _New_Filtered_DataA5

It leads to compile error

../Calculation/CLA/cla_IIR_Filter.asm", ERROR!   at EOF: [E0300] The following symbols are undefined:
  _New_Filtered_DataA0
  _New_Filtered_DataA1
  _New_Filtered_DataA2
  _New_Filtered_DataA3
  _New_Filtered_DataA4
  _New_Filtered_DataA5

  And code like below

MMOVI16    MAR0,#New_Filtered_DataA2  ; Load Begin of array to Reg

leds to compile error

"/tmp/TI4lfFwgmTm", ERROR!   at line 3254: [E0800] Instructions not permitted in structure/union definitions
    MAR0          .bits 16             ; unsigned int MAR0 - offset 42 bytes, size (1 bytes|16 bits)

So after some investigation, I have got conclusion that assembler treats exported from C/C++ symbols, without underscore,

so it does not see   for example  _New_Filtered_DataA0 and in place of Operand Nomenclature MAR0 it has found MAR0 and other CLA registers definition in the

f2838x_cla.h

So question is - how to avoid this problem ?

Best regards

Andrii Shevchuk

  • One Correction

    I have lost underscore before  symbol

    Of corse

    MMOVI16    MAR0,#_New_Filtered_DataA2  ; Load Begin of array to Reg

    leds to compile error.

  • Hi there

    Additional information

    I   used compiler TI v15.12.3 LTS earlier (When it there were not error )  . Now I use TI v18.12.2 LTS

    And with TI v15.12.3 LTS I used COFF as binary interface, now I use EABI, but when I return to COFF, the next errors  Disappeared

    ../Calculation/CLA/cla_IIR_Filter.asm", ERROR!   at EOF: [E0300] The following symbols are undefined:
      _New_Filtered_DataA0
      _New_Filtered_DataA1
      _New_Filtered_DataA2
      _New_Filtered_DataA3
      _New_Filtered_DataA4
      _New_Filtered_DataA5

    But Errors

    "/tmp/TI4lfFwgmTm", ERROR!   at line 3254: [E0800] Instructions not permitted in structure/union definitions
        MAR0          .bits 16             ; unsigned int MAR0 - offset 42 bytes, size (1 bytes|16 bits)

    Still exist .

    Best regards

    Andrii Shevchuk

  • Regarding ...

    Andrii Shevchuk said:
    "/tmp/TI4lfFwgmTm", ERROR!   at line 3254: [E0800] Instructions not permitted in structure/union definitions
        MAR0          .bits 16             ; unsigned int MAR0 - offset 42 bytes, size (1 bytes|16 bits)

    I presume that definition of MAR0 arises from something similar to ...

    	.cdecls C
    	%{
                 #include <f2838x_cla.h>
    	     ...
    
    

    Does the file f2838x_cla.h come from a software package released by TI?  If so, what is the name and version of that package?  When I look at similar files in controlSUITE and C2000Ware, I see definitions like this ...

        Uint16 _MAR0; // CLA Auxiliary Register 0
    

    I'm not familiar with this code, so I cannot be certain.  But it is a good guess that leading underscore is there to avoid the problem you are experiencing.

    Thanks and regards,

    -George

  • Hello George

    f2838x_cla.h is from software package released by TI.

    I Think you are right. I Compared f2838x_cla.h and F2837x_D_cla.h (It is from project which was compiled successfully ) and have seen difference

    in F2837x_D_cla.h

    Uint16                                   _MPC;                         // CLA Program Counter
        Uint16                                   rsvd4;                        // Reserved
        Uint16                                   _MAR0;                        // CLA Auxiliary Register 0
        Uint16                                   _MAR1;                        // CLA Auxiliary Register 1
        Uint16                                   rsvd5[2];                     // Reserved
        union   _MSTF_REG                        _MSTF;                        // CLA Floating-Point Status Register
        union   MR_REG                           _MR0;                         // CLA Floating-Point Result Register 0
        Uint16                                   rsvd6[2];                     // Reserved
        union   MR_REG                           _MR1;                         // CLA Floating-Point Result Register 1
        Uint16                                   rsvd7[2];                     // Reserved
        union   MR_REG                           _MR2;                         // CLA Floating-Point Result Register 2
        Uint16                                   rsvd8[2];                     // Reserved
        union   MR_REG                           _MR3;                         // CLA Floating-Point Result Register 3
    };

    In f2838x_cla.h

     union   MSTF_REG                         MSTF;                         // CLA Floating-Point Status Register
        union   MR_REG                           MR0;                          // CLA Floating-Point Result Register 0
        Uint16                                   rsvd6[2];                     // Reserved
        union   MR_REG                           MR1;                          // CLA Floating-Point Result Register 1
        Uint16                                   rsvd7[2];                     // Reserved
        union   MR_REG                           MR2;                          // CLA Floating-Point Result Register 2
        Uint16                                   rsvd8[2];                     // Reserved
        union   MR_REG                           MR3;       

    So the underscore is missing in the file f2838x_cla.h

    So I Have corrected this one and compilation is successful .

    So the question is why f2838x_cla.h does not have this one.

    The document  - TMS320C28x Optimizing C/C++ Compiler
    v18.1.0.LTS
    User's Guide
    Literature Number: SPRU514P
    January

    Section 6.11 Object File Symbol Naming Conventions (Linknames) 

    For COFF, the compiler places an underscore at the beginning of the linknames of C identifiers, so you
    can safely use identifiers that do not begin with an underscore in your assembly code.

    For EABI information is absent so I will open new topic

    So in COFF it is should be protected automaticaly, But header file contain this protection.

    C++ is based on the C standard (1.1/2, C++03) and C99 is a normative reference (1.2/1, C++03) these also apply, from the 1999 C Standard:

    7.1.3 Reserved identifiers

    Each header declares or defines all identifiers listed in its associated subclause, and optionally declares or defines identifiers listed in its associated future library directions subclause and identifiers which are always reserved either for any use or for use as file scope identifiers.

    • All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
    • All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.

     

  • Andrii Shevchuk said:
    the question is why f2838x_cla.h does not have this one.

    I don't know.  I am not on the team that releases this software package.  That is why I asked you for the name and version of the software package.  Once I know that, I can direct this issue to the correct team, and they can handle it.

    Thanks and regards,

    -George