Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Contents

fxptdlg

Start Fixed-Point Tool

Syntax

fxptdlg('modelname')

Description

fxptdlg('modelname') starts the Fixed-Point Tool for the Simulink® model specified by modelname. You can also access this tool by the following methods:

  • From the Simulink Analysis menu, select Fixed Point Tool.

  • From a subsystem context (right-click) menu, select Fixed Point Tool.

In conjunction with Fixed-Point Designer™ software, the Fixed-Point Tool provides convenient access to:

  • Model and subsystem parameters that control the signal logging, fixed-point instrumentation mode, and data type override, namely, MinMaxOverflowArchiveMode, MinMaxOverflowLogging, DataTypeOverride, and DataTypeOverrideAppliesTo (see Model Parameters)

  • Plotting capabilities that enable you to plot data that resides in the MATLAB® workspace, namely, simulation results associated with Scope, To Workspace, and root-level Outport blocks, in addition to logged signal data (see Signal Logging)

  • An interactive automatic data typing feature that proposes fixed-point data types for appropriately configured objects in your model, and then allows you to selectively accept and apply the data type proposals

You can launch the Fixed-Point Tool for any system or subsystem, and the tool controls the object selected in its Model Hierarchy pane. If Fixed-Point Designer software is installed, the Fixed-Point Tool Contents pane displays the name, data type, design minimum and maximum values, minimum and maximum simulation values, and scaling of each model object that logs fixed-point data. Additionally, if a signal saturates or overflows, the tool displays the number of times saturation or overflow occurred. You can display an object's dialog box by right-clicking the appropriate entry in the Contents pane and selecting Properties.

    Note:   The Fixed-Point Tool works only for models that simulate in Normal mode. The tool does not work when you simulate your model in Accelerator or Rapid Accelerator mode.

Overriding Fixed-Point Specifications

Most of the functionality in the Fixed-Point Tool is for use with the Fixed-Point Designer software. However, even if you do not have Fixed-Point Designer software, you can configure data type override settings to simulate a model that specifies fixed-point data types. In this mode, the Simulink software temporarily overrides fixed-point data types with floating-point data types when simulating the model.

    Note:   If you use fi objects or embedded numeric data types in your model or workspace, you might introduce fixed-point data types into your model. You can set fipref to prevent the checkout of a Fixed-Point Designer license.

To simulate a model without using Fixed-Point Designer:

  1. In the Model Hierarchy pane, select the root model.

  2. From the Simulink model Analysis menu, select Fixed Point Tool.

    The Fixed-Point Tool opens.

  3. In the Current system settings panel:

    • Set the Fixed-point instrumentation mode parameter to Force off.

    • Set the Data type override parameter to Double or Single.

    • Set the Data type override applies to parameter to All numeric types.

  4. If you use fi objects or embedded numeric data types in your model, set the fipref DataTypeOverride property to TrueDoubles or TrueSingles (to be consistent with the model-wide data type override setting) and the DataTypeOverrideAppliesTo property to All numeric types.

    For example, at the MATLAB command line, enter:

     p = fipref('DataTypeOverride', 'TrueDoubles', ...
    		'DataTypeOverrideAppliesTo', 'AllNumericTypes');

Parameters and Dialog Box

The Fixed-Point Tool includes the following components:

Main Toolbar

The Fixed-Point Tool's main toolbar appears near the top of the Fixed-Point Tool window under the Fixed-Point Tool's menu.

The toolbar contains the following buttons that execute commonly used Fixed-Point Tool commands:

ButtonUsage

Open the Fixed-Point Advisor to prepare the model for conversion to fixed point.

Simulate a model and store the run results.

Pause a simulation.

Stop a simulation.

Analyze model and store derived minimum and maximum results.

Propose data types. Propose fraction lengths for specified word lengths or propose word lengths for specified fraction lengths.

Apply accepted data types.

Show details for selected result.

Compare selected runs.

Create a difference plot for the selected signals.

Plot the selected signal.

Create a histogram plot for the selected signal.

The toolbar also contains the Show option:

The Show option specifies the type of results to display in the Contents pane. The Contents pane displays information only after you simulate a system or propose fraction lengths. If there are no results that satisfy a particular filter option, the list will be blank.

Show OptionResult

All results

Displays all results for the selected tree node.

Signal Logging results

For the selected tree node, displays blocks whose output ports have logged signal data. The Fixed-Point tool marks these blocks with the logged signal icon .

    Note:   You can plot simulation results associated with logged signal data. For more information, see Plot Interface.

Min/Max results

For the selected tree node, displays blocks that record design Min/Max, simulation Min/Max, and overflow data.

Prerequisites: Fixed-point instrumentation mode should not be set to Force Off.

Overflows

For the selected tree node, displays blocks that have non-zero overflows recorded. If a block has its Saturate on integer overflow option selected, overflow information appears in the Saturations column, otherwise it appears in the OverflowWraps column.

Conflicts with proposed data types

For the selected tree node, displays results that have potential data typing or scaling issues.

Prerequisites: This information is available only after you propose data types.

The Fixed-Point Tool marks these results with a yellow or red icon, as shown here:

