Main Content

Model Configuration Changes Made During Data Type Optimization

Data type optimization seeks to minimize an objective function while maintaining the original system behavior within a specified tolerance. You can optimize data types by using fxpopt at the command line, or by using the Optimized Fixed-Point Conversion workflow in the Fixed-Point Tool.

During the optimization process, the software changes the settings and model configuration parameters described below. You can restore these diagnostics after the optimization is complete in the Configuration Parameters dialog box or by using the set_param function.

Reason for Parameter ChangeParameterDefault ValueOptimization Changes Value to
Suppress DiagnosticsParameterDowncastMsg'error''none'
ParameterUnderflowMsg'none''none'
FixptConstUnderflowMsg'none''none'
ParameterPrecisionLossMsg'none''none'
FixptConstPrecisionLossMsg'none''none'
ParameterOverflowMsg'error''none'
FixptConstOverflowMsg'none''none'
IntegerOverflowMsg'warning''none'
IntegerSaturationMsg'warning''none'
Logging with the Simulation Data InspectorSignalLogging'on''on'
ReturnWorkspaceOutputs'on''on'
SaveFormat'Dataset''Dataset'
Reduce memory consumption of resultSaveTime'on''off'
SaveOutput'on''off'
Model validitySignalRangeChecking'none''error'
Understand resultShowPortDataTypes'off''on'
Accelerate optimizationSimulationMode'normal''accelerator'
Data type overrideDataTypeOverride'UseLocalSettings''Off'

You can use the showContents method of the OptimizationSolution object to print a summary of the changes made during data type optimization to the MATLAB® Command Window. For example, after optimizing data types according to the example Optimize Fixed-Point Data Types use showContents to view the model parameter changes that were made during data type optimization:

solution = result.Solutions(1);
showContents(solution)
ModelName: 'ex_auto_gain_controller'

    ModelParameters: 
    Index               Name                   Value    
    _____    __________________________    _____________

      1      SignalLogging                 'on'         
      2      ReturnWorkspaceOutputs        'on'         
      3      SaveFormat                    'Dataset'    
      4      ShowPortDataTypes             'on'         
      5      SignalRangeChecking           'error'      
      6      ParameterDowncastMsg          'none'       
      7      ParameterUnderflowMsg         'none'       
      8      ParameterPrecisionLossMsg     'none'       
      9      ParameterOverflowMsg          'none'       
     10      FixptConstPrecisionLossMsg    'none'       
     11      FixptConstOverflowMsg         'none'       
     12      FixptConstUnderflowMsg        'none'       
     13      IntegerOverflowMsg            'none'       
     14      IntegerSaturationMsg          'none'       
     15      SaveTime                      'off'        
     16      SaveOutput                    'off'        
     17      SimulationMode                'accelerator'
     18      DataTypeOverride              'off' 
...

Detect downcast

Take no action when a parameter downcast occurs during simulation. Quantization effects, including downcasts, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Detect downcast .

Parameter: ParameterDowncastMsg
Value: 'none'
Default: 'error'

Detect underflow

Take no action when parameter quantization causes a non-zero value to underflow to zero during simulation. Take no action when a fixed-point constant underflow occurs during simulation. Quantization effects, including underflow, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Detect underflow and Detect underflow.

Parameter: ParameterUnderflowMsg
Value: 'none'
Default: 'none'
Parameter: FixptConstUnderflowMsg
Value: 'none'
Default: 'none'

Detect precision loss

Take no action when parameter precision loss or fixed-point constant precision loss occurs during simulation. Quantization effects, including precision loss, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Detect precision loss and Detect precision loss.

Parameter: ParameterPrecisionLossMsg
Value: 'none'
Default: 'warning'
Parameter: FixptConstPrecisionLossMsg
Value: 'none'
Default: 'none'

Detect overflow

Take no action if a parameter overflow or fixed-point constant overflow occurs during simulation. Quantization effects, including overflow, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Detect overflow and Detect overflow.

Parameter: ParameterOverflowMsg
Value: 'none'
Default: 'error'
Parameter: FixptConstOverflowMsg
Value: 'none'
Default: 'none'

Wrap on overflow

Take no action if the value of a signal overflows the signal data type and wraps around. Quantization effects, including overflow, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Wrap on overflow.

Parameter: IntegerOverflowMsg
Value: 'none'
Default: 'warning'

Saturate on overflow

Take no action if the value of a signal is too large to be represented by the signal data type, resulting in saturation. Quantization effects, including overflow, are expected during optimization. Optimized data types will meet all specified behavioral constraints. For more information, see Saturate on overflow.

Parameter: IntegerSaturationMsg
Value: 'none'
Default: 'warning'

Signal logging

Globally enable signal logging to the workspace for this model. Optimization requires this setting to log specified signals to the Simulation Data Inspector. For more information, see Signal logging.

Parameter: SignalLogging
Value: 'on'
Default: 'on'

Single simulation output

Enable the single-output format of the sim command to return the simulation result as a Simulink.SimulationOutput object. Optimization requires this setting to log signals with the Simulation Data Inspector. For more information, see Single simulation output.

Parameter: ReturnWorkspaceOutputs
Value: 'on'
Default: 'on'

Format

Store each logged state and output in a Simulink.SimulationData.Dataset object. Optimization requires this setting for signal logging with the Simulation Data Inspector. For more information, see Log Data to Persistent Storage.

Parameter: SaveFormat
Value: 'Dataset'
Default: 'Dataset'

Time

Do not export time data to the MATLAB workspace during simulation. Optimization requires this setting to avoid unnecessary memory consumption. For more information, see Time.

Parameter: SaveTime
Value: 'off'
Default: 'on'

Output

Do not export root outport signal data to a specified MATLAB variable during simulation. Optimization requires this setting for signal logging with the Simulation Data Inspector. For more information, see Output.

Parameter: SaveOutput
Value: 'off'
Default: 'on'

Simulation range checking

Terminate the simulation when signals exceed specified minimum or maximum values. Optimization requires this setting to ensure that the simulation ranges of the model with optimized data types applied honors the specified design ranges. For more information, see Simulation range checking.

Parameter: SignalRangeChecking
Value: 'error'
Default: 'none'

Show port data types

Show data types of ports on the model block diagram. Optimization requires this setting to allow you to easily inspect the optimized data types applied to your model. For more information, see Programmatic Model Editor Appearance Parameters.

Parameter: ShowPortDataTypes
Value: 'on'
Default: 'off'

Simulation mode

Simulate the model in accelerator mode. Optimization uses accelerator mode to reduce the amount of time required to optimize data types on your model. For more information, see What Is Acceleration?.

Parameter: SimulationMode
Value: 'accelerator'
Default: 'normal'

Data type override

By default, optimization turns off any data type override set on your model so that the effect of optimized data types on model behavior is accurately represented during simulation. You can customize this behavior by using the advanced options of fxpOptimizationOptions. For more information, see Fixed-Point Instrumentation and Data Type Override.

Parameter: DataTypeOverride
Value: 'Off'
Default: 'UseLocalSettings'

See Also

|

Related Topics