Main Content

Stub lookup tables

Option to stub autogenerated functions that use lookup tables with linear interpolation

Model Configuration Pane: Polyspace

Description

The Stub lookup tables parameter stubs lookup table functions in the generated code that use linear interpolation and do not allow extrapolation.

By default, Polyspace® treats a lookup table function like any other function and assumes that the output of the function is within the full range allowed by the result data type. For functions using lookup tables with linear interpolation and no extrapolation, the result is within the bounds of the table. If you use this option, the verification narrows down the assumption regarding the output of these interpolating lookup tables, resulting in a more precise analysis that has fewer orange checks.

The option is relevant only if your model uses Lookup Table blocks.

You can find this parameter in the Polyspace pane of the Configuration Parameters dialog box, in the Advanced parameters section.

Settings

on (default) | off
On

For autogenerated functions that use lookup tables with linear interpolation and no extrapolation, the verification:

  • Does not check for run-time errors in the function body.

  • Calls a function stub instead of the actual function at the function call sites. The stub ensures that the result of using the lookup table is within the bounds of the table.

To identify if the lookup table in the function uses linear interpolation and no extrapolation, the verification uses information provided by the code generation product. For instance, if you use Embedded Coder® to generate code, the lookup table functions with linear interpolation and no extrapolation follow specific naming conventions.

Off

The verification does not stub autogenerated functions that use lookup tables.

Tips

  • The Stub lookup tables parameter applies only to autogenerated functions. If you integrate your own C/C++ S-Functions using lookup tables with the model, enabling this parameter does not cause them to be stubbed.

  • The Stub lookup tables parameter is on by default. For certification purposes, if you want your verification tool to be independent of the code generation tool, set the parameter to off.

Recommended Settings

ApplicationSetting
DebuggingNo Impact
TraceabilityNo Impact
EfficiencyNo Impact
Safety precautionNo Impact

Programmatic Use

Parameter: AutoStubLUT for use with pslinkoptions
Parameter: PSAutoStubLUT for use with set_param()
Values: 'false' | 'true'
Default: 'false'
Example : opt = pslinkoptions(modelname); opt.AutoStubLUT = true;

Version History

Introduced in R2016b