Floating Point Tolerance

Floating point tolerance check based on

When you map your design to the native floating-point libraries or the floating-point target libraries, specify the floating-point tolerance check option.

Settings

Default: relative error

Select one of these options from the dropdown menu:

  • relative error: This is the default option. When you verify the generated code by using HDL Testbench, HDL Coder™ checks for the floating-point tolerance of the native floating-point library or the floating-point target library that your design mapped to based on the relative error.

  • ulp error: When you verify the generated code by using HDL Testbench, HDL Coder checks for the floating-point tolerance of the native floating-point library or the floating-point target library that your design mapped to based on the ULP error.

Dependency

This option is disabled if you select the entire model. Select the DUT instead for Generate HDL for setting.

Command-Line Information

Property: FPToleranceStrategy
Type: character vector
Value: 'relative' | 'ULP'
Default: 'relative'

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

See Also

FPToleranceStrategy

Tolerance Value

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

Settings

Default: 1e-07

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.

Command-Line Information

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

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

See Also

FPToleranceValue