Post Go back to editing

MIPS ADSP 21569

Category: Hardware
Product Number: ADSP 21569

Hi 

I am using following lines to find the cycle count in the LED example in CCES, subsequently to find the MIPS. But it does not print the Number of cycles. What can be possible issue with it?

#include <cycle_count.h>
#include <stdio.h>
 
int main(void)
{
  cycle_t start_count;
  cycle_t final_count;
  START_CYCLE_COUNT(start_count)
  Some_Function_Or_Code_To_Measure();
  STOP_CYCLE_COUNT(final_count,start_count)
 
  PRINT_CYCLES("Number of cycles: ",final_count)
};

Also can anybody shed somelight on profiling the code using cces.

Best Regards

Sri.

  • Hi Srikanth,

    Could you please ensure that "DO_CYCLE_COUNTS" macro is specified in the Project Options. This can either be added as "DO_CYCLE_COUNTS" to the 'Preprocessor Definitions' under "Project Options: Compile: Preprocessor", or as "-DDO_CYCLE_COUNTS" to the 'Additional Options' under "Project Options: Compile".

    Please see the attached image for your reference.

    Also, please refer the below CCES help page for more details.
    CrossCore® Embedded Studio x.x.x > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > C/C++ Run-Time Library > C and C++ Run-Time Libraries Guide > Measuring Cycle Counts > Basic Cycle-Counting Facility

    Profiling:
    CrossCore Embedded Studio provides two profiling methods(Linear & Statistical profiling). The profiler will give you the percentage of the specific function relative to the whole program.

    Profiling is a method for measuring program performance by sampling the target's PC register to collect data. Profiling view is used to observe where a program spends most of its time executing. Simulator targets support linear profiling and do not support statistical profiling. Emulator targets support statistical profiling and do not support linear profiling.

    Please note that Statistical profiling allows the emulation software to sample the processors PC value while the processor is running. By sampling at random intervals, a profile can be created which can aid the developer in tuning performance critical code sections.

    The statistical profiler periodically samples the Program Counter of the target and builds a profile of the application in terms of % of processor time spent in different functions of the application based on the number of samples gathered for each function. Similarly, it can provide details of the number of samples gathered for each function.

    Also please note that Statistical profiling of short run programs does not display any results. Statistical profiling requires a minimum number of samples. The more samples, the more accurate a profile.

    For more information please refer the below CCES help path:
    CrossCore® Embedded Studio x.x.x > Integrated Development Environment > Navigating Within the IDE > Views > Debug > Profiling View > About Statistical Profiling and Linear Profiling

    Also, additionally we are providing the information about Instrumented profiling, it is an application profiling tool that provides a summary of cycle counts for functions within an application.

    They can try by enabling the "Enable compiler instrumented profiling" under Project > Properties > C/C++ Build > Settings > Tool Settings > CrossCore SHARC C/C++ Compiler > Processor >"
    After enabling, run the executable to complete. The profile is stored in a file with the extension .prf in the "Debug" folder of the project.

    Also, we recommend to go through the below help page on code coverage report generation.
    CrossCore® Embedded Studio > Integrated Development Environment > Debugging Executable Files > Generating Code Analysis Reports > About Code Analysis Reporting

    Instrumented Profiling report:
    CrossCore® Embedded Studio > Integrated Development Environment > Debugging Executable Files > Generating Code Analysis Reports > Generating an Instrumented Profiling Report

    Regards,
    Nishanthi.V

  • Hi Nishanthi,

    Thank you very much for a detailed answer. Apart from MIPS do we have anyother metric and if possible can you discuss about MIPS.

    Best Regards

    Srikanth.

  • Hi,

    MIPS calculation may vary based on context of the applications.

    You can refer the below linked thread which might be helpful to you.
    https://ez.analog.com/dsp/software-and-development-tools/sigmastudio-for-sharc/f/q-a/164038/sigma-studio-for-adsp-21569-user-application-mips-estimation

    If this didn't satisfy your requirement, please let us know about your application and metrics you are expecting.

    Regards,
    Nishanthi.V