Main Content

Iterative Fixed-Point Conversion Using the Fixed-Point Tool

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 in theIterative Fixed-Point Conversionworkflow 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 asautoscaling. Using the iterative fixed-point conversion workflow in the Fixed-Point Tool you can:

  • 基于指定设计范围的源极限信息。看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. SeePropose Data Types For Merged Simulation Ranges.

  • Propose and apply data types based on simulation data and derived ranges.

  • Debug fixed-point models.

Workflow for Automatic Data Typing

Autoscaling workflow for converting a floating-point model to fixed point using the iterative fixed-point conversion workflow in the Fixed-Point Tool.

The iterative fixed-point conversion workflow for automatic data typing consists of four main stages.

  1. 准备System for Conversion

    Before you begin conversion, set up the model in Simulink. Then select the system to convert to fixed point. The Fixed-Point Tool will propose data types for the objects in the specified system.

    选择是否通过模拟,派生范围分析或使用范围分析进行仿真来收集范围。您可以使用a指定多个模拟方案Simulink.SimulationInputobject. Specify signal tolerances to use to verify the behavior of the converted system.

    Automatically prepare the system under design for conversion by clicking the准备固定点工具工具臂中的按钮。固定点工具分析您的模型,并为AutoScaling进行配置建议。

  2. Collect Ranges

    运行仿真或派生。当simulation or derivation is complete, you can examine the ranges of objects in your model using the histograms in theVisualization of Simulation Datapane.

  3. Convert Data Types

    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 theSettingsmenu. To generate proposals, clickPropose Data Types. If you are satisfied with the proposals, clickApply Data Types.

  4. Verify New Settings

    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.

  5. Explore Additional Data Types

    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.

相关话题