Skip to Main Content Skip to Search
Product Documentation

Creating a Project

What Is a Project?

In Polyspace software, a project is a named set of parameters for verification of your software project's source files. A project includes:

You create and modify a project using the Project Manager perspective.

What Is a Project Template?

A Project Template (Compilation Environment Template), is a predefined set of analysis options configured for a specific compilation environment.

When you create a new project, you can select a project template to automatically set analysis options for your compiler, and help locate required include folders.

Polyspace software provides predefined templates for common compilers such as Cosmic, IAR, Kiel, and VxWorks.

You can also create custom templates from existing project configurations. For more information, see Creating Custom Project Templates.

Project Folders

Before you begin verifying your code with Polyspace software, you must know the location of your source files and include files. You must also know where you want to store the verification results.

To simplify the location of your files, you may want to create a project folder, and then in that folder, create separate folders for the source files, include files, and results. For example:

polyspace_project/

Opening Polyspace Verification Environment

You use the Polyspace verification environment to create projects, start verifications, and review verification results.

To open the Polyspace verification environment:

  1. Double-click the Polyspace icon (Windows® systems).

    On a Linux® or UNIX® system, use the following command:

    $POLYSPACE/PVE/bin/polyspace

The Polyspace verification environment opens.

By default, the Polyspace Verification Environment displays the Project Manager perspective. The Project Manager perspective has three main panes.

Use this section...For...
Project Browser (upper-left)Specifying:
  • Source files

  • Include folders

  • Results folder

Configuration (upper-right)Specifying verification options
Output
(lower-right)
Monitoring the progress of a verification, and viewing status, log messages, and general verification statistics.

You can resize or hide any of these panes.

Creating New Projects

The Polyspace verification environment can manage multiple projects simultaneously. When you create a new project or open an existing project, the project is added to the Project Browser tree.

To create a new project:

  1. Select File > New Project.

    The Project – Properties dialog box opens:

  2. In the Project name field, enter a name for your project.

  3. If you want to specify a location for your project, clear the Default location check box, and enter a Location for your project.

      Note   You can update the default project location. Select Options > Preferences, which opens the Polyspace Preferences dialog box. On the Project and result folder tab, in the Define default project location field, specify the new default location.

  4. In the Project language section, select either C or C++.

  5. Click Next.

    The Project – Browse for a Project Template dialog box opens.

  6. Select the Template for your compiler (for more information, see What Is a Project Template?).

    If your compiler does not appear in the list of predefined templates, select Baseline C or Baseline C++ to start with a generic template.

      Note   If you do not want to use a template, click Back, then clear the Use template check box.

  7. Click Next.

    The Polyspace Project – Add Source Files and Include Folders dialog box opens.

  8. The project folder Location you specified in step 3 should appear in Look in. If it does not, navigate to that folder.

  9. Select the source files you want to include in the project, then click Add Source.

    The source files appear in the Source tree for your project.

  10. Select the Include folders you want to include in the project, then click Add Include.

    The Include folders appear in the Include tree for your project.

  11. Click Finish.

    The new project opens in the Polyspace verification environment, with default options based on the project template you selected.

Opening Existing Projects

The Polyspace verification environment can manage multiple projects simultaneously. When you create a new project or open an existing project, the project is added to the Project Browser tree.

To open an existing project:

  1. Select File > Open Project.

    The Open Polyspace Project dialog box opens.

  2. Navigate to the project folder, for example, Demo_C.

  3. Select the project configuration file, for example, Demo_C.cfg. Then click Open.

    The selected project opens in the Project Manager perspective.

Closing Existing Projects

The Polyspace verification environment can manage multiple projects simultaneously. When you create a new project or open an existing project, the project is added to the Project Browser tree. To remove a project from the Project Browser tree, you must close the project.

To close a project:

  1. In the Project Browser, select the project you want to close.

  2. Right-click the project, then select Close Active Project.

    The project is closed and removed from the Project Browser tree.

Specifying Source Files

To specify the source files for your project:

  1. In the Project Browser, select the Source folder.

  2. Click the Add source icon in the upper left the Project Browser.

    The Project – Add Source Files and Include Folders dialog box opens.

  3. In the Look in field, navigate to the folder containing your source files.

  4. Select the source files you want to include in the project, then click Add Source.

    The source files appear in the Source tree for your project.

  5. Click Finish to apply the changes and close the dialog box.

    The source files you selected appear in the Project Browser.

Specifying Include Folders

Polyspace software automatically adds the standard include folders to your project.

If your project uses additional include files, you can specify additional folders to include with your verification.

To specify the include folders for the project:

  1. In the Project Browser, select the Include folder.

  2. Click the Add source icon in the upper left the Project Browser.

    The Project – Add Source Files and Include Folders dialog box opens.

  3. In the Look in field, navigate to the folder containing your Include files.

  4. Select the Include folders you want to include in the project, then click Add Include.

    The Include folders appear in the Include tree for your project.

  5. Click Finish to apply the changes and close the dialog box.

    The Include folders you selected appear in the Project Browser.

Managing Include File Sequence

You can change the order of the include folders in your project to manage the sequence in which include files are compiled during verification.

To re-order the sequence of include folders for the project:

  1. In the Project Browser, expand the Include folder.

  2. Select the include folder you want to move.

  3. Click the Move up or Move down icons in the Project Browser toolbar to move the include.

    The Include folders are reordered in the Project Browser.

