Main Content

Code Prover Analysis in Simulink

Verify code imported into and generated from Simulink® models

Use Polyspace® to identify potential bugs, runtime errors, and coding standard violations in your Simulink model. Use Polyspace in two different steps of the verification and validation process.

Before generating code, detect and address issues that might be introduced by the custom code in your model. The C function block, the C caller block, and the S function block contains custom code. See Run Polyspace Analysis on Custom Code in Simulink Models.

After code generation, analyze the generate code for code specific issues that might not be caught in the model, such as errors due to untested parts of model or incorrect code generation options. See Run Polyspace Analysis on Code Generated with Embedded Coder.

After integrating Polyspace and MATLAB®, you can run a Polyspace analysis directly from the Simulink toolstrip, or to use MATLAB scripts to automate a Polyspace analysis. See Integrate Polyspace with MATLAB and Simulink and Run Polyspace Analysis by Using MATLAB Scripts. Alternatively, generate options files from Simulink models, and use these options files to run a Polyspace analysis on the generated code in the system command line. See Run Polyspace Analysis on Generated Code by Using Packaged Options Files.

Functions

polyspacesetupIntegrate Polyspace installation with Simulink
pslinkrunCrossReleaseAnalyze C/C++ code generated by R2020b or newer Embedded Coder versions by using a different version of Polyspace that is more recent than the Simulink version
pslinkoptionsCreate an options object to customize configuration of a Simulink model, generated code or a S-Function block. Use the object to specify configuration options for these Simulink objects in a Polyspace run from the MATLAB command line
pslinkrunRun Polyspace analysis on model, system, or S-Function
pslinkfunManage model analysis at the command line
polyspacePackNGoGenerate and package options files to run Polyspace analysis on code generated from Simulink model

Classes

polyspace.ModelLinkOptionsCreate a project configuration object for running Polyspace analysis on generated code

Properties

pslinkoptions PropertiesProperties for the pslinkoptions object
polyspace.ModelLinkOptions PropertiesCustomize Polyspace analysis of generated code with options object properties

Topics

Setup

Analyze Generated Code

Analyze Custom Code

Advanced Configuration

How Generated Code is Analyzed