The proposed data type poses potential issues for this object. Open the Result Details dialog box to review these issues.

The proposed data type will introduce errors if applied to this object. Open the Result Details dialog box for details about how to resolve these issues.

Groups that must share the same data type

For the selected tree node, displays blocks that must share the same data type because of data type propagation rules.

Prerequisites: This information is available only after you propose fraction lengths.

The Fixed-Point Tool allocates an identification tag to blocks that must share the same data type. This identification tag is displayed in the DTGroup column as follows:

  • If the selected tree node is the model root

    All results for the model are listed. The DTGroup column is sorted by default so that you can easily view all blocks in a group.

  • If the selected tree node is a subsystem

    The identification tags have a suffix that indicates the total number of results in each group. For example, G2(2) means group G2 has 2 members. This information enables you to see how many members of a group belong to the selected subsystem and which groups share data types across subsystem boundaries.

Model Hierarchy Pane

The Model Hierarchy pane displays a tree-structured view of the Simulink model hierarchy. The first node in the pane represents a Simulink model. Expanding the root node displays subnodes that represent the model's subsystems, MATLAB Function blocks, Stateflow® charts, and referenced models.

The Fixed-Point Tool's Contents pane displays elements that comprise the object selected in the Model Hierarchy pane. The Dialog pane provides parameters for specifying the selected object's data type override and fixed-point instrumentation mode. Objects that control the Fixed-point instrumentation mode parameter display a red flag on their icons, while those that control the Data type override parameter display a green flag. The Model Hierarchy pane indicates the value of these parameters by displaying the following abbreviations next to the object name:

AbbreviationParameter Value

Fixed-point instrumentation mode

    mmoMinimums, maximums and overflows
    oOverflows only
    foForce off

Data type override

    sclScaled double
    dblDouble
    sglSingle
    foOff

See Dialog Pane for more information about these parameters.

Contents Pane

The Contents pane displays a tabular view of objects that log fixed-point data in the system or subsystem selected in the Model Hierarchy pane. The table rows correspond to model objects, such as blocks, block parameters, and Stateflow data. The table columns correspond to attributes of those objects, such as the data type, design minimum and maximum values, and simulation minimum and maximum values.

The Contents pane displays information only after you simulate a system, analyze the model to derive minimum and maximum values, or propose fraction lengths.

You can control which of the following columns the Fixed-Point Tool displays in this pane. For more information, see Customizing the Contents Pane View.

Column LabelDescription

Accept

Check box that enables you to selectively accept the Fixed-Point Tool's data type proposal.

CompiledDesignMax

Compile-time information for DesignMax.

CompiledDesignMin

Compile-time information for DesignMin.

CompiledDT

Compile-time data type. This data type appears on the signal line in sfix format. See Fixed-Point Data Type and Scaling Notation.

DerivedMax

Maximum value the Fixed-Point tool derives for this signal from design ranges specified for blocks.

DerivedMin

Minimum value the Fixed-Point tool derives for this signal from design ranges specified for blocks.

DesignMax

Maximum value the block specifies in its parameter dialog box, for example, the value of its Output maximum parameter.

DesignMin

Minimum value the block specifies in its parameter dialog box, for example, the value of its Output minimum parameter.

DivByZero

Number of divide-by-zero instances that occur during simulation.

DTGroup

Identification tag associated with objects that share data types.

InitValueMax

Maximum initial value for a signal or parameter. Some model objects provide parameters that allow you to specify the initial values of their signals. For example, the Constant block includes a Constant value that initializes the block output signal.

    Note:   The Fixed-Point Tool uses this parameter when it proposes data types.

InitValueMin

Minimum initial value for a signal or parameter. Some model objects provide parameters that allow you to specify the initial values of their signals. For example, the Constant block includes a Constant value that initializes the block output signal.

    Note:   The Fixed-Point Tool uses this parameter when it proposes data types.

LogSignal

Check box that allows you to enable or disable signal logging for an object.

ModelRequiredMin

Minimum value of a parameter used during simulation. For example, the n-D Lookup Table block uses the Breakpoints and Table data parameters to perform its lookup operation and generate output. In this example, the block uses more than one parameter so the Fixed-Point Tool sets ModelRequiredMin to the minimum of the minimum values of all these parameters.

    Note:   The Fixed-Point Tool uses this parameter when it proposes data types.

ModelRequiredMax

Maximum value of a parameter used during simulation. For example, the n-D Lookup Table block uses the Breakpoints and Table data parameters to perform its lookup operation and generate output. In this example, the block uses more than one parameter so the Fixed-Point Tool sets ModelRequiredMax to the maximum of the maximum values of all these parameters.

    Note:   The Fixed-Point Tool uses this parameter when it proposes data types.

Name

Identifies path and name of block.

OverflowWraps

Number of overflows that wrap during simulation.

ProposedDT

Data type that the Fixed-Point Tool proposes.

ProposedMax

Maximum value that results from the data type the Fixed-Point Tool proposes.

ProposedMin

Minimum value that results from the data type the Fixed-Point Tool proposes.

Run

Indicates the run name for these results.

Saturations

Number of overflows that saturate during simulation.

SimDT

