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.

CCS/TMS320F28388D: Unable to see aliases name __c28xabi_divu for U$$DIV used in run time library source file, u_div28.asm while step debugging

Part Number: TMS320F28388D

Tool/software: Code Composer Studio

Hi Team,

I was performing a 16-bit unsigned division operation using u_div28.asm which is a run-time support library file for compiler v18.1.3.LTS in the eabi format. When debugging I was unable to see aliases name,   __c28xabi_divu, during step debug.

Although for 16-bit modulo operation the function U$$MOD is called correctly with its alias name. 

When I checked the coding difference between them, I observed that .page mnemonic was missing for the instructions for U$$DIV. I added in the source file then generated the library again, and repeated the same steps for debugging. I was facing the same issue again. For testing purpose, we require the alias name to come when performing debugging, for the documentation purpose in our legacy projects. Please let me know the issue and also check whether there is any problem with the code file, u_div28.asm.

Thanks & regards,

Gurusha

  • I think the root of the problem is a misunderstanding about how the .asg directive works.

    The RTS source file u_div28.asm has these lines ...

            .if __TI_EABI__
               .asg __c28xabi_divu, U$$DIV
               .asg __c28xabi_modu, U$$MOD
            .endif

    That says, if being built for EABI with --abi=eabi, then those two .asg directives take effect.  The .asg directive does not create a new symbol.  It only performs text substitution in a manner similar to #define in C.  Another way to think of it ... It is like search and replace in your text editor, except it happens at build time.  Everywhere U$$DIV appears, it is replaced with __c28xabi_divu.  This text replacement happens very early in the build, before symbols are created. 

    When this file is built for the older COFF ABI, the symbols U$$DIV and U$$MOD are created.  When this same file is built for the new EABI, the symbols _c28xabi_divu and __c28xabi_modu are created.  It is never the case that all 4 symbols are created.

    None of this is affected by the .page directive.

    To learn more about assembler directives like .asg and .page, please search for them in the C28x assembly tools manual.

    Does this explanation resolve the problem?

    Thanks and regards,

    -George

  • Hi George,

    My question is same. if the as directive has been used, and I can see U$$DIV is replaced with __c28xabi_divu. 

    But for U$MOD i couldn't see it to be replaced by its alias name, __c28xabi_modu. SInce our VNV team has to document each step while testing, they should at least get this alias name to be appear while step debug.

    Please if it is feasible, try to check on your side.

    Thanks & regards,

    Gurusha

  • gurusha nahar said:
    But for U$MOD i couldn't see it to be replaced by its alias name, __c28xabi_modu.

    For the case of U$$DIV and __c28xabi_divu, how do you know it is replaced by its alias name?  What do you look at?  When you look at the same thing for the case of U$$MOD and __c28xabi_modu, what is different?

    Thanks and regards,

    -George

  • Hi George,

    As per the above question, the problem I have mention should is the opposite, U$$MOD doesn't displays  __c28xabi_modu  but  U$MOD dispays  __c28xabi_modu  in disassembly.

    Please refer to the screenshot below:

    if you see the diaasmebly, the UDIV_main() is displaying the UDIV instead of  __c28xabi_divu. Why?

     

    It is not in the case of U$$MOD, please refer to another screenshot:

    The difference is nothing between the  __c28xabi_modu and U$$MOD, but for documentation purpose we require these aliases to be correctly displayed while checking in disassembly.

    As there is no difference in the code of U$$MOD and U$DIV, but why the alias name is not displaying for U$DIV.

    Hope you got my point clearly this time!

    Thanks 
    Regard,

    Gurusha

  • The function udiv_main does not make any function calls.  It computes the division expression with the instructions RPT || SUBCU.  The function umod_main calls the function __c28xabi_modu.

    Thanks and regards,

    -George

  • Hi George,

    No, if you see dissembly, udvi_main() is also called.

    That means it is calling some udiv function and performing the division operation.

    Please try testing on your side if it is feasible for you.

    Thanks & regards,

    Gurusha

  • A better way to see the compiler generated assembly code is with the build option --src_interlist.  It causes the compiler to put the assembly code in a file with the same name as the source file, with the extension changed to .asm.  Add --src_interlist, build rtl_udiv_vcast.c, then inspect rtl_udiv_vcast.asm.  The instruction used for a function call is LCR.  You will see the function udiv_main does not contain any LCR instructions.

    Thanks and regards,

    -George

  • Okay George!

    Thanks 

    I will check!