Main Content

Changes in Polyspace Analysis Workflows in Simulink in R2019b

In R2019b, a toolstrip with contextual buttons replaces the menus and toolbars in the Simulink® Editor. The Simulink toolstrip includes contextual tabs, which appear only when you need them.

Code generation and verification tasks appear in separate tabs on the Simulink toolstrip.

  • To generate code, open the C Code tab. To access this tab, on the Apps tab, select Embedded Coder.

  • To analyze the generated code, open the Polyspace tab. To access this tab, on the Apps tab, select Polyspace Code Verifier.

A snapshot of the Polyspace tab on the Simulink toolstrip.

Code Verification Workflow in a Nutshell

After code generation, on the Polyspace tab, use these steps to perform code verification:

  1. Select product to run:

    For instance, select Bug Finder.

  2. Specify code analysis options:

    Optionally, configure code analysis options. To configure the basic options related to the model, select Settings > Polyspace Settings. To configure advanced options related to the generated code, select Settings > Project Settings.

  3. Specify which code to analyze:

    Select whether to analyze the code generated for standalone use (typically, in the modelname_ert_rtw folder), the code generated for referencing in another context (typically, in the slprj folder), or the custom code called from C Caller blocks or Stateflow® charts.

  4. Run analysis:

    To start an analysis, select Run Analysis. The analysis runs on the model element selected, provided code has been generated earlier from the same element. The selected element appears in the Analyze Code from field. To select the entire model, click anywhere on the canvas outside a model element.

Locate Pre-R2019b Menu Items in Simulink Toolstrip

All menu items available earlier in the submenu Code > Polyspace now appear on the Polyspace tab.

TaskBefore R2019b in Code > Polyspace menuR2019b on Polyspace tab
Specify a Bug Finder analysis.Select Options. Specify Bug Finder for the configuration parameter Product mode.In the Mode group, select Bug Finder.

Run analysis on code generated from the model as standalone code.

Typically, the analysis runs on the generated code in the modelname_ert_rtw folder.

Select Verify Code Generated for > Model.Click anywhere on the canvas outside a model element. In the toolstrip, the Analyze Code from field displays the model name. Below the field, select Code Generated as Top Model. Then, select Run Analysis.

Run analysis on code generated from the model for reference in other models

Typically, the analysis runs on the generated code in the slprj folder.

Select Verify Code Generated for > Referenced Model.Click anywhere on the canvas outside a model element. In the toolstrip, the Analyze Code from field displays the model name. Below the field, select Code Generated as Model Reference. Then, select Run Analysis.
Configure basic analysis options related to the model.Select Options. Select Settings > Polyspace Settings.
Configure advanced analysis options related to the generated code.Select Options. Click the Configure button next to the configuration parameter Project Configuration.Select Settings > Project Settings.
Detach Polyspace® options from model configuration for sharing with others who do not have Polyspace.Select Remove Options from Current Configuration.Select Settings > Remove Polyspace Configuration from Model.
Open results from the last Polyspace analysis on the model.Select Open Results > For Generated Code or Open Results > For Generated Model Referenced Code.Make sure that the Analyze Code from field states the model name (otherwise select anywhere on the canvas outside a model element). Below this field, select one of Code Generated as Top Model or Code Generated as Model Reference. Then, select Analysis Results.
Open remote job monitor (if you are offloading the analysis to a server).

Select Open Job Monitor.

For remote analysis, you must first set up communication with a server by using Polyspace preferences. See Install Products for Submitting Polyspace Analysis from Desktops to Remote Server.

In the Review Results group, select Remote Job Monitor.

For remote analysis, you must first set up communication with a server by using Polyspace preferences. See Install Products for Submitting Polyspace Analysis from Desktops to Remote Server.

Open Polyspace Metrics or Polyspace Access™ web interface if you are using one of them to host Polyspace results.

Note

Polyspace Metrics is removed in R2021b and later releases.

Select Open Metrics.

For opening a web interface, you must first specify the hostname and port number used for the web server in Polyspace preferences.

In the Review Results group, select Code Quality Metrics (Polyspace Metrics) or Access ( Polyspace Access).

For opening a web interface, you must first specify the hostname and port number used for the web server in Polyspace preferences.

Related Topics