Products & Services Solutions Academia Support User Community Company

Learn more about PolySpace   

Creating a New Project

What Is a Project?

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

You can create your own project or use an existing project. You create and modify a project using the Launcher graphical user interface.

A project file has one of the following file types:

Project TypeFile ExtensionDescription
ConfigurationcfgRequired for running a verification. Does not include generic target processors.
PolySpace Project ModelppmFor populating a project with analysis options, including generic target processors.
DesktopdskIn earlier versions of PolySpace software, for running a verification on a client computer.

In this tutorial, you create a new project and save it as a configuration file (.cfg).

Preparing the Project Folders

Before you start verifying a C file with PolySpace software, you must know the locations of the C source file and the include files. You must also know where you want to store the verification results.

For each project, you decide where to store source files and results. For example, you can create a project folder, and then in that folder, create separate folders for the source files, include files, and results.

For this tutorial, prepare a project folder as follows:

  1. Create a project folder named polyspace_project.

  2. Open polyspace_project, and create the following folders:

    • sources

    • includes

    • results

  3. Copy the file example.c from

    Install_folder\Examples\Demo_C_Single-File\sources

    to

    polyspace_project\sources

    where Install_folder is the installation folder.

  4. Copy the files include.h and math.h from

    Install_folder\Examples\Demo_C_Single-File\sources

    to

    polyspace_project\includes.

Opening the PolySpace Launcher

You use the PolySpace Launcher, a graphical user interface, to create a project and start a verification.

To open the PolySpace Launcher:

The PolySpace Launcher window appears:

The Launcher window has three main sections.

Use this section...For...
Upper-leftSpecifying:
  • Source files

  • Include folders

  • Results folder

Upper-rightSpecifying analysis options
LowerControlling and monitoring a verification

You can resize or hide any of these sections. You learn more about the Launcher window later in this tutorial.

Changing the Default Folder

PolySpace software allows you to specify the default folder that appears in directory browsers in dialog boxes. If you do not change the default folder, the default folder is the installation folder. In this tutorial, you change the default folder to the project folder that you created in Preparing the Project Folders. Changing the default folder to the project folder makes it easier for you to locate and specify source files and include folders in dialog boxes.

To change the default folder to the project folder:

  1. Select Edit > Preferences.

    The Preferences dialog box appears.

  2. Select the Default folder tab.

  3. Select Always use this specific folder if it is not already selected.

  4. Enter or navigate to the project folder that you created earlier. In this example, the project folder is C:\PolySpace\polyspace_project.

    The Preferences dialog box should now look like the following.

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

Creating a New Project to Verify the Example C File

You must have a project, saved with file type cfg, to run a verification. In this part of the tutorial, you create a new project for verifying example.c.

You create a new project by:

Opening a New project

To open a new project for verifying example.c:

  1. Select File > New Project.

    The Choose the language dialog box appears:

  2. Select C, then click OK.

    The default project name, New_Project, appears in the title bar.

    In the Analysis options section, the General options node expands with default project identification information and options.

Specifying the Source Files, Include Folders, and Results Folder

To specify the source files, include folders, and results folder for the verification of example.c:

  1. Click the green plus sign button in the upper right of the files section of the Launcher window.

    The Please select a file dialog box appears.

  2. The project folder polyspace_project should appear in Look in. If it does not, navigate to that folder.

  3. Select the folder includes and then click the green down arrow button in the Folders to include section.

    The path for the folder appears in the source files list.

  4. Double-click the folder sources.

  5. Select the file example.c and then click the green down arrow button in the Source files section.

    The path for example.c appears in the source files list.

      Tip   You can also drag folder and file names from an open folder directly to the source files list or include list.

  6. Click OK to apply the changes and close the dialog box.

  7. In Results Folder, specify the folder for the verification results. Enter the path for the results folder that you created earlier. In this example, the results folder is C:\PolySpace\polyspace_project\results.

The files section in the upper left of the Launcher window now looks like:

Specifying the Analysis Options

The analysis options in the upper-right section of the Launcher window include identification information and parameters that PolySpace software uses during the verification process. For more information about analysis options, see "Options Description" in the PolySpace Products for C Reference.

To specify the analysis options for this tutorial:

  1. In the General section, change the Session identifier to Example_Project.

      Note   The session identifier cannot contain spaces.

  2. Expand the Target/Compilation section.

  3. Select no-predefined-OS from the drop-down menu next to Operating system target for PolySpace stubs.

  4. Keep the default values for all other options.

    The analysis options will now look like this.

Saving the Project

To save the project:

  1. Select File > Save project. The Save the project as dialog box appears.

  2. In Look in, leave the default folder, polyspace_project.

  3. In Session identifier, enter example.

  4. In Files of type, leave the default *.cfg. You must have a project file with type cfg to run a verification.

      Note   You can also run a verification with a project file of type dsk. Older versions of PolySpace software created files with type dsk for use with a verification running on a desktop PC. For more information about the dsk file type, see What Is a Project?.

  5. Click OK to save the project and close the dialog box.

  


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