Documentation Center

  • Trial Software
  • Product Updates

Preparing for Data Typing and Scaling

Prepare for Data Typing and Scaling Overview

Configure blocks with data type inheritance or constraints to avoid data type propagation errors.

Description

The block settings from this folder simplify the initial data typing and scaling. The optimal block configuration is achieved in later stages. The tasks in this folder are preparation for automatic data typing.

Tips

Block output and parameter minimum and maximum values can be specified in this step.

See Also

Review locked data type settings

Review blocks that currently have their data types locked down and will be excluded from automatic data typing.

Description

When blocks have their data types locked, the Fixed-Point Advisor excludes them from automatic data typing. This task identifies blocks that have locked data types so that you can unlock them.

Results and Recommended Actions

ConditionsRecommended Action

Blocks have locked data types.

Unlock data types on blocks that currently have locked data types.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, use Modify All or unlock data types on blocks for all referenced models.

Action Results

Clicking Modify All unlocks data types on blocks that currently have locked data types.

If your model contains referenced models, unlocks data types on blocks for all referenced models.

Remove output data type inheritance

Identify blocks with an inherited output signal data type.

Description

Inherited data types might lead to data type propagation errors.

For floating-point inheritance blocks with floating-point inputs or outputs, the Fixed-Point Advisor replaces the inheritance with the fixed-point data type specified by the user. For floating-point inheritance blocks with fixed-point output and other Simulink® and DSP System Toolbox™ and Communications System Toolbox™ blocks, the Fixed-Point Advisor now detects inheritance and replaces it with the compiled data type.

 What are Floating-Point Inheritance Blocks?

    Note:   This task is preparation for automatic data typing, not actual automatic data typing.

Input Parameters

Data type for blocks with floating-point inheritance

Enter a default fixed-point data type to use for floating-point inheritance blocks, or select one from the list:

undefined
int8
uint8
int16
uint16
int32
uint32
fixdt(1,16,4)

Results and Recommended Actions

ConditionsRecommended Action

An input parameter is invalid.

Enter or select a valid value for the Data type for blocks with floating-point inheritance input parameter. The value of this parameter applies to the entire model reference hierarchy.

The system or subsystems contain floating-point inheritance blocks that have floating-point inputs.

Set the block output data type to the recommended data type. Remove floating-point inheritance for these blocks by explicitly configuring the Output data type or Output data type mode parameter to the recommended value where possible. The recommended value is based on the value that you specify for the Data type for blocks with floating-point inheritance input parameter.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, remove floating-point inheritance for all blocks in all referenced models.

Blocks or Stateflow® output data in the current system or subsystems have inherited output data types.

Remove output data type inheritance for blocks by explicitly configuring the Output data type or Output data type mode parameter to the recommended value where possible.

Remove output data type inheritance for Logical Operator blocks by clearing the Require all inputs and outputs to have the same data type parameter parameter.

Remove Stateflow output data type inheritance by explicitly configuring the output data Type property.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, remove output data type inheritance in all referenced models.

Action Results

Clicking Modify All explicitly configures the output data types to the recommended values where possible. Tables list the previous and current data types for the reconfigured blocks.

If your model contains referenced models, where possible, explicitly configures the output data types to the recommended values for all referenced models.

Relax input data type settings

Identify blocks with input data type constraints.

Description

Blocks that have input data type constraints might lead to data type propagation errors.

    Note:   This task is preparation for automatic data typing, not actual automatic data typing.

Results and Recommended Actions

ConditionsRecommended Action

The input data types of blocks or Stateflow charts in the current system or subsystems have constraints.

Explicitly configure flexible input data types for blocks by setting the InputSameDT parameter to off where possible.

Explicitly configure Logical Operator blocks to have flexible input data types by setting the AllPortsSameDT parameter to off.

Explicitly configure flexible Stateflow chart input data types by setting the Type method to Inherited.

Action Results

Clicking Modify All explicitly configures the specified settings to the recommended value where possible. A table lists the previous and current settings for the reconfigured blocks.

If your model contains referenced models, where possible, explicitly configures the output data types to the recommended values for all referenced models.

Tip

Removing unnecessary data setting restrictions makes it more likely that the Propose data types task will succeed downstream.

Verify Stateflow charts have strong data typing with Simulink

