Stream User’s Guide



Download 0.95 Mb.
Page22/32
Date20.10.2016
Size0.95 Mb.
#6688
1   ...   18   19   20   21   22   23   24   25   ...   32

9.2Create a project

This section uses demo program spm_demo as an example of how to create a new Stream project with spide. Directory demos/spm_demo/src of the Stream distribution contains the demo program sources.


The spm_demo directory in the Stream distribution also contains a pre-built spide project. If you wish to experiment with spide without repeating the steps below to create a new project, you can use the instructions in the Import existing project section to import the existing spm_demo project instead; then you can build and run the spm_demo project immediately.

9.2.1Create Stream project

First, you need to create a new Stream project. Make sure there are no spaces in your project name, as spaces in pathnames can cause problems for some of the tools spide invokes.


To create a new Stream project called spm_demo in the IDE:


  1. Select File >> New >> Stream Project (Figure 2). [Alternatively, pull down the New icon on the toolbar and select Stream Project.]

Figure 2: Create Stream Project






  1. Enter spm_demo as the Project name.

  2. Expand DSP-MIPS Testbench and select Empty Module (Figure 3).

  3. Hit Finish.

Figure 3: Create Empty DSP MIPS Testbench Module



By default, the new empty module inherits project name spm_demo as its module name. This would be fine for a project with a single module. But this chapter will later add additional modules to the project, so to avoid confusion you should rename this module as testbench:




  1. Select Project >> Properties.

  2. Expand Stream Build and select Artifact.

  3. Click Manage Modules...

  4. Click Rename for module spm_demo.

  5. Enter testbench as the new Name (Figure 4).

  6. Enter a description.

  7. Hit OK to close the Rename module window.

  8. Hit OK again to close the spm_demo: Manage modules window.

Figure 4: Rename Module




  1. In the Properties window Build Artifact tab, change the Artifact name to testbench (Figure 5). When spide builds the project, the result of building this module will be named testbench.

  2. Hit OK.

Figure 5: spm_demo Properties



9.2.2Import source files

The previous steps created a testbench module for project spm_demo, but the module project does not yet contain any source files. Next, you need to import spm_demo source files into the src directory of the project.




  1. Expand spm_demo in the Stream projects view, right-click on src, and click Import.

  2. In the Import pop-up window, expand General and double-click File System.

  3. Specify the directory containing the spm_demo source files: either click Browse... and navigate to the source directory or type the source path in the From directory box. For example, browse to or type in /opt/spi/Stream220/demos/spm_demo/src for an installation in /opt/spi/Stream220.

  4. Click Select all (Figure 6).

  5. Click Finish to import the source files.

Figure 6: Import Files

The IDE copies imported files into its workspace. If you subsequently use the IDE to change a file, the copy in the workspace changes, but the file at the original location remains unchanged.



9.2.3Create testbench module

After the IDE imports the source files, the spm_demo project includes all the source files from the spm_demo directory. The following table shows which spm_demo source files are included in the testbench version and in the System MIPS and DSP MIPS images of the complete application. This table does not show other files in the spm_demo directory, such as header files and bitmap data file data/sample.bmp.




Source file

Description

Testbench

System MIPS

DSP MIPS

file_io.c

bitmap file i/o

x

x




gsr_pipeline.sc

GSR

x




x

components/file_in.c

file input component




x




components/file_out.c

file output component




x




components/gsr.c

GSR component







x

components/main.c

component-based main




x




testbench/spimain.c

testbench spi_main

x






Module testbench builds a DSP MIPS testbench executable from a subset of the spm_demo source files. Some sources are not needed when building the testbench module, but will be used later to build modules for the complete application. This section configures the testbench module to build the DSP MIPS executable: it defines a filter to eliminate source files in the source directory that are not used to build the testbench module. Configure the testbench module as follows:




  1. In the Stream Projects view, right-click on spm_demo and select Properties. [Alternatively, select Project >> Properties.]

  2. Expand Stream Build and select Artifact.

  3. Click the Source Location tab.

  4. Expand /spm_demo/src.

  5. Select Filter (empty) (Figure 7).

Figure 7: Properties for spm_demo

6. Click Edit filter... This opens a Source Folder Exclusion Patterns window.

7. Add all the files in subdirectory components as an exclusion pattern: click Add..., type components/*, and then hit OK (Figure 8). [Alternatively, you could click Add Multiple... and then select specific source files to exclude from the testbench module.]
Figure 8: Source Folder Exclusion Patterns


8. Hit OK to close the Source Folder Exclusion Patterns window.

9. Hit OK again to close the Properties window.


You only need to exclude source files that should not be included in the build. The spm_demo directory contains subdirectory data with bitmap file sample.bmp, but since it is not a C or Stream source file, you do not need to exclude it explicitly.


Download 0.95 Mb.

Share with your friends:
1   ...   18   19   20   21   22   23   24   25   ...   32




The database is protected by copyright ©ininet.org 2024
send message

    Main page