Comprehensive Overview of Polyspace R2021a Polyspace R2021a is a major release from MathWorks that enhances static code analysis workflows for safety-critical C and C++ embedded software. This release focuses on increasing analysis speed, improving precision for specific automotive standards, and introducing new tools to manage code complexity. Key Features and Improvements in R2021a
The R2021a update introduced several critical capabilities across the Polyspace Bug Finder and Polyspace Code Prover product lines:
Mixed C/C++ Analysis: You can now run Polyspace Code Prover on projects containing a mix of C and C++ source files without needing to separate them into different verification runs.
AUTOSAR Support: The release offers faster and more precise analysis for C/C++ code utilizing the AUTOSAR RTE API. By using the new -library autosar option, Polyspace employs "smart stubs" for library functions, improving performance without sacrificing verification rigor.
Guidelines Checkers: A new category of customizable checkers in Polyspace Bug Finder allows you to monitor quantifiable code complexity metrics, such as cyclomatic complexity and path counts, helping detect overly complex modules early in development.
Polyspace Query Language (PQL): This release supports PQL, a powerful tool for creating user-defined defect checkers and custom coding standards tailored to specific project requirements.
Enhanced Integration: R2021a supports modern compilers like Visual Studio 2019 and GCC 8.x, and simplifies the process of starting analysis on code generated from Simulink without needing to manually generate the code first. Core Benefits for Embedded Software
Polyspace distinguishes itself through the use of formal methods to achieve high software quality standards:
What’s New in Polyspace R2021a? - MATLAB & Simulink - MathWorks polyspace r2021a
Polyspace R2021a is a major update to the MathWorks static code analysis suite, designed to help developers prove the absence of critical run-time errors and uncover defects early in C and C++ projects. This release focuses on performance optimizations for large-scale embedded systems, particularly those using the AUTOSAR standard, and introduces new tools to manage code complexity. Key Advancements in Polyspace R2021a
The R2021a update delivers refinements across the entire Polyspace product line, from local IDE plugins to centralized web-based reporting.
Enhanced AUTOSAR Support: Polyspace Code Proverâ„¢ now runs faster and provides more precise results for code using the AUTOSAR RTE API. A new -library option allows for "smart stubs" that target AUTOSAR-specific checks without the overhead of checking the entire library implementation.
Mixed C/C++ Projects: Developers can now run a single Polyspace Code Prover analysis on projects containing a mix of C and C++ source files, simplifying the verification of modern multi-language codebases.
New Guidelines Checkers: A new category of customizable checkers in Polyspace Bug Finderâ„¢ helps teams monitor software complexity. These checkers track metrics like cyclomatic complexity and the number of paths to identify "heavy" modules that require refactoring before they become maintenance burdens.
Cross-Release Workflow: With R2021a, users can analyze code generated in earlier releases of Simulink® (R2020b or later) using the new pslinkrunCrossRelease function, allowing teams to upgrade their analysis tools without needing to migrate their entire model-based design environment immediately. Collaborative Analysis with Polyspace Access
For team-based development, Polyspace Accessâ„¢ introduces several UI and workflow improvements in R2021a to streamline result triage.
Custom Filters: Users can define and share custom filter groups, allowing organizations to focus on the specific findings most relevant to their internal safety or security standards. DO-178C: Use Polyspace to generate static analysis evidence
Results Comparison: The web interface now includes a filter to view findings from a baseline run that have been fixed in the current run, providing clear evidence of progress during remediation.
Optimized Code Review Layouts: A new default Code Review layout prioritizes the source code view, making it easier for developers to investigate the root cause of issues directly in the browser. Expanded Language and Compiler Support
To support modern development environments, R2021a expands its compatibility with industry tools:
Compilers: Added support for Visual Studio 2019 and GCC 8.x.
Standards Compliance: Expanded coverage for AUTOSAR C++14, CERT C++, and MISRA C++ rules.
PQL (Polyspace Query Language): Users can now create their own custom defect checkers and coding standards using PQL, which supports a new .pql file format and a dedicated command-line tool. The "Shift Left" Philosophy Polyspace Notes - MATLAB & Simulink - MathWorks
The Polyspace R2021a release from MathWorks introduced significant advancements in handling complex C/C++ projects, particularly for safety-critical and automotive industries. This version focused on speed, mixed-language support, and expanded compliance for international safety standards. Key Features & Major Updates
Mixed C/C++ Analysis: Polyspace Code Prover now supports projects containing both C and C++ source files simultaneously. By using the -lang C-CPP option, the tool compiles and verifies them as a unified C++ project, eliminating the need to separate files. combine with other artifacts (test results
AUTOSAR Enhancements: Analysis of code using the AUTOSAR RTE API is faster and more precise. New "smart stubs" for AUTOSAR libraries allow users to check for standard compliance without losing precision or needing complex manual setups.
New "Guidelines" Checkers: Polyspace Bug Finder introduced a new category for software complexity. These customizable checkers measure metrics like cyclomatic complexity and the number of execution paths, helping developers identify and refactor overly complex modules early.
Expanded Coding Standards: Support was added for additional rules within AUTOSAR C++14, CERT C++, and MISRA C++.
Cross-Release Workflows: Users can now use Polyspace R2021a to analyze code generated in previous versions of Simulink (starting from R2020b) using the pslinkrunCrossRelease function. Usability and Integration
Compiler Support: Added official support for Visual Studio 2019 and GCC 8.x compilers.
Simplified Setup: The integration process between Polyspace and MATLAB/Simulink was streamlined to require fewer steps.
Polyspace Access Improvements: Features enhanced logging for services within the Admin UI, aiding team collaboration and project tracking. Core Tool Comparison Polyspace R2021a continues to rely on two primary engines: What's New in Polyspace R2021a? - MATLAB & Simulink
R2021a added support for MISRA C 2012 Amendment 2 (covering the latest rules for ISO C11/C18) and expanded AUTOSAR C++14 guidelines to 320+ rules. The Polyspace Metrics dashboard now includes rule coverage heatmaps, showing exactly which MISRA/AUTOSAR rules are violated, justified, or not yet reviewed.
Polyspace is not just for hand-written C/C++. In R2021a, the integration with Simulink and Embedded Coder matured significantly.
polyspace-bug-find with polyspace-bug-finder (note the hyphenation change).polyspace-configure -compiler.The update adds support for MISRA C:2012 Amendment 3, which addresses security vulnerabilities. This is crucial for the automotive sector (AUTOSAR) where security is becoming as paramount as safety. Polyspace now automatically checks for these specific security-focused directives, helping teams comply with the latest industry best practices.