Working with the Fixed-Point Tool

Fixed-Point Tool Workflow

In general, you perform the following steps when using the Fixed-Point Tool to scale fixed-point data types in a model:

StepDescriptionSee...
1

Collect range data, i.e., minimum and maximum values that model objects either specify explicitly or generate during simulation, and propose fixed-point scaling.

Proposing Scaling
2

Use the Autoscale Information dialog to review the scaling proposals.

Reviewing Scaling Proposals
3

Apply the scaling proposals selectively to model objects.

Applying Scaling

Proposing Scaling

The Fixed-Point Tool generates scaling proposals for model objects that specify fixed-point data types. However, you can control whether a model object is subject to proposals by locking its scaling. If an object's Lock output scaling against changes by the autoscaling tool parameter is selected, the tool refrains from proposing scaling for that object.

When generating scaling proposals, the tool collects the following types of range data for model objects:

The Fixed-Point Tool uses available range data to calculate scaling proposals according to the following rules:

Click the Propose Fraction Lengths button to generate scaling proposals for objects in your model. However, if you plan to scale fixed-point data types using simulation minimum and maximum values, you must first simulate the system to log its simulation range. See Tutorial: Feedback Controller for an example that demonstrates how to scale fixed-point data types using only simulation range data.

Reviewing Scaling Proposals

The Fixed-Point Tool lists its scaling proposals in the Contents pane under the ProposedDT column. 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.

The proposed scaling will introduce data type errors if applied to this object.

You can review each scaling proposal using the Autoscale Information dialog, which displays the rationale underlying the proposed scaling. Also, this dialog describes potential issues or errors, and it suggests methods for resolving them. To open the dialog:

  1. In the Contents pane, select an object that has proposed scaling.

  2. Click the Autoscale Information button .

    The dialog appears as shown here.

The sections that follow describe the information that the dialog displays.

Proposed Data Type Summary

This section describes a scaling proposal in terms of how it differs from the object's current data type. For cases when the Fixed-Point Tool does not propose scaling, this section provides an explanation.

Needs Attention

This section lists potential issues and errors associated with scaling proposals. It displays the following icons to differentiate warnings from errors.

Indicates a warning message.

Indicates an error message.

Not only does this section describe such issues, but also it suggests methods for resolving them.

Shared Data Type Summary

This section notifies you when data type requirements associated with other model objects impact the data type of the selected object. In this case, the dialog provides a hyperlink that you can click to highlight those items in the model. To eliminate such highlighting, from the model's View menu, select Remove Highlighting.

Data Type Details

This section provides a table that lists a model object's attributes that influence its scaling proposal.

ItemDescription

Currently Specified Data Type

Data type that an object currently specifies.

Proposed Data Type

Data type that the Fixed-Point Tool proposes for this object.

Proposed Representable Maximum

Maximum value that results from the proposed data type.

Design Maximum

Design maximum value that an object specifies using, e.g., its Output maximum parameter.

Simulation Maximum

Maximum value that occurs during simulation.

Simulation Minimum

Minimum value that occurs during simulation.

Design Minimum

Design minimum value that an object specifies using, e.g., its Output minimum parameter.

Proposed Representable Minimum

Minimum value that results from the proposed data type.

The table also includes a column titled Percent Proposed Representable. This column indicates the percentage of the proposed representable range that each value covers. Overflows occur when values lie outside this range.

Shared Values.   When proposing scaling, the Fixed-Point Tool attempts to satisfy data type requirements that model objects impose on one another. For example, the Sum block provides an option that requires all of its inputs to have the same data type. Consequently, the table might also list attributes of other model objects that impact the scaling proposal for the selected object. In such cases, the table displays the following types of shared values:

Applying Scaling

The Fixed-Point Tool allows you to apply its scaling proposals selectively to objects in your model. Use the Accept check box in the Contents pane to specify the scaling proposals that you want to assign to model objects. The check box indicates the status of a proposal as follows:

The Fixed-Point Tool will apply the proposed scaling to this object. By default, the tool selects the Accept check box when a scaling proposal differs from the object's current scaling.

The Fixed-Point Tool will ignore the proposed scaling and leave the current scaling intact for this object.

No scaling proposal exists for this object. This occurs, for example, when the object specifies a data type inheritance rule or has its scaling locked.

To apply scaling proposals to objects in your model:

  1. In the Contents pane, select the Accept check box associated with scaling proposals that you want to apply to model objects.

  2. Click the Apply Accepted Fraction Lengths button .

    The Fixed-Point Tool replaces the fixed-point scaling of model objects with scaling proposals whose Accept check box is selected.

  


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