| Embedded IDE Link™ CC | ![]() |
| On this page… |
|---|
Real-time execution profiling in Embedded IDE Link CC software uses a set of utilities to support profiling for synchronous and asynchronous tasks, or atomic subsystems, in your generated code. These utilities record, upload, and analyze the execution profile data.
Execution profiler supports profiling your code two ways:
Tasks—Profile your project according to the tasks in the code.
Atomic subsystems—Profile your project according to the atomic subsystems in your model.
Note To perform execution profiling, you must generate your project from a model in Simulink modeling environment. |
When you enable profiling, you select whether to profile by task or subsystem.
To profile by subsystems, you must configure your model with at least one atomic subsystem. To learn more about creating atomic subsystems, refer to Creating Subsystems in the online help for Simulink software.
The profiler generates output in the following formats:
Graphical display that shows task or subsystem activation, preemption, resumption, and completion. All data appears in a MATLAB graphic with the data notated by model rates or subsystems and execution time.
An HTML report that provides statistical data about the execution of each task or atomic subsystem in the running process.
These reports are identical to the reports you see if you use profile(ticcs_obj,'execution','report) to view the execution results. For more information about report formats, refer to profile. In combination, the reports provide a detailed analysis of how your code runs on the processor.
Use this general process for profiling your project:
Create your model in Simulink modeling environment.
Enable execution profiling in the configuration parameters for your model.
Run your application.
Stop your application.
Get the profiling results with the profile function.
The following sections describe profiling your projects in more detail.
To configure a model to use task execution profiling, perform the following steps:
Open the Configuration Parameters dialog box for your model.
Select Embedded IDE Link CC from the Select tree. The pane appears as shown in the following figure.

Select Enable real-time profiling.
On the Profile by list, select Task to enable real-time task profiling.
Select Export IDE link handle to base workspace, and assign a name for the handle in IDE link handle name.
Click OK to close the Configuration Parameters dialog box.
To view the execution profile for your model:
Click Incremental build (
) on the model toolbar
to generate, build, load, and run your code on the processor.
To stop the running program, select Debug > Halt in CCS or use halt(objectname) from the MATLAB command prompt. Gathering profiling data from a running program may yield incorrect results.
At the MATLAB command prompt, enter
profile(handlename,'execution','report')to view the MATLAB software graphic of the execution report and the HTML execution report.
Refer to profile for information about other reporting options.
The following figure shows the profiling plot from running an application that has three rates—the base rate and two slower rates. The gaps in the Sub-Rate2 task bars indicate preempted operations.

Refer to Task Profiling Report.
When your models use atomic subsystems, you have the option of profiling your code based on the subsystems along with the tasks.
To configure a model to use subsystem execution profiling, perform the following steps:
Open the Configuration Parameters dialog box for your model.
Select Embedded IDE Link CC from the Select tree. The pane appears as shown in the following figure.

Select Enable real-time profiling.
On the Profile by list, select Atomic subsystem to enable real-time subsystem execution profiling.
Select Export IDE link handle to base workspace and assign a name for the handle in IDE link handle name.
Click OK to close the Configuration Parameters dialog box.
To view the execution profile for your model:
Click Incremental build (
) on the model toolbar
to generate, build, load, and run your code on the processor.
To stop the running program, select Debug > Halt in CCS, or use halt(objectname) from the MATLAB command prompt. Gathering profile data from a running program may yield incorrect results.
At the MATLAB command prompt, enter:
profile(handlename, 'execution','report')to view the MATLAB software graphic of the execution report and the HTML execution report.
Refer to profile for more information.
The following figure shows the profiling plot from running an application that has three subsystems—For Iterator Subsystem, For Iterator Subsystem1, and Idle Task Subsystem.

The following figure presents the model that contains the subsystems reported in the profiling plot.

Atomic Subsystem Profiling Report.
![]() | Using Processor in the Loop | System Stack Profiling | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |