Embedded Target for Texas Instruments C6000 DSPs    

To Profile Your Generated Code

Before profiling your generated code, you configure your model and the Real-Time Workshop to support the profiling features in Embedded Target for TI C6000 DSP.

Seven tasks compose the process of profiling the code you generate.

  1. Enable DSP/BIOS for your generated code.
  2. Enable Profiling in the Real-Time Workshop.
  3. Create atomic subsystems to profile in your model.
  4. Build your model.
  5. Download your generated code to your target.
  6. Run your code on the target.
  7. In MATLAB, use profile to view the profile report.

To demonstrate profiling generated code, this procedure uses the wavelet denoising model c6711dskwdnoisf.mdl that is included with the Embedded Target for TI C6000 DSP demo programs. If you are using the C6701 EVM as your target, use the model C6710evmwdnoisf instead throughout this procedure. Simulators work as well, just choose the appropriate model for your simulator.

Begin by loading the model, entering

at the MATLAB prompt. The model opens on your desktop.

Enabling Profiling for Your Generated Code

  1. To enable the profile feature for your Simulink model, select Tools -> Real-Time Workshop -> Options... from the model menu bar.
  1. The Simulation Parameters dialog opens for you to set the code generation options for your model.

  1. Click Real-Time Workshop to display the configuration panes for setting your code generation options.
  2. From the Category list, select TI C6000 code generation.
  1. Your display changes to show the options you can set to control code generation for TI C6000 targets, as shown here.

  1. Select the Profile performance at atomic subsystem boundaries option. Selecting this option enables profiling in your generated code. However, you still need to configure your model to support the profiling process.

Creating Atomic Subsystems for Profiling

Profiling your generated code depends on two features--DSP/BIOS being enabled and your model having one or more subsystems defined as atomic subsystems. To learn more about subsystems and atomic subsystems, refer to your Simulink documentation in the Help browser.

In this tutorial, you create two atomic subsystems--one from the Analysis Filter Bank block and a second from the Soft Threshold block.

  1. Select the Analysis Filter Bank block. Select Edit -> Create subsystem from the model menu bar. Note that the name of the block changes to subsystem. Repeat for the Soft Threshold block.
  2. To convert your new subsystems to atomic subsystems, right-click on each subsystem and choose Subsystem parameters... from the context menu.
  3. In the Block Parameters: Subsystem dialog for each subsystem, select the Treat as atomic unit option. Click OK to close the dialog. If you look closely you see that the subsystems now have heavier borders to distinguish them from the other blocks in your model.

Building and Profiling Your Generated Code

You have enabled profiling in your model and configured two atomic subsystems in the model as well. Now, use the profiling feature in Embedded Target for TI C6000 DSP to see how your code runs and check the performance for bottlenecks and slowdowns as the code runs on your target.

  1. Select Tools -> Real-Time Workshop -> Build Model.
  1. If compiling, linking, downloading, and executing are not automated according to RTW Options, then perform these tasks in CCS IDE.

    Allow the application to run for a few seconds or as long as necessary to execute the model segments of interest a few times. Then stop the program.

  1. Create a link to CCS by entering
  1. at the MATLAB prompt.

  1. Enter
  1. at the prompt to generate the profile report of your code executing on your target.

The profile report appears in the Help browser. It should look very much like the report sample shown here; your results may differ based on your target and your settings in the model.


  Reading Your Profile Report Using DSP/BIOS with Your Target Application