Data type the block uses during simulation. This data type appears on the signal line in sfix format. See Fixed-Point Data Type and Scaling Notation.

SimMax

Maximum value that occurs during simulation.

SimMin

Minimum value that occurs during simulation.

SpecifiedDT

Data type the block specifies in its parameter dialog box, for example, the value of its Output data type parameter.

Customizing the Contents Pane View

You can customize the Contents pane in the following ways:

Using Column Views

The Fixed-Point Tool provides the following standard Column Views:

View NameColumns ProvidedWhen Does the Fixed-Point Tool Display this View?
Simulation View (default)Name, Run, CompiledDT, SpecifiedDT, SimMin, SimMax, DesignMin, DesignMax, OverflowWraps, SaturationsAfter a simulating minimum and maximum values.
Automatic Data Typing ViewName, Run, CompiledDT, CompiledDesignMax, CompiledDesignMin,Accept, ProposedDT, SpecifiedDT, DesignMin, DesignMax, DerivedMin, DerivedMax, SimMin, SimMax, OverflowWraps, Saturations, ProposedMin, ProposedMaxAfter proposing data types if proposal is based on simulation, derived, and design min/max.
Automatic Data Typing With Simulation Min/Max ViewName, Run, CompiledDT, Accept, ProposedDT, SpecifiedDT, SimMin, SimMax, DesignMin, DesignMax, OverflowWraps, Saturations, ProposedMin, ProposedMaxAfter proposing data types if the proposal is based on simulation and design min/max.
Automatic Data Typing With Derived Min/Max ViewName, Run, CompiledDesignMax, CompiledDesignMin,Accept, ProposedDT, SpecifiedDT, DerivedMin, DerivedMax, ProposedMin, ProposedMaxAfter proposing data types if the proposal is based on design min/max and/or derived min/max.
Data Collection ViewName, Run, CompiledDT, SpecifiedDT, DerivedMin, DerivedMax, SimMin, SimMax, OverflowWraps, SaturationsAfter simulating or deriving minimum and maximum values if the results have simulation min/max, derived min/max, and design min/max.
Derived Min/Max ViewName, Run, CompiledDesignMax, CompiledDesignMin, DerivedMin, DerivedMaxAfter deriving minimum and maximum values.

By selecting Show Details, you can:

  • Customize the standard column views

  • Create your own column views

  • Export and import column views saved in MAT-files, which you can share with other users

  • Reset views to factory settings

    If you upgrade to a new release of Simulink, and the column views available in the Fixed-Point Tool do not match the views described in the documentation, reset your views to factory settings. When you reset all views, the Model Explorer removes all the custom views you have created. Before you reset views to factory settings, export any views that you will want to use in the future.

For more information on controlling views, see Control Model Explorer Contents Using Views

Changing Column Order and Width

You can alter the order and width of columns that appear in the Contents pane as follows:

  • To move a column, click and drag the head of a column to a new location among the column headers.

  • To make a column wider or narrower, click and drag the right edge of a column header. If you double-click the right edge of a column header, the column width changes to fit its contents.

Sorting by Columns

By default, the Contents pane displays its contents in ascending order of the Name column. You can alter the order in which the Contents pane displays its rows as follows:

  • To sort all the rows in ascending order of another column, click the head of that column.

  • To change the order from ascending to descending, simply click again on the head of that column.

Dialog Pane

Use the Dialog pane to view and change properties associated with the object selected in the Model Hierarchy pane.

The Dialog pane includes the following components:

ComponentDescription
Fixed-point preparation for selected systemContains the Fixed-Point Advisor button. Use this button to open the Fixed-Point Advisor to guide you through the tasks to prepare your floating-point model for conversion to fixed point. For more information, see Fixed-Point Advisor.
Shortcuts to set up runsContains shortcuts that allow you to set up run parameters, such as the run name and data type override settings, by clicking a button. The Fixed-Point Tool provides several factory default shortcuts for common configurations and allows you to set up your own shortcuts. For more information, see Shortcuts to set up runs.
Settings for selected systemContains controls to set the fixed-point instrumentation mode and data type override settings. For more information, see Fixed-point instrumentation mode, Data type override, and Data type override applies to.
Data collectionContains controls to collect simulation or derived minimum and maximum data for your model.
Automatic data typing for selected systemContains controls to propose and, optionally, accept data type proposals.
Show details for selected resultUse this button to view data type information about the object selected in the Contents pane. For more information, see Show details for selected result.

Tips

From the Fixed-Point Tool View menu, you can customize the layout of the Dialog pane. Select:

  • Show Dialog View to show/hide the Dialog pane. By default, the Fixed-Point Tool displays this pane. Hide it to make more room for displaying results.

  • Settings for selected system to show/hide the Settings for selected system pane. By default, the Fixed-Point Tool displays this pane.

  • Show Fixed-Point Advisor to show/hide the Prepare conversion in the Fixed-Point Advisor button. By default, the Fixed-Point Tool displays this button.

Fixed-Point Advisor

Open the Fixed-Point Advisor

Action

Opens the Fixed-Point Advisor which guides you through the tasks to prepare a floating-point model for conversion to fixed point.

