Stateflow    

Overflow Detection for Fixed-Point Types

Overflow occurs when the magnitude of a result assigned to a data exceeds the numeric capacity of that data. You enable Stateflow to detect overflow of integer and fixed-point operations during simulation with the following steps:

  1. For the simulation target of your model, open the Code Generation Options dialog.
  1. See Accessing the Target Builder Dialog for a Target for instructions on how to access this dialog.

  1. Select both the Enable debugging/animation and Enable overflow detection (for debugging) options.
  1. For descriptions of these options, see Specifying Code Generation Options.

  1. Build the simulation target.
  1. See Starting a Simulation Target Build for instructions.

  1. Open the Debugger window and select the Data Range check box.
  1. See Error Checking Options for a description of this option.

  1. Begin simulation.

Simulation breaks execution when an overflow occurs.


  Assignment (=, :=) and Cast Operations Sharing Fixed-Point Data with Simulink