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.

Function profiling C55x and DSP/BIOS

Other Parts Discussed in Thread: TMS320C5504

The CCS profiling tool doesn't work usefully for me. The only report I've managed to get is a list of about 30 functions which look like they might be the first 30 functions to be executed in my program. I'm interested in all functions. I've tried setting the Maximum Memory Buffer up to the maximum 100. This didn't improve things.

Code Composer Studio
 Version: 5.2.0.00069

TMS320C5504

Spectrum Digital XDS510

DSP/BIOS 5.4

Is there a way to get a more comprehensive report?

  • The reason I want to use the profiling tool is that I have an application which is too large to fit into SARAM and DARAM. It is mostly linked into SDRAM and doesn't perform well. I was planning to use the profiling tool to help choose the functions which should be moved from SDRAM into faster RAM.

  • John,

    Could your provide more details about your project? For example, what optimization settings are you using and are you trying to profile functions that are coming in from a library that you are linking in to your project? If the latter is true, what debug symbols and optimization settings were the libraries built for (you need a minimal level of symbolic information and certain levels of optimization to be able to use the CCS function profiler).

    Thanks

    ki

  • Ki-Soo

    Thanks for your reply.

    Optimization is disabled off for our project. I would turn it on except that debugging is adversely affected, and moving code from SDRAM to DARAM has so far proved to be a more cost effective means of improving performance. Debugging model is Full symbolic debug (--symdebug:dwarf, -g).

    I am linking a library for which I do not have source. However I am not interested in profiling that library because it's performance is so critical it has already been moved from external SDRAM to DARAM in its entirety.

    The vast majority of the project I have source for but cannot profile.

    I suspect that it is a fairly large project for this DSP. Total code size (.text) is 672098 bytes.

    In the DSP/BIOS configuration I have RTA enabled, but I have found it necessary to disable RTDX, otherwise I get this console message:

    C55xx: Can't enable profiling as it requires AU1 which is already claimed for RTDX or breakpoint(s)

    The sequence of events I use is

    from CCS Edit perspective, hit debug button

    wait for change to CCS Debug perspective, connection and download of program via emulator

    Tools  Profile  Setup Profile Data Collection

    Profile all functions for CPU cycles is already checked

    press activate button

    wait for Activate button to turn grey

    hit resume button from CCS Debug perspective

    I've just tried it again, and I think I have a partial explanation. With profiling switched on I get the report of 30 functions as I described, but our application stops working. A printf at the beginning of main does comes out through JTAG. No where else in the program do we use printf because its implementation unacceptably delays execution of an 8KHz I2S interrupt, as described here http://processors.wiki.ti.com/index.php/Tips_for_using_printf

    I suspect profiling is also delaying the I2S interrupt in an unacceptable fashion, as every time I halt the app using the debugger, it shows the PC in the I2S interrupt. There doesn't seem to be any CPU left for anything else. This explains the short list of functions: as soon as the interrupt is enabled, nothing else gets to execute. This is supported by the report itself which shows the i2s interrupt handler executing 10000s of times, but every other function is shown executing the once or twice it does during the initialization of our app. Is there a description of how CCS function profiling works?

  • Since the original post I have managed to find information on the function profiler and roughly how it works. It seems that it has too big a performance hit to profile functions with hard real time requirements, such as the ISRs. Is there a way to tell it only to profile functions in a range of addresses? Failing that is there other advice you could give on how to solve the problem of "which functions should I move to DARAM/SARAM, and which should remain in SDRAM?

  • John Fisher said:
    Since the original post I have managed to find information on the function profiler and roughly how it works. It seems that it has too big a performance hit to profile functions with hard real time requirements, such as the ISRs

    Yes, it will set breakpoints at the entry and exit point of each function AND a set of breakpoints around EACH branch inside the function. If you have a lot of functions, it would be very intrusive.

    John Fisher said:
    Is there a way to tell it only to profile functions in a range of addresses?

    Not easily. The best thing to do is leverage profile points to control when profiling is enabled. You can use them to enable profiling in the ranges/functions you wish to profile or disable it for the rangers/functions you are not interested in:

    http://processors.wiki.ti.com/index.php/Profiler#Profile_Control_Points

    John Fisher said:
    Failing that is there other advice you could give on how to solve the problem of "which functions should I move to DARAM/SARAM, and which should remain in SDRAM?

    Sorry, without a full understanding of your project, it is hard to give solid recommendations other than a generic response of putting your time critical code in interal ram.

    ki

  • Hi Ki

    I have experimented with setting profile control points. I have tried using an address range in the location field, using both ":" and "-" as separators, but when I enabled the breakpoint CCS reported, eg, "0x50000-0x800000 does not resolve to an address".

    Ki-Soo Lee said:

    You can use them to enable profiling in the ranges/functions you wish to profile or disable it for the rangers/functions you are not interested in:

    In the web page

    http://processors.wiki.ti.com/index.php/Profiler#Profile_Control_Points

    the first sentence is "Profile Control Points enable collection for Function Profiling or Code Coverage for a range or functions".

    What is meant by the usage of the word "range" in your response and in the sentence from the web page?

    Perhaps the capabilities of profile control points depends on the DSP family?



  • John Fisher said:
    I have experimented with setting profile control points. I have tried using an address range in the location field, using both ":" and "-" as separators, but when I enabled the breakpoint CCS reported, eg, "0x50000-0x800000 does not resolve to an address".

    You do not add an address range in the 'Location' field. You add a single address. Profile points are not for adding a range to profile. It is used to pause, resume or terminate profiling at a particular single address.

    Example:

    Say you wish to profile just a few address ranges inside some functions. What you can do is enable profiling for all functions, then set a profile point to pause collection of profiling data at the entry point. Then to resume collection at the start of the range you wish to profile, you can set a profile point to resume profiling at that address. Then set another profile point at the end of that range to pause collection again. So you have collected profiling data for that "range".

    Since it sounds like you want to profile the whole function, but just a few functions, you can set the points at the entry and exit point of your functions.

    This was all a lot easier in earlier version of CCS. Definitely setting up profiling for a few ranges in v4 and greater is more of a pain now. Sorry.

    Thanks

    ki

  • Hi Ki,

    I did not expect that the Location field supported a range of addresses. I did the experiment to confirm this. The reason I was unsure was that the web page used the word range. I think the sentence "Profile Control Points enable collection for Function Profiling or Code Coverage for a range or functions" isn't clear or grammatical and needs revision.



  • John Fisher said:
    think the sentence "Profile Control Points enable collection for Function Profiling or Code Coverage for a range or functions" isn't clear or grammatical and needs revision.

    That's a fair point. I'll get the wording changed on the wiki.

    Thanks

    ki