Main Content

Analyze Generated Data Code Interface Report

When you generate a code generation report, you can include a code interface report, which documents the generated code interface, including model entry-point functions and interface data. The code interface information helps you to review the generated code and integrate it with other code. The information in the report depends on the type of code interface configuration that you use. For models that use a service interface code configuration, the code interface report also includes information about services, as described in Analyze Generated Service Code Interface Report.

For code configured with data interfaces, the code interface report includes the following subsections:

  • Introduction — A high-level description of the data code interface report

  • Function Interfaces — Interface information about each model entry-point function, including model_initialize, model_step, and (if applicable) model_reset and model_terminate

  • Data Interfaces — Interface information about data elements, such as inports and outports, that are associated with the model

To generate a code interface report, select the configuration parameters Create code generation report and Code Interface Report, as described in Generate Code Generation Report. For limitations that apply to code interface reports, see Code Interface Report Limitations.

To open the example models used in this topic, use the openExample command:

openExample('ConfigurationInterface');

Navigate Code Interface Report Subsections

To help you navigate code interface descriptions, the code interface report provides collapse/expand tokens and hyperlinks. For the Introduction, Function Interfaces, and Data Interfaces sections, click Hide or Show to collapse or expand that section.

The code interface report provides several forms of hyperlink navigation. For example:

  • The Table of Contents located at the top of the code interface report provides links to each section and subsection of the report.

  • Click a function name to go to its definition in the generated code.

  • Click the header file name for a function to go to the header file source listing.

  • If you selected the configuration parameter Code-to-model, click links for these constructs to go to the corresponding location in the model display:

    • Function argument

    • Function return value

    • Variable representing an inport

    • Variable representing an outport

    • Interface parameter (if the parameter source is a block)

    • Variable representing a data store (if the data store source is a Data Store Memory block)

For backward and forward navigation within the HTML code generation report, use the Back and Forward buttons above the Content section in the upper-left corner of the report.

Interpret the Function Interfaces Section

The Function Interfaces section of the code interface report provides the following interface information about each model entry-point function, including model_initialize, model_step, and (if applicable) model_reset and model_terminate.

  • The function name.

  • Description of the purpose of the function including:

    • Sample time interval for functions that the code calls periodically. If the code does not call the function periodically, the section does not show a sample time.

    • A link to the associated model element for exported functions.

  • Header file information.

  • Function prototype, including the function name, parameters, and return value.

Function interfaces section of the code interface report.

Interpret the Data Interfaces Section

The Data Interfaces section of the code interface report provides information about data elements that are associated with the model. These include:

  • The code identifier (for example, input1) associated with the data elements in the generated code

  • The Simulink block name associated with the data interface

  • Description of the purpose of the service, including a link to the model element if the service is associated with a block

  • Header file information

  • Data type information

  • A list of functions that call the service, with a link to the report subsection for each function

  • Data communication method (outside execution, during execution, or direct access)

Code interface report for the Configuration Interface model showing the sections for data interfaces.

Code Interface Report Limitations

These limitations apply to the code interface section of the HTML code generation reports.

  • The code interface report supports data resolved with most storage classes, except when the storage class properties are set in one of these ways:

    • The storage class property Type is set to FlatStructure, such as when the BitField and Struct storage classes in the Simulink® package have Type set to FlatStructure.

    • The storage class property Type is set to Other, such as when the GetSet storage class in the Simulink package has Type set to Other.

    • The storage class property Data access is set to Pointer, indicating that the code declares imported symbols as pointer variables rather than simple variables. This property is accessible only when the storage class property Data scope is set to Imported or Instance-specific.

    In these cases, the report displays empty Data Type and Dimension fields.

  • For outports, if you optimize memory, the code interface report cannot describe the associated memory (data type and dimensions). In these cases, the report displays empty Data Type and Dimension fields.

  • The code interface report does not support data type replacement using the Code Generation > Data Type Replacement pane of the Configuration Parameters dialog box. The data types in the report link to built-in data types rather than their specified replacement data types.

Related Topics