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.
The code generation settings for the model:
Set storage class of constParam
to Const and
codeTunableParam
to ExportedGlobal.
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.
Open Model Settings > Design Verifier > Parameters and Variants.
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.
The results window shows that all objectives for both the Multiport switch blocks are satisfied.
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.
The Undecided objectives are related to the code corresponding to Multiport Switch1.
See Also
Parameter Configuration for Analysis | Set Parameters Using Parameter Configuration File