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.

Analyze Code coverage with cgtools 7

Hi,

The cgtools 7 supports new compiler options --gen_profile_info --use_profile_info and --onlycodecov. With these options, the code run on DSP can generate code coverage data and write these data to a file in PC through emulator..

One of my customer think this is a good feature, but they want to have this feature without CCS and emulator. The key idea is to save the code coverage data into a buffer in the DSP memory, and dump this buffer through other interface, such as ethernet. Is this feasible?

I think the key problem is how to save the code coverage data into a DSP buffer, could you help?

Thank you very much!

  • Is it possible to output the code coverage data via some other interface, such as ethernet.  It would ideal if some example of how to output the code coverage data without the emulator were available.  Unfortunately, I'm not aware of any such example.

    Thanks and regards,

    -George

  • Georgem said:

    Is it possible to output the code coverage data via some other interface, such as ethernet.  It would ideal if some example of how to output the code coverage data without the emulator were available.  Unfortunately, I'm not aware of any such example.

    Thanks and regards,

    -George

     

    Hi, George,

    To dump data from DSP through ethernet is very easy for customer based on their application, we do not need to worry about it.

    What customer required TI to do is to save the code coverage data or information into a data buffer inside DSP instead of transfer the data to PC through emulator. Is this possible?

    Thank you very much!

  • Brighton Feng said:
    To dump data from DSP through ethernet is very easy for customer based on their application, we do not need to worry about it.

    Actually, you do need to worry about it.  A description of how code coverage is collected is in the compiler manual, in a section titled Code Coverage.  You'll see that the code coverage data collected on the DSP is written out to a profile data file (extension .pdat).  Then that file is post-processed by a tool named pdd6x to create a feedback file (extension .prf).  This feedback file is then processed with another invocation of cl6x that finally produces a CSV (comma separated values) file you can inspect with tools like Excel.  All these steps are required because it is important that the data collection on the DSP be simple, and not require much target memory.

    The point is that, while there is a "data buffer inside the DSP", it has to be written out and post-processed before it becomes useful code coverage information.

    Thanks and regards,

    -George

  • Hi, George,

    The customer would like to do the post processing by themself.

    The requirement for TI is to save the coverage profile information in the data buffer inside the DSP, and tell customer the format of the data in the buffer.

    Is it possible for TI to support it?

    Thank you very much!

  • Internally, the data is collected in a special buffer dedicated to profiling data.  When the program finishes execution, this data is transmitted via CIO to the host.  This is done by a regular C function in the library, and you can look at the source code yourself.  Extract the file outprof.c from the library source rtssrc.zip.  In that file is a function _output_path_profile_info().  This function knows the format of the special buffer (and there are some comments describing it), enabling it to read the data and write it to CIO.  You would just need to stop this function before the CIO writes occur and read the data out of the buffer in any way you please.  This is the only documentation I'm aware of on the format of the special buffer, and the precise format is subject to change without notice between compiler versions.

    [Edit: correct the specific function name --Archaeologist]