Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

Simulink 中进行 Code Prover 分析

验证导入到 Simulink® 模型中的代码以及从中生成的代码

使用 Polyspace® 标识 Simulink 模型中潜在的 Bug、运行时错误以及编码标准违规。在验证和确认过程的两个不同步骤中使用 Polyspace。

在生成代码之前,请检测并解决模型中的自定义代码可能引入的问题。C function 块、C caller 块和 S function 块中包含自定义代码。请参阅Run Polyspace Analysis on Custom Code in Simulink Models

在生成代码后,分析生成的代码,找出模型中可能没有发现的特定于代码的问题,例如,由于模型的未测试部分或不正确的代码生成选项而导致的错误。请参阅对通过 Embedded Coder 生成的代码运行 Polyspace 分析

在集成 Polyspace 和 MATLAB® 后,您可以直接从 Simulink 工具条运行 Polyspace 分析,也可以使用 MATLAB 脚本自动执行 Polyspace 分析。请参阅Integrate Polyspace with MATLAB and SimulinkRun Polyspace Analysis by Using MATLAB Scripts。另外,还可以从 Simulink 模型生成选项文件,并在系统命令行中使用这些选项文件对生成的代码运行 Polyspace 分析。请参阅Run Polyspace Analysis on Generated Code by Using Packaged Options Files

函数

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

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

属性

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

主题

设置

分析生成的代码

分析自定义代码

高级配置

如何分析生成的代码