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.

TMS570LS3137: XDS560 Trace Pro

Expert 1995 points
Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

Can anybody reply to the questions I asked here:

I would like to know if the probe XDS560 Trace Pro is able to do the following tasks:

- Code coverage with CCS (if no, with which one?);

- Code coverage of (native) assembly code (e.g. the source code generated by Halcogen such as sys_core.asm)

Thanks ahead.

Kind regards.

  • Hi,

    I know the Code Coverage works well with the ProTrace pod. I did a quick run here and found out it gathers the information present on .asm files just fine. 

    Display:

    Settings:

    Hope this helps,

    Rafael

  • Hi Rafael,

    Thanks for the pictures.

    Can you please try with some startup routine as .asm ? 

    Which kind of coverage can it measure ? Simply the execution or even occurrence of multiple decisions ?

    Thanks ahead.

  • Hi,

    I don't have any code with .asm startup routines - the only code I have is with HalCoGen auto-generated software that starts with C source code (HL_sys_startup.c).

    Given the Trace is able to capture .asm routines embedded into the TI libraries (as shown in the screenshot of my previous post), I don't see a reason why it would be different with a startup routine.

    If you are not seeing debug information, perhaps you could try to use the asmfunc/endasmfunc pair to inform the debugger about the limits of your functions.

    Reference at:
    downloads.ti.com/.../debugging-assembly-source-stdz0716489.html

    The coverage displays the number of function executions, regardless of how they were called or what decisions were made to reach the call.

    Additioanl details can be found int he Trace Analyzer User's Guide
    www.ti.com/.../litabsmultiplefilelist.tsp

    Hope this helps,
    Rafael
  • Hi,

    desouza said:
    I don't have any code with .asm startup routines - the only code I have is with HalCoGen auto-generated software that starts with C source code (HL_sys_startup.c).

    Given the Trace is able to capture .asm routines embedded into the TI libraries (as shown in the screenshot of my previous post), I don't see a reason why it would be different with a startup routine.


    In my case Halcogen generates pure .asm files to address the startup of the MCU and other essential stuff, therefore I would like to know if the code coverage of "pure" assembly files (not obtained from compiling .c files) is also supported by the XDS560 Trace Pro. I know that for example the TI compiler can normally support code coverage only for the C-functions.

    desouza said:
    If you are not seeing debug information, perhaps you could try to use the asmfunc/endasmfunc pair to inform the debugger about the limits of your functions.

    Reference at:
    downloads.ti.com/.../debugging-assembly-source-stdz0716489.html


    The debugging information is not problematic for me, since I can get them in non-real-time even by the basic XDS100v2 probe. I am more interested in the code coverage features because, as mentioned above the TI-compiler and also 3rd party SW tools perform it only for C-code.

    desouza said:
    The coverage displays the number of function executions, regardless of how they were called or what decisions were made to reach the call.


    So, it means that if the function has several branches and I chose only one of them during the call, it returns anyway 100% of coverage just because I executed somehow that function ?

    Hopeful to have been clear enough in exposing the doubts. Thanks ahead for replying.

    Regards.
  • Hi,

    _MM_ said:
    In my case Halcogen generates pure .asm files to address the startup of the MCU and other essential stuff, therefore I would like to know if the code coverage of "pure" assembly files (not obtained from compiling .c files) is also supported by the XDS560 Trace Pro. I know that for example the TI compiler can normally support code coverage only for the C-functions.

    The Trace Code Coverage has no relationship with the TI Compiler code coverage. It pretty much correlates the PC ranges gathered via the Trace interface with the function delimiters present in the debug information of the .out file. Therefore, there is no difference if the code was written in .asm or .c - what matters is if the function is properly delimited via the debug symbols. 

    _MM_ said:
    So, it means that if the function has several branches and I chose only one of them during the call, it returns anyway 100% of coverage just because I executed somehow that function ?

    I don't see a way to select a single branch of execution with the Trace Code Coverage feature. There are a few restrictions that can be added to the statistics collectors, but I don't see a granularity lower than per .obj or .lib file.  I can try to find additional methods to customize the Code Coverage, but I really can't recall from the top of my head. I will reply here if I find something else. 

    Regards,

    Rafael

  • desouza said:
    I don't see a way to select a single branch of execution with the Trace Code Coverage feature. There are a few restrictions that can be added to the statistics collectors, but I don't see a granularity lower than per .obj or .lib file.  I can try to find additional methods to customize the Code Coverage, but I really can't recall from the top of my head. I will reply here if I find something else. 

    Before you try, please consider to call in some program the following function, and suppose that the input is less than 15. Would the tool return the function was 100% exercised even if just 50% of the instructions it contains are executed ? I wonder about the same issue with an equivalent assembly code having some CMP (compare), JMP (then go to...) commands.

    int16_t foo(int16_t var)
    {
        int16_t stat;
    
        if (var > 15)
        {
            stat = 1;
        }
        else
        {
            stat = 2;
        }
    
        return stat;
    }

  • Hi,

    I double-checked and the document I sent before talks about this scenario. Check section 3.3.5.

    Hope this helps,
    Rafael
  • I read that section, and I guess some information is missing about the topics I am interested in:

    1) Highlight covered lines in source files. If you check this box, statements that were executed are highlighted in green. Coming back to the previous C-function, if the input var is 14, it detects it as no statement execution but but actually 50% of the function is anyway covered (the other branch is taken).

    2) Show Instruction Coverage View. If you need to view which lines in the assembly language generated for your code are covered, check this box, but what when there is no code generating that assembly ("native" .asm code like in my case) ? Is this applicable as well ?

    I think the best way to check its behavior is by demo/evaluation.

  • Hi,

    Please apologize for the long delay; I missed your last reply.

    1) From the screenshot I sent before, you can see the column "covered" reflects how much of the function was executed, which reflects the branch decisions taken inside of it.

    2) I don't see how the coverage discriminates between .asm and .c source files - Trace captures opcodes and PC values and performs the correlation with the source code. From my screenshot, it certainly takes into consideration .asm files as well (memset, for instance).

    Hope this helps,
    Rafael