Main Content

Tolerance Value

Enter the tolerance value based on the floating-point tolerance check setting that you specify

Model Configuration Pane: Test Bench

Description

Enter the tolerance value based on the floating-point tolerance check setting that you specify.

Settings

1e-07 (default) | 0

The value must be a positive integer or a double data type.

The default tolerance value depends on the floating-point tolerance check setting that you specify. When you set the Floating point tolerance check based on to:

  • relative error, the default is a Tolerance Value of 1e-07. When you use this floating-point tolerance check setting, specify the tolerance value as a double data type. You can specify a Tolerance Value, N, that is less than or equal to 1e-07.

  • ulp error, the default is a Tolerance Value of 0. When you use this floating-point tolerance check setting, specify the tolerance value as an integer. You can specify a Tolerance Value, N, that is greater than or equal to 0.

Tips

To set this property, use hdlset_param or makehdltb. To view the property value, use hdlget_param.

For example, to specify the floating-point tolerance value for a model, use the hdlset_param function to specify the tolerance strategy, and then enter the tolerance value. For example, to check the floating-point tolerance based on ULP error and enter the tolerance value:

% Check for floating-point tolerance based on ULP
hdlset_param('sfir_single', 'FPToleranceStrategy', 'ULP');   

% When using ULP, optionally enter tolerance value >= 0       
hdlset_param('FP_test_16a', 'FPToleranceValue', 1);

% Generate HDL testbench with specified tolerance setting
makehdltb('sfir_single/symmetric_fir')

Recommended Settings

No recommendations.

Programmatic Use

Property: FPToleranceValue
Type: double | integer
Default: 1e-07

Version History

Introduced in R2017a