Skip to Main Content Skip to Search
Product Documentation

Prepare Model for Conversion

Prepare Model for Conversion Overview

This folder contains tasks for configuring and setting up the model for data logging.

Description

Validate model-wide settings and create simulation reference data for downstream tasks.

See Also

Verify model simulation settings

Validate that model simulation settings allow signal logging and disable data type override to facilitate conversion to fixed point. Logged signals are used for analysis and comparison in later tasks.

Description

Ensures that fixed-point data can be logged in downstream tasks.

Results and Recommended Actions

ConditionsRecommended Action
The following Fixed-Point Tool setting is not set to the correct value:
  • Data type override

Set Data type override to Use local settings

The model Configuration Parameters Data Import/Export > Signal logging check box is off.Set to on
The fiprefDataTypeOverride property is not set to Off.Set DataTypeOverride to Off

Action Results

Clicking Modify All configures the model for recommended simulation settings and fipref objects. A table displays the current and previous block settings.

See Also

Verify update diagram status

Verify update diagram succeeds.

Description

A model update diagram action is necessary for most down stream tasks.

Results and Recommended Actions

ConditionsRecommended Action
The model diagram does not update.Fix the model. Make sure needed mat files are loaded.

See Also

Updating a Block Diagram in the Simulink documentation

Address unsupported blocks

Identify blocks that do not support fixed-point data types.

Description

Blocks that do not support fixed-point data types cannot be converted.

Results and Recommended Actions

ConditionsRecommended Action
Blocks that do not support fixed-point data types and cannot be converted exist in model.
  • Replace the block with the block specified in the Result pane by right-clicking the block and selecting the replacement from the context menu.

      Note   The Fixed-Point Advisor provides a preview of the replacement block. To view the replacement and verify its settings, click the Preview link. If the settings on the replacement block differ from the settings on the original block, set up the replacement block to match the original block.

  • Isolate the block by right-clicking the block and selecting Insert Data Type Conversion > All Ports.

Tips

See Also

The Simulink Block Data Type Support table summarizes characteristics of blocks in the Simulink and Simulink Fixed Point block libraries, including whether or not they support fixed-point data types.

Set up signal logging

Specify at least one signal of interest to log during simulation. Logged signals are used for analysis and comparison in other tasks. Suggested signals to log are model inports and outports.

Description

The Fixed-Point Advisor uses logged signals to compare the initial data type to the fixed-point data type.

Analysis Result and Recommended Actions

ConditionsRecommended Action
No signals are logged.If you are using simulation minimum and maximum values, specify at least one signal to be logged. Otherwise, ignore this warning.

Tips

Log inports and outports of the system under conversion.

Create simulation reference data

Simulate the model using the current solver settings, and create reference data to use for comparison and analysis. If necessary, you can stop the simulation by selecting the waitbar and then pressing Ctrl+C. To set Fixed-point instrumentation mode to Minimums, maximums and overflows, click the Modify All button.

Description

Simulate the model using the current solver settings, create and archive reference signal data to use for comparison and analysis in downstream tasks.

Input Parameters

Merge instrumentation results from multiple simulations

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

Results and Recommended Actions

ConditionsRecommended Action
Simulation does not run.Fix errors so simulation will run.
Fixed-point instrumentation mode is not set to Minimums, maximums and overflowsIf you are using simulation minimum and maximum values, set Fixed-point instrumentation mode to Minimums, maximums and overflows. Otherwise, ignore this warning.

Action Results

Clicking Modify All sets Fixed-point instrumentation mode to Minimums, maximums and overflows. A table displays the current and previous block settings.

Tips

Verify Fixed-Point Conversion Guidelines Overview

Verify modeling guidelines related to fixed-point conversion goals.

Description

Validate model-wide settings.

See Also

Check model configuration data validity diagnostic parameters settings

Verify that model Configuration Parameters > Diagnostic > Data Validity parameters are not set to error.

Description

If the Configuration Parameters > Diagnostic > Data Validity parameters are set to error, the model update diagram action fails in downstream tasks.

Results and Recommended Actions

ConditionsRecommended Action
Detect downcast is set to error.Set all Configuration Parameters > Diagnostics > Data Validity > Parameters options to warning.
Detect overflow is set to error.
Detect underflow is set to error.
Detect precision loss is set to error.
Detect loss of tunability is set to error.

Action Results

Clicking Modify All sets all Configuration Parameters > Diagnostics > Data Validity > Parameters options to warning. A table displays the current and previous settings.

Implement logic signals as Boolean data

Confirm that Simulink simulations are configured to treat logic signals as Boolean data.

Description

Configuring logic signals as Boolean data optimizes the code generated in downstream tasks.

Results and Recommended Actions

ConditionsRecommended Action
Implement logic signals as Boolean data is set to off.Set Configuration Parameters > Optimization > Implement logic signals as Boolean data to on.

Action Results

Clicking Modify All selects the model Configuration Parameters > Optimization > Implement logic signals as Boolean data check box. A table displays the current and previous parameter settings.

Check for proper bus usage

Identify any Mux block used as a bus creator and any bus signal treated as a vector.

Description

This task identifies:

Results and Recommended Actions

ConditionsRecommended Action
The Fixed-Point Advisor is not operating on a top-level model If this task is important to your conversion, start the Fixed-Point Advisor on the top-level model.
The model is not configured to detect future changes that might result in improper bus usage.Set Configuration Parameters > Diagnostics > Connectivity > Buses > Bus signal treated as vector to error.

Simulation range checking

Verify that model Configuration Parameters > Diagnostics > Simulation range checking is not set to none.

Description

If Configuration Parameters > Diagnostics > Simulation range checking is set to none, the simulation does not generate any range checking warnings.

Results and Recommended Actions

ConditionsRecommended Action
Configuration Parameters > Diagnostics > Simulation range checking is set to none.Set Configuration Parameters > Diagnostics > Simulation range checking to warning.

Action Results

Clicking Modify All sets Configuration Parameters > Diagnostics > Simulation range checking to warning.

Check for implicit signal resolution

Check if model uses implicit signal resolution.

Description

Models with implicit signal resolution attempt to resolve all named signals and states to Simulink signal objects, which is inefficient and slows incremental code generation and model reference. This task identifies those signals and states for which you may turn off implicit signal resolution and enforce resolution.

Results and Recommended Actions

ConditionsRecommended Action
Model uses implicit signal resolution.
  • Set the model Configuration Parameters > Diagnostics > Data Validity > Signal resolution to Explicit only.

  • Enforce resolution for each of the signals and states in the model by selecting Signal name must resolve to Simulink signal object.

Action Results

Clicking Modify All sets the model Configuration Parameters > Diagnostics > Data Validity > Signal resolution to Explicit only and enforces resolution for each of the signals and states in the model. Tables display the current and previous settings.

See Also

Resolving Signal Objects for Output Data in the Simulink documentation

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS