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.

How to get cycle count (TSCL, TSCH) out from optimized function

Hi,

I want to test part of a linear assembly function performance. I do not want to include the in/out register save / restore cycles. From the posts, I know I can get the cycles from reading TSCL before and after the desired test part. It is difficult to find the TSCL instruction in disassembly window. I am new to get cycles for released code (not debug mode). I hope that output TSCL as a parameter to printf (or some other console function) to get the cycle number.

BTW, the project does not use SYS/BIOS now. It is a C64 DSP. CCS is v5. Could you give me more detail on get cycle number for a part of linear assembly function.

Thanks,

  • Hi,

    I have set the debug mode to skeletal. I do not see any use to find/stop at TSCL for the cycle number. Thanks,

  • Put a label at the point where you want to stop and check the TSCL.  Make the label visible with the ".global" directive.  In the disassembly window, there is a text box near the top where you can enter this label name.  Then you can set a breakpoint at that point. 

    Thanks and regards,

    -George

  • Hi,

    Although I add the global directive as:

    .global vit_C64p
    .global printf
    .global TSCL0
    .global TSCL1
    vit_C64p .cproc m_ptr, sd_ptr, trans_ptr, output_ptr

    When I search the label, it shows:

    identifier not found

    See the picture below please.

    The CCS version is 5.2.1.00018. What is wrong in my procedures? Thanks,

  • It seems the .global directive does not take effective. Another label zero_lp0 is not recognized either.

    .global vit_C64p

    .global printf
    .global zero_lp0

    But the built in copy_in label can be located. The .global directive should not be there?

    Thanks.

  • I find the linear assembly label (vit_C64p) can be identified:

    vit_C64p:           .cproc  m_ptr,  sd_ptr, trans_ptr,  output_ptr

    But the linear assembly internal labels are not known by the disassembly. Are there some option/switch cause the labels out? Thanks,

    lb0 not known by disassembly:

    MVK 15, count
    lb0: MVK 1, temp

  • I find that the black label can be located while the red label cannot, see below pic. What causes this? thanks,

  • Hi,

    I find the following in the file: proj.map. These symbols can be located in disassembly window.

    It does not include the label in linear assembly function. What controls the labeling? Thanks,

    GLOBAL SYMBOLS: SORTED BY Symbol Address

    address name
    -------- ----
    00000001 __TI_args_main
    00000008 __TI_STATIC_BASE
    00000008 i
    00000040 metrics
    00000400 __TI_STACK_SIZE
    00008000 enc_out
    00008060 g0g1
    00008648 dec_out
    00008800 pl
    0000d7a0 vit_C64p
    0000d900 main
    0000da00 _auto_init_elf
    0000db00 copy_in
    0000dc00 __TI_zero_init
    0000dce0 exit
    0000dda0 __TI_tls_init
    0000de60 memcpy
    0000df00 _c_int00
    0000df80 __TI_cpp_init
    0000dfe0 _args_main
    0000e020 C$$EXIT
    0000e020 abort
    0000e040 __TI_decompress_none
    0000e060 __TI_decompress_rle24
    0000e080 g0g1_temp0
    0000e378 trans
    0000e4f4 _cleanup_ptr
    0000e4f8 _dtors_ptr
    0000e4fc __TI_enable_exit_profile_output
    0000e500 _stack
    0000e900 __TI_STACK_END
    0000ed80 __TI_Handler_Table_Base
    0000ed8c __TI_Handler_Table_Limit
    0000eda4 __TI_CINIT_Base
    0000edc4 __TI_CINIT_Limit
    ffffffff __TI_pprof_out_hndl
    ffffffff __TI_prof_data_size
    ffffffff __TI_prof_data_start
    ffffffff __binit__
    ffffffff __c_args__
    ffffffff binit
    UNDEFED __TI_INITARRAY_Base
    UNDEFED __TI_INITARRAY_Limit
    UNDEFED __TI_TLS_INIT_Base
    UNDEFED __TI_TLS_INIT_Limit

    [45 symbols]

  • The linear assembler does not allow using labels in this manner.  It will accept these label definitions, but the compiler will discard them, usually leading to an assembler or linker error.  I've submitted this as defect report SDSCM00046659.

  • I apologize for taking so long to get back to you.  

    Robert W said:
    Could you give me more detail on get cycle number for a part of linear assembly function.

    Sorry the label idea did not work out.  Another idea is to use TSCL to compute the cycle count into a temporary register.  Then, towards the end of the function, store that cycle count into a global variable.  In the debugger, watch the value of that global variable.

    Thanks and regards,

    -George