Verify Generated Application Code and Systems of Applications
R2026bAfter 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:
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.
Open the model Configuration Parameters dialog box. Select Create code generation report, and optionally select Open report automatically.
Save the model, and close the model window.
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.
| Section | Contents |
|---|---|
| Summary |
|
| Application Report |
|
| Application Configuration and Execution |
|
For more information about other types of reports, see Reports for Code Generation and Generate Code Generation Report.
See Also
SIL/PIL Manager | Create code generation report | Open report automatically