Use the Fixed-Point Advisor if:

  • You have a floating-point model

  • You have inheritance rules in your model

  • Your model contains blocks that do not support fixed-point data types

Shortcuts to set up runs

Use shortcuts to configure model-wide data type override and instrumentation settings prior to simulation. The Fixed-Point Tool provides:

  • Frequently-used factory default shortcuts

  • The ability to add and edit custom shortcuts

    Note:   The factory default shortcuts apply to the whole model. You cannot use these shortcuts to configure subsystems.

Factory Defaults

Factory Default ShortcutDescription
Model-wide double override and full instrumentation

Sets:

  • Run name to DoubleOverride

  • Fixed-point instrumentation mode to Minimums, maximums and overflows

  • Data type override to Double

  • Data type override applies to to All numeric types

By default, a button for this shortcut appears in the Shortcuts to set up runs pane.

Model-wide no override with full instrumentation

Sets:

  • Run name to FixedPoint

  • Fixed-point instrumentation mode to Minimums, maximums and overflows

  • Data type override to Use local settings

By default, a button for this shortcut appears in the Shortcuts to set up runs pane.

Model-wide single override and full instrumentation

Sets:

  • Run name to SingleOverride

  • Fixed-point instrumentation mode to Minimums, maximums and overflows

  • Data type override to Single

  • Data type override applies to to All numeric types

Model-wide instrumentation off

Sets Fixed-point instrumentation mode to Force Off. Does not affect run name or data type override settings.

Add/Edit shortcuts

Use Add/Edit shortcuts to open the Shortcut Editor, which you use to add new shortcuts or edit existing user-defined shortcuts. You cannot edit the factory default shortcuts.

Fixed-point instrumentation mode

Control which objects log minimum, maximum and overflow data during simulation.

Settings

Default: Use local settings

Use local settings

Logs data according to the value of this parameter set for each subsystem. Otherwise, settings for parent systems always override those of child systems.

Minimums, maximums and overflows

Logs minimum value, maximum value, and overflow data for all blocks in the current system or subsystem during simulation.

Overflows only

Logs only overflow data for all blocks in the current system or subsystem.

Force off

Does not log data for any block in the current system or subsystem. Use this selection to work with models containing fixed-point enabled blocks if you do not have a Fixed-Point Designer license.

Tips

  • The Fixed-Point Tool marks the system controlling the Fixed-point instrumentation mode with a red flag .

  • You cannot change the instrumentation mode for linked subsystems or referenced models.

Dependencies

The value of this parameter for parent systems controls min/max logging for all child subsystems, unless Use local settings is selected.

Command-Line Alternative

Parameter: 'MinMaxOverflowLogging'
Type: string
Value: 'UseLocalSettings' | 'MinMaxAndOverflow' | 'OverflowOnly' | 'ForceOff'
Default: 'UseLocalSettings'

Data type override

Control data type override of objects that allow you to specify data types in their dialog boxes.

Settings

Default: Use local settings

The value of this parameter for parent systems controls data type override for all child subsystems, unless Use local settings is selected.

Use local settings

Overrides data types according to the setting of this parameter for each subsystem.

Scaled double

Overrides the data type of all blocks in the current system and subsystem with doubles; however, the scaling and bias specified in the dialog box of each block is maintained.

Double

Overrides the output data type of all blocks in the current system or subsystem with doubles. The overridden values have no scaling or bias.

Single

Overrides the output data type of all blocks in the current system or subsystem with singles. The overridden values have no scaling or bias.

Off

No data type override is performed on any block in the current system or subsystem. The settings on the blocks are used.

Tips

  • Set this parameter to Double or Single and the Data type override applies to parameter to All numeric types to work with models containing fixed-point enabled blocks if you do not have a Fixed-Point Designer license.

  • You cannot change the Data type override setting on linked subsystems or referenced models.

  • The Fixed-Point Tool marks the system controlling the Data type override mode with a green flag .

  • Data type override never applies to boolean data types.

  • When you set the Data type override parameter of a parent system to Double, Single, Scaled double or Off, this setting also applies to all child subsystems and you cannot change the data type override setting for these child subsystems. When the Data type override parameter of a parent system is Use local setting, you can set the Data type override parameter for individual children.

  • Use this parameter with the Data type override applies to parameter. The following table details how these two parameters affect the data types in your model.

    Fixed-Point Tool SettingsBlock Local Settings
    Data type overrideData type override applies toFloating-point typesFixed-point types
    Use local settings/OffN/AUnchangedUnchanged
    DoubleAll numeric typesDoubleDouble
    Floating-pointDoubleUnchanged
    Fixed-pointUnchangedDouble
    SingleAll numeric typesSingleSingle
    Floating-pointSingleUnchanged
    Fixed-pointUnchangedSingle
    Scaled doubleAll numeric typesDoubleScaled double equivalent of fixed-point type
    Floating-pointDoubleUnchanged
    Fixed-pointUnchangedScaled double equivalent of fixed-point type

Dependencies

  • The following Simulink blocks allow you to set data types in their block masks, but ignore the Data type override setting:

Command-Line Alternative

