Recommended Model Configuration Parameters for Polyspace Analysis
Before analyzing the generated code, check that your model configuration is optimized
for a Polyspace® analysis. Set the following parameters to the recommended value. If you do
not use the recommended value for SystemTargetFile
, you get an error.
For other parameters, if you do not use the recommended value, you get a
warning.
Grouping | Command-Line | Name and Location in Configuration | Rationale for Recommendation |
---|---|---|---|
Code Generation | Name: Value: An Embedded Coder® Target Language Compiler (TLC) file. For example | Location: Code Generation Name: System target file Value: Embedded Coder target file | Polyspace supports targets based on
|
Name: Value:
| Location: Code Generation > Interface Name: MAT-file logging Value:
| Disabling MAT file logging enhances precision of Polyspace analysis | |
Name: Value:
| Location: Code Generation > Templates Name: Generate an example main program Value:
| Polyspace removes the example main before analysis if an example main is generated. | |
Name: Value:
| Location: Code Generation > Comments Name: Include comments Value:
| Including comments allow navigating from the generated code to the corresponding parts of the model. Additionally, Embedded Coder can insert comments that justify come coding rule violations automatically. | |
Optimization | Name: Value:
| Location: Optimization Name: Default parameter behavior Value:
| The value Inlined enhances precision of
Polyspace analysis. If you want to specify external constraints
on the parameters, set the value to
Tunable . |
Name: Value:
| Location: Optimization Name: Use memset to initialize floats and doubles to 0.0 Value:
| Using memset() to initialize floats and
doubles to 0.0 can cause additional violations
and orange checks in a Polyspace analysis. | |
Name: Value:
| Location: Optimization Name: Remove root level I/O zero initialization Value:
| Not selecting this configuration parameter can result in false positive violations or more orange checks. | |
Solver | Name: Value:
| Location: Solver Name: Type Value:
| Using fixed step solvers enhances the precision of Polyspace analysis. |
Name: Value:
| Location: Solver Name: Solver Value:
| Using discrete solvers enhances the precision of Polyspace analysis. |
In addition to setting the preceding model configuration parameters, you can use the Code generation Advisor to check the compatibility of your model with a Polyspace analysis of the generated code. See Analyze Code and Perform Software-in-the-Loop Testing (Simulink Check).