Verify all Stateflow charts are configured to have strong data typing with Simulink I/O.

Description

Identify mismatches between input or output fixed-point data in Stateflow charts and their counterparts in Simulink models.

    Note:   This task is preparation for automatic data typing, not actual automatic data typing.

Results and Recommended Actions

ConditionsRecommended Action

Stateflow charts do not have strong data typing with Simulink I/O.

Select the Use Strong Data Typing with Simulink I/O check box in the chart properties dialog.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, use Modify All or manually configure this setting in each referenced model.

Action Results

Clicking Modify All configures all Stateflow charts to have strong data typing with Simulink I/O.

If your model contains referenced models, configures this setting for all referenced models.

Remove redundant specification between signal objects and blocks

Identify and remove redundant data type specification originating from blocks and Simulink signal objects.

Description

This task prepares your model for automatic data typing by identifying and removing redundant data type specification originating from blocks and Simulink signal objects.

    Note:   You must rerun this task whenever you delete or manipulate a Simulink signal object in the base workspace.

Input Parameters

Remove redundant specification from

Select from the list:

Blocks
Identify and remove redundant data type specification from blocks.
Signal objects
Identify and remove redundant data type specification from Simulink signal objects.

Results and Recommended Actions

ConditionsRecommended Action

Blocks associated with Simulink signal objects do not have their data type specification set to a passive mode.

Set the data type specification of these blocks to a passive mode, such as Inherit via back propagation.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, use Modify All or manually configure this setting in each referenced model.

Simulink signal objects associated with blocks do not have their data type specification set to a passive mode.

Set the data type specification of these Simulink signal objects to Auto.

The Fixed-Point Advisor provides separate results for each referenced model. For this task to pass, use Modify All or manually configure this setting in each referenced model.

Action Results

Clicking Modify All explicitly configures the properties of the blocks or Simulink signal objects to the recommended value where possible. A table displays the current and previous settings.

If your model contains referenced models, where possible, configures these settings for all referenced models.

Verify hardware selection

Verify target hardware setting.

Description

Review the hardware device settings and verify they are the settings you intend to use.

Input Parameters

Default type of all floating-point signals

Enter a default fixed-point data type to use for all floating-point signals, or select one from the list. For FPGA/ASIC targets, specify the type explicitly.

Remain floating-point
Use this setting if you are converting only part of the model to fixed point and want to leave the rest of the model as floating point.
Same as embedded hardware integer
Use this setting if the hardware device specified is a microprocessor.
int8
int16
int32
fixdt(1,16,4)

Results and Recommended Actions

ConditionsRecommended Action

The model's Model Configuration Parameters > Hardware Implementation device parameters are not specified.

Provide values for Model Configuration Parameters > Hardware Implementation > Device vendor and Device type parameters.

The Fixed-Point Advisor provides results for each referenced model. For this task to pass, manually configure this setting in each referenced model. All referenced models must use the same hardware settings.

Default data type of all floating-point signals is set to Remain floating-point.

For microprocessors, set to Same as embedded hardware integer. For FPGA/ASIC, set the data type explicitly. The Fixed-Point Advisor uses the sign and word length of this data type.

See Also

Specify block minimum and maximum values

Specify block output and parameter minimum and maximum values.

Description

Block output and parameter minimum and maximum values are used for fixed-point data typing in other tasks. Typically, they are determined during the design process based on the system you are creating.

    Note:   This task is preparation for automatic data typing, not actual automatic data typing.

Results and Recommended Actions

ConditionsRecommended Action

Minimum and maximum values are not specified for Inport blocks.

Specify minimum and maximum values for Inport blocks.

Warning if no simulation minimum or maximum for any signals.

If you are using simulation minimum and maximum data, return to "Create simulation reference data" to set up signal logging.

Tips

  • In this task, you can specify minimum and maximum values for any block.

  • You can promote simulation minimum and maximum values to output minimum and maximum values using the Model Advisor Result Explorer, launched by clicking the Explore Result button. In the center pane of the Model Advisor Result Explorer, use the check boxes in the PromoteSimMinMax column to promote values.

  • If you do not specify block minimum and maximum values, the Propose data types task might fail later in the conversion.

See Also

Batch-Fix Warnings or Failures in the Simulink documentation.

Was this topic helpful?