Parameter: 'DataTypeOverride'
Type: string
Value: 'UseLocalSettings' | 'ScaledDouble' | 'Double' | 'Single' | 'Off'
Default: 'UseLocalSettings'

Data type override applies to

Specifies which data types the Fixed-Point Tool overrides

Settings

Default: All numeric types

All numeric types

Data type override applies to all numeric types, floating-point and fixed-point. It does not apply to boolean or enumerated data types.

Floating-point

Data type override applies only to floating-point data types, that is, double and single.

Fixed-point

Data type override applies only to fixed-point data types, for example, uint8, fixdt.

Tips

  • Use this parameter with the Data type override parameter.

  • Data type override never applies to boolean or enumerated data types or to buses.

  • When you set the Data type override parameter of a parent system to Double, Single, Scaled double or Off, this setting also applies to all child subsystems and you cannot change the data type override setting for these child subsystems. When the Data type override parameter of a parent system is Use local setting, you can set the Data type override parameter for individual children.

  • The following table details how these two parameters affect the data types in your model.

    Fixed-Point Tool SettingsBlock Local Settings
    Data type overrideData type override applies toFloating-point typesFixed-point types
    Use local settings/OffN/AUnchangedUnchanged
    DoubleAll numeric typesDoubleDouble
    Floating-pointDoubleUnchanged
    Fixed-pointUnchangedDouble
    SingleAll numeric typesSingleSingle
    Floating-pointSingleUnchanged
    Fixed-pointUnchangedSingle
    Scaled doubleAll numeric typesDoubleScaled double equivalent of fixed-point type
    Floating-pointDoubleUnchanged
    Fixed-pointUnchangedScaled double equivalent of fixed-point type

Dependencies

This parameter is enabled only when Data type override is set to Scaled double, Double or Single.

Command-Line Alternative

Parameter: 'DataTypeOverrideAppliesTo'
Type: string
Value: 'AllNumericTypes' | 'Floating-point' | 'Fixed-point'
Default: 'AllNumericTypes'

Store results in run

Specifies the run name

If you use a shortcut to set up a run, by default, the Fixed-Point Tool uses the run name associated with this shortcut. You can override the run name by entering a new name in this field.

Tips

  • To store data for multiple runs, provide a different run name for each run. Running two simulations with the same run name overwrites the original run.

  • You can edit the run name in the Contents pane Run column.

Simulate

Simulates model and stores results.

Action

Simulates the model and stores the results with the run name specified in Store results in run. The Fixed-Point Tool displays the run name in the Run column of the Contents pane.

Tips

Using the Simulate button is the same as simulating the model using the Run button in the Simulink model.

Command-Line Alternative

Command: sim

Merge instrumentation results from multiple simulations

Control how simulation results are stored

Settings

Default: Off

On

Merges new simulation minimum and maximum results with existing simulation results in the run specified by the run name parameter. Allows you to collect complete range information from multiple test benches. Does not merge signal logging results.

Off

Clears all existing simulation results from the run specified by the run name parameter before displaying new simulation results.

Command-Line Alternative

Parameter: 'MinMaxOverflowArchiveMode'
Type: string
Value: 'Overwrite' | 'Merge'
Default: 'Overwrite'

Tip

Select this parameter to log simulation minimum and maximum values captured over multiple simulations.

Derive min/max values for selected system

Derive minimum and maximum values for signals for the selected system

The Fixed-Point Tool analyzes the selected system to compute derived minimum and maximum information based on the design minimum and maximum values specified on blocks. For example, using the Output minimum and Output maximum for block outputs.

Action

Analyzes the selected system to compute derived minimum and maximum information based on the design minimum and maximum values specified on blocks.

By default, the Fixed-Point Tool displays the Derived Min/Max View with the following information in the Contents pane.

  • Name

  • Run

  • CompiledDesignMax

  • CompiledDesignMin

  • DerivedMax

  • DerivedMin

  • DesignMax

  • DesignMin

If Highlight results with potential issues is selected, the tool alerts you to potential issues for each object in the list by highlighting the object in the Contents pane.

Command-Line Alternative

No command line alternative available.

Dependencies

Range analysis:

  • Requires a Fixed-Point Designer license.

  • Does not run on Mac platforms.

Highlight results with potential issues

Highlight results that have saturations, overflows or insufficient design min/max information to derive results.

Settings

Default: On

On

Highlight results with potential issues.

After simulating the model, the Fixed-Point Tool highlights results that have either saturations or overflows.

After analyzing the model to derive minimum and maximum values, the tool highlights both the results that have issues and the results that are likely to be the cause of the issue. For example, if the tool cannot derive ranges for an object because an upstream object does not have sufficient design minimum and maximum information, it highlights both results.

The Fixed-Point Tool uses different colors to highlight the results that have issues and the results that might be the cause of issues.

Off

Do not highlight results. Remove existing highlighting.

Command-Line Alternative

No command line alternative available.

Tip

Select a highlighted result and click Show details for selected result to view more information about the issue.

Propose fraction lengths

Use range information and propose fraction lengths for model objects.

Action

