Hauptinhalt

Die Übersetzung dieser Seite ist veraltet. Klicken Sie hier, um die neueste Version auf Englisch zu sehen.

Bug Finder-Analyse in Simulink

Prüfen von in Simulink®-Modelle importiertem und aus diesen #generiertem C/C++ Code auf Defekte

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

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 (Seit R2021a)
pslinkoptionsCreate an options object to customize Polyspace analysis of generated code or custom code in Simulink model
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
polyspaceArtifactGenerate artifacts to run Polyspace analysis on code generated from Simulink model (Seit R2024a)

Klassen

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

Eigenschaften

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

Modelleinstellungen

alle erweitern

Settings from(C)Settings to use for the Polyspace analysis of C code
Settings from(C++)Settings to use for the Polyspace analysis
ProjectconfigurationSet advanced configuration options to customize analysis
InputOption to choose whether to constrain Inport block variables
TunableparametersOption to specify the assumed value of tunable parameter values during the analysis
OutputOption to verify whether output variables are within expected bounds
Model referenceverification depthDepth of model reference hierarchy for Polyspace analysis
Model by modelverificationOption to analyze each model or referenced model individually
Ignore modelreferencesOption to ignore specified model references (Seit R2023b)
Model referenceinput/output range verificationOption to verify that input and output of model references are within specified values (Seit R2024a)
OutputfolderPath and folder name for your analysis results
Make outputfolder name unique by adding a suffixOption to add a unique suffix to the results folder for every Polyspace run
Open resultsautomatically after verificationOption to open analysis results in Polyspace user interface after analysis completes
Add results tocurrent Simulink projectOption to add your Polyspace results to current Simulink project
ProductmodeChoice between Polyspace Bug Finder and Polyspace Code Prover (Seit R2021b)
Use customproject fileOption to use custom configuration from a Polyspace project (.psprj) file
Enable additionalfile listOption to add additional supporting code files to analysis
Stub lookuptablesOption to stub autogenerated functions that use lookup tables with linear interpolation
Verify allS-function occurrencesOption to analyze all instances of selected S-Function block
Checkconfiguration before verificationOption to check model and code configurations for errors before code analysis

Themen

Einrichtung

Analysieren von generiertem Code

Analysieren von benutzerdefiniertem Code

Erweiterte Konfiguration

Wie der generierte Code analysiert wird