Main Content

pslinkoptions Properties

Properties for the pslinkoptions object

You can create a pslinkoptions object to customize your analysis in the MATLAB® Command Window. Use these properties to specify configuration options, where and how to store results, additional files to include, and data range modes.

Configuration Options

expand all

Coding rule and configuration settings for C code specified as:

  • 'PrjConfig' – Inherit options from the project configuration.

  • 'PrjConfigAndMisraAGC' – Inherit options from the project configuration and enable MISRA™ AC AGC rule checking.

  • 'PrjConfigAndMisra' – Inherit options from the project configuration and enable MISRA C™:2004 rule checking.

  • 'PrjConfigAndMisraC2012' – Inherit options from the project configuration and enable MISRA C:2012 guideline checking.

  • 'MisraAGC' – Enable MISRA AC AGC rule checking. This option runs only compilation and rule checking.

  • 'Misra' – Enable MISRA C:2004 rule checking. This option runs only compilation and rule checking.

  • 'MisraC2012' – Enable MISRA C:2012 rule checking. This option runs only compilation and guideline checking.

Example: opt.VerificationSettings = 'PrjConfigAndMisraC2012'

Polyspace® mode specified as 'BugFinder', for a Bug Finder analysis, or 'CodeProver', for a Code Prover verification.

Example: opt.VerificationMode = 'BugFinder';

Allows a custom configuration file instead of the default configuration specified as true or false. Use the PrjConfigFile option to specify the configuration file.

Example: opt.EnablePrjConfigFile = true;

Custom configuration file to use instead of the default configuration specified by the full path to a .psprj file. Use the EnablePrjConfigFile option to use this configuration file during your analysis.

Example: opt.PrjConfigFile = 'C:\Polyspace\config.psprj';

This property sets the level of configuration checking done before the analysis starts. The configuration check before analysis is specified as:

  • 'Off' — Checks only for errors. Stops if errors are found.

  • 'OnWarn' — Stops for errors. Displays a message for warnings.

  • 'OnHalt' — Stops for errors and warnings.

Example: opt.CheckConfigBeforeAnalysis = 'OnHalt';

Results

expand all

Results folder name and location specified as the local folder name or the folder path. This folder is where Polyspace writes the analysis results. This folder name can be either an absolute path or a path relative to the current folder. The text $ModelName$ is replaced with the name of the original model.

Example: opt.ResultDir = '\results_v1_$ModelName$';

Add unique number to the results folder name specified as true or false. If true, a unique number is added to the end of every new result. Using this option helps you avoid overwriting the previous results folders.

Example: opt.AddSuffixToResultDir = true;

Open the Polyspace environment to monitor the progress of the analysis, specified as true or false. Afterward, you can review the results.

Example: opt.OpenProjectManager = true;

Add your results to the currently open Simulink project, if any, specified as true or false. This option allows you to keep your Polyspace results organized with the rest of your project files. If a Simulink project is not open, the results are not added to a Simulink project.

Example: opt.AddToSimulinkProject = true;

Additional Files

expand all

Allow an additional file list to be analyzed, specified as true or false. Use with the AdditionalFileList option.

Example: opt.EnableAdditionalFileList = true;

List of additional files to be analyzed specified as a cell array of files. Use with the EnableAdditionalFileList option to add these files to the analysis.

Example: opt.AdditionalFileList = {'sources\file1.c', 'sources\file2.c'};

Data Types: cell

Data Ranges

expand all

Enable design range information specified as 'DesignMinMax', to use data ranges defined in blocks and workspaces, or 'FullRange', to treat inputs as full-range values.

Example: opt.InputRangeMode = 'FullRange';

Enable constant parameter values, specified as 'None', to use constant parameters values specified in the code, or 'DesignMinMax' to use a range defined in blocks and workspaces. If your model uses ImportedExtern look-up tables, setting ParamRangeMode to 'DesignMinMax' includes the ranges of the tables in the data range specification of the model.

Example: opt.ParamRangeMode = 'DesignMinMax';

Enable output assertions specified by 'None', to not apply assertions, or 'DesignMinMax' to apply assertions to outputs using a range defined in blocks and workspace.

Example: opt.ParamRangeMode = 'DesignMinMax';

Embedded Coder Only

expand all

Allow Polyspace analysis to ignore specified model references.

For Embedded Coder® only

Example: opt.EnableModelRefIgnoreList = 1;

List of model references to be ignored, specified as a cell array of model names. Each model name is a string. Use with the EnableModelRefIgnoreList option to ignore the listed models in a Polyspace analysis.

For Embedded Coder only

Example: opt.ModelRefIgnoreList = {'modelRef1', 'modelRef2'};

Specify the depth for analyzing the models that are referenced by the current model.

  • 'Current Model Only': Analyze only the top model without analyzing the referenced models. For instance, you might use this option when the referenced models are library models.

  • '1', '2', or '3': Analyze referenced models up to the specified depth in the reference hierarchy. For instance, to analyze the models that are referenced by the top model, specify the property ModelRefVerifDepth as '1'. To analyze models that are referenced by the first level of references, specify this property as '2'. If referenced models up to the specified depth is specified in the option ModelRefIgnoreList, Polyspace ignores the models.

  • 'All': Analyze all referenced models with the current model, except the ignored referenced models specified in the option ModelRefIgnoreList.

For Embedded Coder only

Example: opt.ModelRefVerifDepth = '3';

Specify how Polyspace checks if the inputs and outputs of the model reference step functions in the generated code are within the specified range. The range is determined by the values you specify for Minimum and Maximum in the Signal Attribute tab in the Block Parameters dialog box of the inport and outport blocks.

  • 'CheckAndConstrain' — Polyspace verifies whether the inputs and outputs of model reference step functions are within the range specified by the Minimum and Maximum signal attributes of the inports and outports. If an input or output value is outside of the specified range, Polyspace discards the out-of-range value in subsequent analysis.

  • 'Check' — Polyspace verifies whether the inputs and outputs of model reference step functions are within the range specified by the Minimum and Maximum signal attributes of the inports and outports. If an input or output value is outside of the specified range, Polyspace does not discard the out-of-range value in subsequent analysis.

  • 'None' — Polyspace does not verify the inputs and outputs of model reference step functions.

For Embedded Coder only

If you perform a model-by-model verification, Polyspace checks the input of model references and in the subsequent analysis assumes that the output is within the specified range.

Example: opt = pslinkoptions(modelname); opt.ModelRefMinMaxVerif = 'Check';

Specify whether you want to analyze all referenced models together, or analyze the models individually.

  • false: Analyze the top model and the referenced models together. For instance, you might want to use this option to check for integration or scaling issues.

  • true: Analyze the top model and the referenced models individually.

For Embedded Coder only

Example: opt.ModelRefByModelRefVerif = true;

Coding rule and configuration settings for C++ code specified as:

  • 'PrjConfig' – Inherit options from project configuration and run complete analysis.

  • 'PrjConfigAndMisraCxx' – Inherit options from project configuration, enable MISRA C++ rule checking, and run complete analysis.

  • 'PrjConfigAndJSF' – Inherit options from project configuration, enable JSF® rule checking, and run complete analysis.

  • 'MisraCxx' – Enable MISRA C++ rule checking, and run compilation phase only.

  • 'JSF' – Enable JSF rule checking, and run compilation phase only.

Only for Embedded Coder

Example: opt.CxxVerificationSettings = 'MisraCxx';

TargetLink Only

expand all

Lookup Table code usage, specified as true or false.

  • true — use Lookup Table code during the analysis.

  • false — stub Lookup Table code.

Only for TargetLink®

Example: opts.AutoStubLUT = true;