Use this button to perform the first phase of the automatic data typing procedure, in which the Fixed-Point Tool uses range information for model objects—from design minimum and maximum values the objects specify explicitly, or from logged minimum and maximum values that occur during simulation, or from derived minimum and maximum values. Based on these values, the tool proposes fraction lengths for blocks whose:

  • Lock output data type setting against changes by the fixed-point tools or Lock data type settings against changes by the fixed-point tools check box is cleared.

  • Data type specifies a generalized fixed-point number.

The Fixed-Point Tool lists its scaling proposals in the Contents pane. The tool alerts you to potential scaling issues for each object in the list by displaying a green, yellow, or red icon, as shown here:

The proposed scaling poses no issues for this object.

The proposed scaling poses potential issues for this object. Open the Autoscale Information dialog box to review these issues.

The proposed scaling will introduce data type errors if applied to this object. Open the Autoscale Information dialog box for details about how to resolve these issues.

Command-Line Alternative

No command line alternative available.

Propose word lengths

Use range information and propose word lengths for model objects.

Action

Use this button to perform the first phase of the automatic data typing procedure, in which the Fixed-Point Tool uses range information for model objects—from design minimum and maximum values the objects specify explicitly, or from logged minimum and maximum values that occur during simulation, or from derived minimum and maximum values. Based on these values, the tool proposes word lengths for blocks whose:

  • Lock output data type setting against changes by the fixed-point tools or Lock data type settings against changes by the fixed-point tools check box is cleared.

  • Data type specifies a generalized fixed-point number.

The Fixed-Point Tool lists its data type proposals in the Contents pane. The tool alerts you to potential issues for each object in the list by displaying a green, yellow, or red icon, as shown here:

The proposed data type poses no issues for this object.

The proposed data type poses potential issues for this object. Open the Result Details dialog box to review these issues.

The proposed data type will introduce errors if applied to this object. Open the Result Details dialog box for details about how to resolve these issues.

Command-Line Alternative

No command line alternative available.

Propose data types

Propose fraction lengths for specified word lengths

Select to propose fraction lengths for the word lengths specified in the model.

    Note:   This parameter appears only if the Automatic data typing for selected system Settings pane is displayed.

Propose word lengths for specified fraction lengths

Select to propose word lengths for the fraction lengths specified in the model.

    Note:   This parameter appears only if the Automatic data typing for selected system Settings pane is displayed.

Default data type for all floating-point signals

Specifies the default data type to use for all floating-point signals

Use to change the floating-point data types in the model to fixed point.

Settings

Default:

Remain floating-point

Does not change the data type of floating-point signals.

Select this option if you are using the Fixed-Point Tool to derive minimum and maximum values for the model. To propose data types for the model, you must set the default data type to be a built-in integer or fixed-point data type.

Same as embedded hardware integer

Sets the default data type for all floating-point signals to the integer type specified for the target hardware.

Select this option if your target hardware is a microprocessor.

int8

Sets the default data type for all floating-point signals to int8.

int16

Sets the default data type for all floating-point signals to int16.

int32

Sets the default data type for all floating-point signals to int32.

fixdt(1,16,4)

Sets the default data type for all floating-point signals to the fixed-point data type specified by fixdt. You can modify the parameters provided to fixdt to specify signedness, word length and fraction length.

Dependency

This parameter appears only if you click the Configure link on the Automatic data typing for selected system Settings pane.

Derived min/max

Propose fraction or word lengths based on design and derived minimum and maximum information.

Settings

Default: On

On

Propose fraction or word lengths based on derived minimum and maximum values, but only for blocks that do not specify design minimum or maximum values using, for example, Output minimum and Output maximum parameters.

If Simulation min/max is also selected, the Fixed-Point Tool bases its proposal on both the derived and simulation min/max values and the proposed data types cover the union of the derived range and the simulation range.

Off

Ignore derived minimum and maximum values when proposing fraction lengths.

Command-Line Alternative

No command line alternative available.

Dependency

This parameter appears only if you click the Configure link on the Automatic data typing for selected system Settings pane.

Simulation min/max

Propose fraction or word lengths based on design and simulation minimum and maximum values.

Settings

Default: On

On

Proposes fraction lengths based on simulation minimum and maximum values, but only for blocks that do not specify design minimum or maximum values using, for example, Output minimum and Output maximum parameters.

If Derived min/max is also selected, the Fixed-Point Tool bases its proposal on both the derived and simulation min/max values and the proposed data types cover the union of the derived range and the simulation range.

Off

Ignores simulation minimum and maximum values when proposing fraction lengths.

Command-Line Alternative

No command line alternative available.

Dependency

This parameter appears only if you click the Configure link on the Automatic data typing for selected system Settings pane.

Safety margin for design and derived min/max (%)

Specify safety factor for design and derived minimum and maximum values.

Settings

Default: 0

The design and derived minimum and maximum values are adjusted by the percentage designated by this parameter. For example, a value of 55 specifies that a range at least 55 percent larger is desired. A value of -15 specifies that a range up to 15 percent smaller is acceptable.

Dependency

Before performing autoscaling, you must specify design minimum and maximum values, or run a simulation to collect simulation minimum and maximum data, or collect derived minimum and maximum data.

Command-Line Alternative