Creating Multiple Modules

Each Polyspace project can contain multiple modules. Each of these modules can verify a specific set of source files using a specific set of analysis options.

By default, each module you create uses the same analysis options, allowing you to verify different subsets of source files using the same options. However, you can also create multiple configurations in each module, allowing you to change analysis options each time you run a verification.

To create a new module in your project:

  1. In the Project Browser, select any project.

  2. Click the Create a new module icon in the upper left the Project Browser.

    A second module, Module_(2), appears in the Project Browser tree.

  3. In the Project Browser Source tree, right-click the files you want to add to the module, and select Copy Source File to > Module_(2).

    The source files appear in the Source tree of Module_(2).

Creating Multiple Analysis Option Configurations

Each Polyspace project can contain multiple configurations. Each of these configurations specifies a specific set of analysis options for a verification. Using multiple configurations allows you to verify a set of source files multiple times using different analysis options for each verification.

To create a new configuration in your project:

  1. In the Project Browser, select any module.

  2. Right-click the Configuration folder in the module, and select Create New Configuration. The new configuration appears in the Project Browser.

  3. In the Configuration pane, specify the appropriate analysis options for the configuration.

  4. Select File > Save to save your project with the new settings.

For detailed information about specific analysis options, see Option Descriptions for C Codein the Polyspace Products or C Reference.

Specifying Functions Not Called by Generated Main

You can specify source files in your project that the main generator will ignore. Functions defined in these source files are not called by the automatically generated main.

Use this option for files containing function bodies, so that the verification looks for the function body only when the function is called by a primary source file and no body is found.

To specify a source file as not called by the main generator:

  1. In the Project Browser Source tree, select the source files you want the main generator to ignore.

  2. Right click any selected file, and select Define As > Not Called by Main Generator.

    The files ignored by the main generator appear is italics in the Source tree of the project.

Changing Project Location

Polyspace software saves verification results in Module_(#) subfolders within the project folder. To change the location of your results, you must change the project location.

To change the location of an existing project:

  1. In the Project Browser, right-click on the project name and select Project Properties.

    The Polyspace Project – Properties dialog box opens:

  2. Clear the Default location check box.

  3. Enter the new Location for your project.

  4. Click Finish.

Specifying Target Environment

Many applications are designed to run on specific target CPUs and operating systems. Since some run-time errors are dependent on the target, you must specify the type of CPU and operating system used in the target environment before running a verification. 

The Compiler Settings tab in the Configuration pane of the Project Manager perspective allows you to specify the target operating system and processor type for your application.

To specify the target environment for your application:

  1. From the Target operating system drop-down list, select the operating system on which your application is designed to run.

  2. From the Target processor type drop-down list, select the processor on which your application is designed to run.

For more information about emulating your target environment, see Setting Up a Target.

Specifying Analysis Options

The Configuration pane in the Project Manager perspective allows you to set Analysis options that Polyspace software uses during the verification process. For more information about analysis options, see "Options Description" in the Polyspace Products for C/C++ Reference

To specify analysis options for your project:

  1. In the Configuration pane, select the All Settings tab. Under Analysis options, you see different categories of options, for example, General, Target/Compilation, and Compliance with standards

  2. Specify the appropriate analysis options for your project.

  3. Select File > Save to save your project with the new settings.

For detailed information about specific analysis options, see Option Descriptions for C Code in the Polyspace Products for C Reference.

Creating Custom Project Templates

Once you have configured a project, you can save the Configuration as a custom Project Template, and use it to configure future projects. Using custom templates allows you to automatically set up the compilation environment, include folders, and other analysis options for your projects.

You can include any Analysis option in the template, but the following options should typically be included:

To create a custom project template:

  1. Open the project you want to use a template.

  2. Right-click the configuration you want to use, and select Export As Template.

  3. Enter a description for the template, then click Proceed.

  4. Save your Compilation Environment Template file with the name you want to appear in the Templates browser.

  5. Create a new project.

  6. In the Project – Browse for a Project Template dialog box, select Add custom template.

  7. Select the template that you exported, then click Open.

  8. The new template appears in the Custom templates folder of the Templates browser, and can be used for future projects.

Configuring Text and XML Editors

Before you run a verification, you should configure your text and XML editors through the Polyspace Preferences dialog box. Configuring text and XML editors allows you to view source files and MISRA reports directly from the Polyspace verification environment.

To configure your text and .XML editors:

  1. Select Options > Preferences.

    The Polyspace Preferences dialog box opens.

  2. Select the Editors tab.

    The Editors tab opens.

  3. Specify an XML editor to use to view MISRA-C reports. For example:

    C:\Program Files\MSOffice\Office12\EXCEL.EXE
  4. Specify a text editor to use to view source files from the Project Manager logs. For example:

    C:\Program Files\Windows NT\Accessories\wordpad.exe
  5. To automatically specify the command line arguments for your editor, from the Arguments drop-down list, select your text editor.

    • Emacs

    • Notepad++

    • UltraEdit

    • VisualStudio

    • Wordpad

    If you are using another text editor, select Custom from the drop-down menu, and specify the command line arguments for the text editor.

  6. Click OK.

Saving the Project

To save the project, select File > Save.

Polyspace software saves your project using the Project name and Location you specified when creating the project.

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS