Main Content

Automatically Infer Parameter Specification for Analysis

Simulink® Design Verifier™ automates the process of selecting parameters that is a part of parameter configuration and determines minimum and maximum values of such parameters configured in the Simulink.Parameter object.

When test generation target is Model, Simulink Design Verifier selects as many parameters as possible for parameter configuration.

When test generation target is Code Generated as Top Model or Code Generated as Model Reference, parameters whose value can be changed in the generated code are selected for parameter configuration.

The PreLoadFcn callback function model, defines codeTunableParam and constParam in the MATLAB® workspace.

Simulink model with a tunable parameter.

The code generation settings for the model:

Model properties window.

Set storage class of constParam to Const and codeTunableParam to ExportedGlobal.

Code Generation settings window.

Configuring Parameters by Using Automatically infer parameter specification

This example shows how to automatically infer constraint values used for model parameters during Simulink Design Verifier analysis.

  1. Open Model Settings > Design Verifier > Parameters and Variants.

  2. Click on the drop down for Parameter Configuration and select Automatically infer parameter specification.

    This automatically infers the parameters that will be selected based on the test generation target and the parameter settings based on their definition.

When the test generation target is Model, Simulink Design Verifier analysis selects all the supported parameters.

In the above example, both the parameters constParam and codeTunableParam, are configured during the analysis.

Parameter constraints in Simulink Design Verifier analysis report.

The results window shows that all objectives for both the Multiport switch blocks are satisfied.

Results window for Simulink Design Verifier analysis.

When the test generation target is set to Code Generated as Top Model, parameter constParam cannot be changed in the generated code. So, Simulink Design Verifier selects codeTunableParam for parameter configuration.

Parameter constraints in Simulink Design Verifier analysis report.

Results window for Simulink Design Verifier analysis.

The Undecided objectives are related to the code corresponding to Multiport Switch1.

See Also

|

Related Topics