Bug Finder-Analyse in Simulink
Verwenden Sie Polyspace® aus dem Simulink-Editor oder dem MATLAB®-Befehlsfenster, um potenzielle Fehler, Laufzeitfehler und Verstöße gegen Codierungsstandards in einem Simulink-Modell zu erkennen. Verwenden Sie Polyspace in zwei unterschiedlichen Schritten des Verifikations- und Validierungsprozesses.
Bevor Sie Code generieren, sollten Sie Mängel erkennen und beheben, die durch den benutzerdefinierten Code in Ihrem Modell entstehen könnten. Analysieren Sie den benutzerdefinierten Code im C function-Block, C caller-Block und S function-Block. Siehe Run Polyspace Analysis on Custom Code in Simulink Models.
Analysieren Sie nach der Codegenerierung den generierten Code auf Code-spezifische Probleme, die im Modell möglicherweise nicht erkannt werden, z. B. Fehler aufgrund nicht getesteter Teile des Modells oder falscher Codegenerierungsoptionen. Siehe Run Polyspace Analysis on Code Generated with Embedded Coder.
Nach der Integration von Polyspace und MATLAB können Sie eine Polyspace-Analyse direkt aus dem Simulink-Editor ausführen oder mit MATLAB-Skripten eine Polyspace-Analyse automatisieren. Siehe Integrate Polyspace with MATLAB and Simulink und Run Polyspace Analysis by Using MATLAB Scripts. Alternativ dazu können Sie auch Optionsdateien aus Simulink-Modellen erstellen und diese Optionsdateien verwenden, um eine Polyspace-Analyse des generierten Codes in der System-Befehlszeile auszuführen. Siehe Run Polyspace Analysis on Generated Code by Using Packaged Options Files.
Funktionen
polyspacesetup | Integrate Polyspace installation with Simulink |
pslinkrunCrossRelease | Analyze 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 (Seit R2021a) |
pslinkoptions | Create an options object to customize Polyspace analysis of generated code or custom code in Simulink model |
pslinkrun | Run Polyspace analysis on model, system, or S-Function |
pslinkfun | Manage model analysis at the command line |
polyspacePackNGo | Generate and package options files to run Polyspace analysis on code generated from Simulink model |
polyspaceArtifact | Generate artifacts to run Polyspace analysis on code generated from Simulink model (Seit R2024a) |
Klassen
polyspace.ModelLinkOptions | Create a project configuration object for running Polyspace analysis on generated code |
Eigenschaften
pslinkoptions Properties | Properties for the pslinkoptions object |
polyspace.ModelLinkOptions Properties | Customize Polyspace analysis of generated code with options object properties |
Modelleinstellungen
Themen
Einrichtung
- Integrate Polyspace with MATLAB and Simulink
Integrate Polyspace with MATLAB and Simulink to identify potential bugs, run-time errors, and coding standard violations in your model and code. - Polyspace Support of MATLAB and Simulink from Different Releases
Check how Polyspace supports your release of MATLAB or Simulink. - Fix Issues When Integrating Polyspace with MATLAB and Simulink
Troubleshoot why Polyspace fails to integrate with MATLAB and Simulink.
Analysieren von generiertem Code
- Run Polyspace Analysis on Code Generated with Embedded Coder
Check code generated with Embedded Coder® for bugs, run-time errors or coding rule violations.
- Benefits of Using Polyspace Static Analysis Tools with Generated Code
Learn how Polyspace can make verifying C/C++ code generated by Embedded Coder and MATLAB Coder easier and more precise. - Address Polyspace Results by Annotating Simulink Blocks
Justify Polyspace results by directly annotating blocks in your Simulink model. - Run Polyspace on Code Generated by Using Previous Releases of Simulink
Analyze C/C++ code generated by using previous releases of Simulink with newer releases of Polyspace. - Run Polyspace Analysis on Code Generated with TargetLink
Check code generated from Simulink models for bugs, run-time errors or coding rule violations. - Run Polyspace Analysis on Generated Code by Using Packaged Options Files
Generate Polyspace options files from a Simulink model, and use these options files to analyze generated code by using Polyspace. - Analyze Code Generated as Standalone Code in a Distributed Workflow (Simulink)
Tutorial showing Polyspace analysis of standalone generated code by using packaged options files in a distributed workflow.
Analysieren von benutzerdefiniertem Code
- Run Polyspace Analysis on Custom Code in Simulink Models
Analyze manually written C/C++ code to detect issues that might introduce run-time errors or bugs in the simulation. - Run Polyspace Analysis on S-Function Code
Tutorial showing Polyspace analysis of S-function code from within Simulink. - Run Polyspace Analysis on Custom Code in C Caller Blocks and Stateflow Charts
Tutorial showing Polyspace analysis of custom code in Simulink model. - Run Polyspace Analysis on Custom Code in C Function Block
Tutorial showing Polyspace analysis of custom code in C Function block in Simulink.
Erweiterte Konfiguration
- Recommended Model Configuration Parameters for Polyspace Analysis
For better Polyspace results, set the recommended parameters before generating code. - Configure Polyspace Options in Simulink
Configure advanced Polyspace analysis options such as code metric calculations or compiler options. - Reduce Polyspace Analysis Time by Ignoring Specific Referenced Models
Ignore specific model in the reference hierarchy to decrease the time required for a Polyspace analysis.
Wie der generierte Code analysiert wird
- How Polyspace Analysis of Generated Code Works
Polyspace extracts function names from generated code to create amain
function for the analysis. - Default Polyspace Configuration for Analyzing Code Generated by Embedded Coder
Learn the options that Polyspace sets by default when analyzing code generated by Embedded Coder.
- Polyspace Bug Finder Defects Checkers Enabled by Default for Generated Code
Look up list of Bug Finder checkers that are enabled by default when analyzing generated code. - Default Polyspace Options for Code Generated with TargetLink
Some Polyspace options such as macro definitions and paths to include folders are set by default.