1.2.1. Project and repository files

Fast Models simplifies projects by using a single project file (.sgproj) to drive the complete design process of system creation, build configuration, and building the model:

Repository files have the same format as project files and group references to commonly-used files shared across different projects.

You can add single files or a complete repository, such as the Fast Model Portfolio, to the project file. For more information on project file contents, see Project Settings dialog.

Figure 1.2 shows the organization of directories and files for a typical project on Windows:

Figure 1.2. Project organization

For Figure 1.2, the Build subdirectory of the My_System directory contains the My_System.sgproj project file:

  1. My_System.sgproj points to the standard Fast Model Portfolio repository file sglib.sgrepo.

  2. The sglib.sgrepo file contains a list of repository locations such as components.sgrepo. Repository files eliminate the requirement to individually specify the path and library for each component. The repository can be hierarchical, as this one is, or can list individual component details.

  3. components.sgrepo lists the locations of the LISA files for the components and the location and type of libraries that are available for the components.

  4. The project file lists My_System.lisa as the top-level LISA file for the system. The top-level LISA file lists the components that are used in the system and how the components are interconnected.

  5. This project uses a custom component in addition to the standard Fast Model Portfolio components. Custom components can be located anywhere in the directory structure. For Figure 1.2, the custom component is only used with the My_System component, so the My_custom_component.lisa file is in the same directory.

    The My_System.sgcanvas and My_custom_component.sgcanvas files are generated when a component is edited in the System Canvas Workspace window. These files describe the display settings for a component such as:

    • component location and size

    • label text, position and formatting

    • text font and size

    • whether ports have been moved or hidden

    • grid spacing.

  6. My_System.sgproj lists Win32-Debug-VC2008 as the build directory for the selected platform. The build options in the project file determine:

    • the libraries that are used

    • the location

    • the format of the generated system.

      For example, the extension for the model is .so for Linux or .dll for Windows.

File processing order

Sub-repositories are expanded as soon as they are encountered. The File List view in the right pane corresponds to the processing order.


Repository and LISA files are always processed in the order they occur in the project file (*.sgproj) and sub-repository files (*.sgrepo). Version 3.0 of System Generator processed the files in alphabetic order.

This change in behavior might cause old project files to be processed incorrectly.

Example 1.1 and Example 1.2 show an example project and a repository file:

Example 1.1. Source project file

/// project file
sgproject "MyProject.sgproj"
	path = "./MyTopComponent.lisa";
	path = "./MySubComponent1.lisa";
	path = "./repository.sgrepo";
	path = "./MySubComponent2.lisa";

Example 1.2. Files in repository

/// subrepository file
sgproject "repository.sgrepo"
	path = "../LISA/ASubComponent1.lisa";
	path = "../LISA/ASubComponent2.lisa";

The files listed in Example 1.1 and Example 1.2 are processed in the following order:

  1. ./MyTopComponent.lisa

  2. ./MySubComponent1.lisa

  3. ./repository.sgrepo

    1. ../LISA/ASubComponent1.lisa

    2. ../LISA/ASubComponent2.lisa

  4. ./MySubComponent2.lisa

This processing order enables a custom implementation of a component to be used in place of standard component implementations. If MySubComponent1.lisa and ../LISA/ASubComponent1.lisa both list a component with the same name, only the first definition is used.

The order of occurrence of files is significant. Use the System Canvas controls to specify the order of files and repositories:

  • Use Up and Down context menu entries in the File List view of the Component window to change the file order within a repository. The commands have keyboard shortcuts of Alt + Arrow Up and Alt + Arrow Down.

    You can also drag-and-drop files inside a repository or between repositories.

  • Use the Up and Down buttons on the Default Model Repository tab in the Properties dialog to specify the order of repositories in new projects.

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0370H