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.

Profiling Issue

Hello,

I am using CCS 3.1 with TMS320C6713 processor and XDS510 USB emulator. I want to perform profiling of certain portion of source code and figure out cycle counts being consumed in that portion of the source code. For this I am performing following steps

1) Perform profile setup

2) Set up profile viewer

3) Load the program

4) Enable profiling by selecting clock symbol

5) Select the ranges tab in profiling setup window.

6) Select the range of code, right click and select Profile -> Range

I observed that min and max cycle count options were not available in profiler viewer window. So, I went to 'Customs' tab in profile setup window and selected "Cycles'. To my surprise CCS got disconnected and I observed following error messages

A) Disconnection pop-up

Can't Set Breakpoint at 0x17f74:
Error 0x80000008/-1031
Fatal Error during: Break Point,
Device driver: Problem with the Emulation Controller.
It is recommended to RESET EMULATOR.  This will disconnect each
target from the emulator.  The targets should then be power cycled
or hard reset followed by an emureset and reconnect to each target.


Sequence ID: 7
Error Code: -1031
Error Class: 0x80000008

B) Message Window of CCS

Trouble Writing Register: Error 0x80000004/-1031 Fatal Error during: Register,  Device driver: Problem with the Emulation Controller. It is recommended to RESET EMULATOR.  This will disconnect each  target from the emulator.  The targets should then be power cycled or hard reset followed by an emureset and reconnect to each target.   Sequence ID: 6 Error Code: -1031 Error Class: 0x80000004
Can't Set Breakpoint at 0x17f74: Error 0x80000008/-1031 Fatal Error during: Break Point,  Device driver: Problem with the Emulation Controller. It is recommended to RESET EMULATOR.  This will disconnect each  target from the emulator.  The targets should then be power cycled or hard reset followed by an emureset and reconnect to each target.   Sequence ID: 7 Error Code: -1031 Error Class: 0x80000008
Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint opcodes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging.

I tried performing profiling multiple times and failed. I am not sure what's happening. Any insight regarding the same is appreciated.

Please also let me know any literature / guide (step by step) for profiling.

  • Hello,

    The CCS function profiler performs profiling by reading the profile clock. To do this, the target must be halted. So when profiling functions, it needs to set a breakpoint at the entry and exit point of each function being profiled. When profiling ranges, it would set a breakpoint at the entry and exit point of each range. It also must set breakpoints around any branches in the function or range. This is so it can get the inclusive and exclusive cycle counts. So this can mean that a LOT of breakpoints are potentially set. On C6000, this can be a problem with regards to profiling accuracy. For example, when a breakpoint is set on your C6713 device, the corresponding cache line is invalidated. If profiling a loop, this means that cache overhead will occur every time through the loop when profiling  vs just the first time and subsequent accesses would not have a cache miss. Hence C6000 profiling on HW can lead to inaccurate numbers. Because of this, CCS function profiling on C6000 HW was disabled in v4 and later. What I am trying to say is that I do not recommend using the CCS function profiler on C6000 HW. You are better off manually using the profile clock yourself. However, CCS function profiling is very good on C6000 simulators because it is not intrusive like on HW. I would suggest using the function profiler on simulators and directly use the clock on HW.

    If you still want to use function profiling on C6000 HW, your error is telling you that the profiler tried to set a breakpoint at address 0x17f74 and failed. You need to check if that address is a valid memory location and if it writable (it is not code in external flash). The error also states that it could be some breakpoint opcodes in memory that are unaccounted for. Try power cycling everything (target, emulator) and restart CCS to see if that helps.

    Thanks

    ki