The Fixed-Point Tool is a user interface that automates the task of specifying fixed-point data types in a Simulink® model. The tool collects range data for model objects. The range data comes from:
Design minimum and maximum values that objects specify explicitly on the block
Logged minimum and maximum values that occur during simulation
Minimum and maximum values derived using range analysis
Based on these values, the tool proposes fixed-point data types that maximize precision and cover the range. You can then review the data type proposals and apply them selectively to objects in your model. This process is also known as autoscaling. Using the Fixed-Point Tool you can:
Derive range information based on specified design ranges. See How Range Analysis Works.
Propose and apply data types based on simulation data.
Propose and apply data types based on derived ranges.
Propose and apply data types based on simulation data from multiple runs. See Propose Data Types For Merged Simulation Ranges.
Propose and apply data types based on simulation data and derived ranges.
Debug fixed-point models.
Before you begin conversion, you need to set up the model in Simulink. For more detail, see Set Up the Model.
The iterative fixed-point conversion workflow for automatic data typing consists of four main stages.
Select the system to convert to fixed point. The Fixed-Point Tool will propose data types for the objects in the specified system.
Select whether to collect ranges through simulation, derived range analysis, or
simulation with range analysis. You can specify multiple simulation scenarios using a
Simulink.SimulationInput object. Specify
signal tolerances to use to verify the behavior of the converted system.
Automatically prepare the system under design for conversion by clicking the Prepare button in the Fixed-Point Tool toolstrip. The Fixed-Point Tool analyzes your model and makes configuration recommendations for autoscaling.
Run the simulation or the derivation. When the simulation or derivation is complete, you can examine the ranges of objects in your model using the histograms in the Visualization of Simulation Data pane.
The Fixed-Point Tool proposes data types based on the ranges collected in stage two. You can edit the default word length and other proposal settings in the Settings menu. To generate proposals, click Propose Data Types. If you are satisfied with the proposals, click Apply Data Types.
Simulate your model using the newly applied fixed-point data types to examine the behavior of the fixed-point model. You can compare the floating point and fixed-point behavior using the Simulation Data Inspector.
After verification, if you determine that the behavior of the system is not acceptable, you can iterate through the conversion and verification steps until you settle on a design that satisfies your system requirements.