No command line alternative available.

Dependency

This parameter appears only if you click the Configure link on the Automatic data typing for selected system Settings pane.

Safety margin for simulation min/max (%)

Specify safety factor for simulation minimum and maximum values.

Settings

Default: 0

The simulation minimum and maximum values are adjusted by the percentage designated by this parameter, allowing you to specify a range different from that obtained from the simulation run. For example, a value of 55 specifies that a range at least 55 percent larger is desired. A value of -15 specifies that a range up to 15 percent smaller is acceptable.

Dependencies

Before performing automatic data typing, you must specify design minimum and maximum values or run a simulation to collect simulation minimum and maximum data, or collect derived minimum and maximum values.

Command-Line Alternative

No command line alternative available.

Dependency

This parameter appears only if you click the Configure link on the Automatic data typing for selected system Settings pane.

Apply accepted fraction lengths

Apply scaling proposals

Action

Use this button to perform the second phase of the automatic data typing procedure, in which the Fixed-Point Tool applies the scaling proposals to the objects whose Accept check box in the Contents pane is selected.

Dependency

This button appears when Propose fraction lengths for specified word lengths is selected.

Command-Line Alternative

No command line alternative available.

Apply accepted word lengths

Apply data type proposals

Action

Use this button to perform the second phase of the automatic data typing procedure, in which the Fixed-Point Tool applies the data type proposals to the objects whose Accept check box in the Contents pane is selected.

Dependency

This button appears when Propose word lengths for specified fraction lengths is selected.

Command-Line Alternative

No command line alternative available.

Show details for selected result

Display details for object selected in the Contents pane

Action

Use this option to:

  • Determine why a fraction length cannot be proposed, for example, fraction lengths cannot be proposed for Library Links or Mask Subsystems.

  • Provide access to showing blocks with shared data types.

  • Obtain more information on the proposal for the selected result.

Command-Line Alternative

No command line alternative available.

Shortcut Editor

Shortcut Editor Overview

Use the Shortcut Editor to add or edit user-defined shortcuts. You cannot modify the factory default shortcuts. If you add a new shortcut and want it to appear as a button on the Fixed-Point Tool Shortcuts to set up runs pane, use the controls in the Manage shortcuts panel.

Name of shortcut

Enter a unique name for your shortcut. By default, the Fixed-Point Tool uses this name as the Run name for this shortcut.

If the shortcut name already exists, the new settings overwrite the existing settings.

Allow modification of fixed-point instrumentation settings

Select whether to change the model fixed-point instrumentation settings when you apply this shortcut to the model.

Settings

Default: On

On

When you apply this shortcut to the model, changes the fixed-point instrumentation settings of the model and its subsystems to the setting defined in this shortcut.

Off

Does not change the fixed-point instrumentation settings when you apply this shortcut to the model.

Tip

If you want to control data type override settings without altering the fixed-point instrumentation settings on your model, clear this option.

Allow modification of data type override settings

Select whether to change the model data type override settings when you apply this shortcut to the model

Settings

Default: On

On

When you apply this shortcut to the model, changes the data type override settings of the model and its subsystems to the settings defined in this shortcut .

Off

Does not change the fixed-point instrumentation settings when you apply this shortcut to the model.

Allow modification of run name

Select whether to change the run name on the model when you apply this shortcut to the model

Settings

Default: On

On

Changes the run name to the setting defined in this shortcut when you apply this shortcut to the model.

Off

Does not change the run name when you apply this shortcut to the model.

Run name

Specify the run name to use when you apply this shortcut.

By default, the run name defaults to the name of the shortcut. Run names are case sensitive.

Dependency

Allow modification of run name enables this parameter.

Capture system settings

Copy the model and subsystem fixed-point instrumentation mode and data type override settings into the Shortcut Editor.

Fixed-point instrumentation mode

Control which objects in the shortcut editor log minimum, maximum and overflow data during simulation.

This information is stored in the shortcut. To use the current model setting, click Capture system settings.

Settings

Default: Same as model setting

Use local settings

Logs data according to the value of this parameter set for each subsystem. Otherwise, settings for parent systems always override those of child systems.

Minimums, maximums and overflows

Logs minimum value, maximum value, and overflow data for all blocks in the current system or subsystem during simulation.

Overflows only

Logs only overflow data for all blocks in the current system or subsystem.

Force off

Does not log data for any block in the current system or subsystem. Use this selection to work with models containing fixed-point enabled blocks if you do not have a Fixed-Point Designer license.

Dependency

Allow modification of fixed-point instrumentation settings enables this parameter.

Data type override

Control data type override of objects that allow you to specify data types in their dialog boxes.

This information is stored in the shortcut. To use the current model settings, click Capture system settings.

Settings

Default: Same as model

The value of this parameter for parent systems controls data type override for all child subsystems, unless Use local settings is selected.

Use local settings

Overrides data types according to the setting of this parameter for each subsystem.

Scaled double

Overrides the data type of all blocks in the current system and subsystem with doubles; however, the scaling and bias specified in the dialog box of each block is maintained.

Double

Overrides the output data type of all blocks in the current system or subsystem with doubles. The overridden values have no scaling or bias.

