Wrap on overflow
Description
Select the diagnostic action to take if the value of a signal overflows the signal data type and wraps around.
Category: Diagnostics
Settings
Default: warning
none
Simulink® software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation or code generation and displays an error message.
Tips
This diagnostic applies only to overflows which wrap for integer and fixed-point data types.
This diagnostic also reports division by zero for all data types, including floating-point data types.
To check for floating-point overflows (for example,
Inf
orNaN
) fordouble
orsingle
data types, select the Inf or NaN block output diagnostic. (See Inf or NaN block output for more information.)If a floating-point to integer or floating-point to fixed-point overflow is signaled, set the model parameter
EfficientFloat2IntCast
to'off'
to ensure that simulation and the generated code agree. See Remove code from floating-point to integer conversions that wraps out-of-range values (Simulink Coder) for more detail.For models referenced in accelerator mode, Simulink ignores the Wrap on overflow parameter setting if you set it to a value other than
None
.You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.
In the Simulink Editor, in the Modeling tab, click Model Advisor, then click OK.
Select By Task.
Run the Check diagnostic settings ignored during accelerated model reference simulation check.
During code generation, Simulink may simulate a few blocks in the model for optimization purposes. If simulation of these blocks triggers this diagnostic to report an error, the software terminates code generation.
Command-Line Information
Parameter: IntegerOverflowMsg |
Value: 'none' | 'warning' | 'error' |
Default: 'warning' |
Recommended Settings
Application | Setting |
---|---|
Debugging | warning |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | error |