Export Global Variable List
You can export the list of global variables in your code to a tab delimited text file or a MATLAB® table. The text file or the table contains the same information as the Variable Access pane in the Polyspace® user interface.
Using the text file, you can:
Generate graphs or statistics about global variables. For instance, you can see the percentage of shared global variables that are not protected against concurrent access.
Use the range information to create external constraints for global variables. For instance, you can report that your code is free of certain run-time errors only for the extracted range of global variables.
You can also use the range to specify external constraints on subsequent verifications or verification of other modules. See Specify External Constraints for Polyspace Analysis.
Export Variable List to Text File
You can export results from the user interface or command line.
User Interface | Command Line |
---|---|
| Use appropriate options
with the The available options are:
|
Export Variable List to MATLAB Table
Instead of a text file, you can read your Polyspace analysis results into a MATLAB table. See variableAccess
.
View Exported Variable List
The text file or the table contains the result information available on the Variable Access pane in the user interface.
For instance, suppose the Variable Access pane shows a
variable SHR
with this information.
If you export this information to the tab-delimited text file and open the file in Excel®, you see the same information. Some of the information is shown below.
Variables | Data Type | Access | Values | #Reads | #Writes | Written by task | Read by task | Protection | Line | Col | File | Function | Extension |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SHR | int32 | Aggregate | 0 or 22 | 1 | 2 | server1 server2 | tregulate | Critical section | 30 | 11 | tasks1.c | c | |
SHR | Write | 0 | 30 | 11 | tasks1.c | _init_globals() | c | ||||||
SHR | Write | 22 | 81 | 8 | tasks1.c | Tserver() | c | ||||||
SHR | Read | 0 or 22 | 53 | 14 | tasks1.c | initregulate() | c |
See also Variable Access in Polyspace Desktop User Interface.
Some differences in presentation between the Variable Access pane and the text file (or MATLAB table) are listed below.
The Access column in the text file indicates whether the row shows information about the variable (Aggregate) or information about operations on the variable (Write or Read).
The Function column in the text file shows the functions where the variable is read or written ( and on the Variable Access pane).
There are no rows corresponding to read and write operations from tasks ( and on the Variable Access pane). This information is available in the Written by task and Read by task columns in the text file (
Tasks_Write
andTasks_Read
columns in the MATLAB table).The colors on the Variable Access pane are represented through the columns Unreachable and Protected:
If a shared variable is accessed in multiple tasks without a common protection, it is colored orange on the Variable Access pane. In the text file, the Protected column shows Unprotected.
If a shared variable is accessed in multiple tasks but with a common protection, it is colored green on the Variable Access pane. In the text file, the Protected column shows Protected.
If a shared variable is not accessed at all, it is colored gray on the Variable Access pane. In the text file, the Unreachable column shows Is unreachable.
The Potential column in the text file shows read or write operations via pointers ( or on the Variable Access pane). For operations via pointers, the column shows Potential access.