Single

Overrides the output data type of all blocks in the current system or subsystem with singles. The overridden values have no scaling or bias.

Off

No data type override is performed on any block in the current system or subsystem. The settings on the blocks are used.

Dependency

Allow modification of data type override settings enables this parameter.

See Also

Data type override

Data type override applies to

Specifies which data types to override when you apply this shortcut.

This information is stored in the shortcut. To use the current model setting, click Capture system settings.

Settings

Default: All numeric types

All numeric types

Data type override applies to all numeric types, floating-point and fixed-point. It does not apply to boolean or enumerated data types.

Floating-point

Data type override applies only to floating-point data types, that is, double and single.

Fixed-point

Data type override applies only to fixed-point data types, for example, uint8, fixdt.

Dependency

Allow modification of data type override settings enables this parameter.

See Also

Data type override applies to

Manage shortcuts

Control which shortcuts appear as buttons on the Fixed-Point Tool Shortcuts to set up runs panel and the order in which they appear.

Plot Interface

The Fixed-Point Tool uses the Simulation Data Inspector tool plotting capabilities that enable you to plot signals for graphical analysis. The tool can access signal data that resides in the MATLAB workspace, allowing you to plot simulation results associated with:

  • Scope blocks whose Save data to workspace parameter is selected

  • To Workspace blocks

  • Root-level Outport blocks, when the Output check box on the Data Import/Export pane of the Configuration Parameters dialog box is selected

  • Logged signal data

    Tip   The Contents pane of the Fixed-Point Tool displays an antenna icon next to items that you can plot.

Using the Simulation Data Inspector tool, you can:

  • Compare signals

  • Inspect signals

  • Compare runs

Compare Signals

To compare signals:

  1. In one of the runs that you want to compare, select a logged signal.

  2. From the Fixed-Point Tool menu, select Results > Compare Signals or click .

  3. If there are more than two runs, in the Compare Runs Selector dialog box, select the run that you want to compare, and then click OK.

Plots the signal in both selected runs on the upper axes, and plots the difference between the selected runs on the lower axes. For more details, see Propose Fraction Lengths Using Simulation Range Data.

Inspect Signal

To inspect a signal:

  1. Select the logged signal that you want to inspect.

  2. From the Fixed-Point Tool menu, select Results > Inspect Signal or click .

Plots data as a function of time.

Note that, unlike the Fixed-Point Tool, the Simulation Data Inspector allows multiple runs with the same name.

Compare Runs

To compare runs:

  1. In one of the runs that you want to compare, select a logged signal.

  2. From the Fixed-Point Tool menu, select Results > Compare Runs or click .

  3. If there are more than two runs, in the Compare Runs Selector dialog box, select the run that you want to compare, and then click OK.

Plots the signal in both selected runs on the upper axes, and plots the difference between the selected runs on the lower axes.

Histogram Plot

To view the histogram plot of a signal:

  1. Select the logged signal that you want to plot.

  2. From the Fixed-Point Tool menu, select Results > Histogram Plot of Signal or click .

The histogram plot helps you visualize the dynamic range of a signal.

This plot provides information about the:

  • Total number of samples (N)

  • The maximum number of bits needed to prevent overflow

  • Number of times each bit has been used to represent the data (as a percentage of the total number of samples)

  • Number of times that exact zero occurred (without the effect of quantization). This does not include the number of zeroes that occurred due to rounding.

You can use this information to estimate the word size needed to represent the signal.

Signal Logging Options

The Fixed-Point Tool provides options that allow you to control signal logging in a model (see Signal Logging). Using these options, you can enable or disable logging for multiple signals simultaneously, based on signal attributes such as:

  • The location of signals in a model hierarchy

  • Whether or not signals have names

The Fixed-Point Tool does not control signal logging for referenced models or subsystems with library links. It ignores these objects when enabling or disabling signal logging in a model hierarchy.

You can control the signal logging of a Simulink subsystem, that is placed inside of a Stateflow Chart, from the subsystem parent node.

How to Access the Signal Logging Options in the Fixed-Point Tool

  1. In the Model Hierarchy pane, right-click a node that represents either a model or a subsystem.

    The Fixed-Point Tool displays a context menu for the selected node.

  2. In the context menu, select either Enable Signal Logging or Disable Signal Logging.

    The Fixed-Point Tool displays a submenu that lists a variety of signal logging options.

Signal Logging Options

Choose from the following signal logging options:

Select...

To Enable or Disable Signal Logging for...

All Signals in this System

All signals in the selected system

All Signals from Here Down

All signals in the selected system and its subsystems

Outports in this System

All Outport blocks in the selected system

Named Signals in this System

All signals in the selected system, whose Signal name parameter specifies a value

Named Signals from Here Down

All signals in the selected system and its subsystems, whose Signal name parameter specifies a value

Unnamed Signals in this System

All signals in the selected system, whose Signal name parameter is empty

Unnamed Signals from Here Down

All signals in the selected system and its subsystems, whose Signal name parameter is empty

Examples

To learn how to use the tool, see Propose Fraction Lengths Using Simulation Range Data.

See Also

Was this topic helpful?