Main Content

Verify Generated Application Code and Systems of Applications

R2026b

After you generate application code for a software component model that is part of a system architecture, use available tools to verify the algorithm code of the generated application, using stubbed (simulated) service implementations. To test numerical equivalency between software component model simulation and the generated code, from the architecture model or test harness that contains the software component, use the SIL/PIL Manager to run software-in-the-loop (SIL) and processor-in-the-loop (PIL) simulations on the component model (see SIL/PIL Manager Verification Workflow, Software-in-the-Loop Simulation, and Processor-in-the-Loop Simulation).

In addition to SIL and PIL simulations, tools are available for:

Verify Applications as Part of a System

To verify a system of applications generated from a composition of software component models, you can use the SIL/PIL Manager inSystem Composer™ to test for numerical equivalence between normal mode simulation and simulation of generated application code. See Build, Verify, and Deploy Applications for Brake Control System for an example.

Alternatively, use a test harness to simulate the system of applications. Create a test harness from one of these sources:

  • Software component model block diagram

  • Model block that references the software component model in an architecture model

  • Architecture model block diagram

These options support SIL simulation of the underlying software component model. Choose a source based on what you want to test. For example, an architecture model creates a test harness around the architecture that includes the software component model rather than isolating the component model and mocking its connections. For guidance on choosing an approach, see Choose a SIL or PIL Approach.

Note

To avoid numerical mismatches for export-function software component models that use sender-receiver communication services configured to handle status values, connect root-level receiver and sender blocks to the port of the function that provides the corresponding service. The presence of a sender or receiver port at the component root level signifies a dependency in the model code on the corresponding service.

If you have access to Simulink® Test™, see Test Harnesses for Models and Model Components (Simulink Test) for information on using that product to create and run test harnesses.

Generate and Review Application Build Reports

To create a service-based application build report for a software component model, before building the software component model, do the following:

  1. In the Software Component Designer app, open a software component model. If a software component model is in an architecture model, right-click the software component model that you want to generate a report for. In the context menu, under Reference Component, click the Open as Top Model button.

  2. Open the model Configuration Parameters dialog box. Select Create code generation report, and optionally select Open report automatically.

  3. Save the model, and close the model window.

  4. In the model window showing the architecture model in the Software Component Designer app, click Generate Code and select Build. During the build process, the code generator creates the report, and if you selected Open report automatically, opens the report.

When you initiate a build for an architecture model the code generator produces a report for each software component model that has the parameter Create code generation report selected. The code generator does not produce a report for an architecture model.

By default, an application report provides access to generated files in a navigation pane and links to these sections in the report:

  • Summary

  • Application Report

  • Application Configuration and Execution

  • Subsystem Report

  • Code Interface Report

  • Traceability Report

  • Static Code Metrics Report

  • Code Replacements Report

  • Coder Assumptions

The first three sections are unique to reports generated for service-based software component models. The following table explains the content provided in those sections.

SectionContents
Summary
  • Model information, including:

    • Username of the model author

    • Username of the last person to modify the model

    • Model version

    • Platform the model is being deployed to

    • Tasking mode

    • Link to a list of model configuration parameter settings at the time of code generation

  • Code information, including:

    • Setting of model configuration parameter Language standard

    • Setting of model configuration parameter System target file

    • Setting of model configuration parameter Device type

    • Simulink Coder™ version

    • Timestamp of the generated source code

    • Location of the generated application

    • Type of build

    • Code generation objectives specified

  • Whether the Code Generation Advisor ran, along with a link to the report if it did run

Application Report
  • Communication middleware configured for the model

  • Input and output port information, which varies depending on the middleware configured for the software component model

Application Configuration and Execution
  • Application overview

  • Application options - This information for each application option:

    • Name

    • Description

    • Default setting

    • Valid values

    • How to configure the option

  • Build and deploy instructions based on the model platform and settings of the Toolchain and Generate code only model configuration parameters

For more information about other types of reports, see Reports for Code Generation and Generate Code Generation Report.

See Also

| |

Topics