Stream User’s Guide



Download 0.95 Mb.
Page25/32
Date20.10.2016
Size0.95 Mb.
#6688
1   ...   21   22   23   24   25   26   27   28   ...   32

9.5Release mode

Release mode creates a release version of a program, without the overhead of debugging or profiling code. To build and run a program in release mode, pull down the arrow next to the mode button on the IDE toolbar and select release, then follow the instructions in the preceding sections.




9.6Complete application

The preceding sections described how to build, run, and debug a testbench module. This section describes how to build the complete component-based spm_demo application and run it on stream processor hardware. The complete component-based application consists of a System MIPS image and a DSP MIPS image.



9.6.1Create System MIPS module

This section describes how to configure a module to build the System MIPS image of the application. The next section describes how to configure a module to build the DSP MIPS image of the application. Together, these two images comprise the complete spm_demo application. The final section of this chapter shows how to create a run configuration to run the complete application on stream processor hardware.




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

  2. Click on Stream Build.

  3. Click Manage Modules...

  4. Hit New to create a new module.

  5. Enter app_sys as the module name.

  6. Enter a description (Figure 21).

Figure 21: Create System MIPS Module



  1. Hit OK to close the Create New Module window.

  2. Hit OK again to close the spm_demo: Manage Modules window and return to the spm_demo Properties window.




  1. Select app_sys from the Module drop-down menu.

  2. Expand Stream Build and select Artifact.

  3. Click the Build artifact tab.

  4. Set the Artifact Type to SYS-MIPS Executable.

  5. Click the Source Location tab.

  6. Click /spm_demo/src.

  7. Hit Edit filter. The app_sys module inherited the filter from the testbench module, so now you need to edit the filter for the System MIPS application.

  8. Remove the existing pattern from the source file exclusion filter: click on components/* and hit Remove.

  9. Click on Add multiple to select source files to exclude.

  10. Expand the components and testbench directories, then hold down and click to exclude files components/gsr.c, testbench/spi_main.c, and gsr_pipeline.sc (Figure 22). These files are not part of the System MIPS executable.

  11. Hit OK to close the Exclusion Pattern Selection window.

  12. Hit OK again to close the Source Folder Exclusion Patterns window.

  13. Hit OK again to finish adding the module and close the Properties window.

Figure 22: System MIPS Exclusion Pattern




To build the module, select release mode on the toolbar and hit the build icon. When the build completes, you can expand spm_demo/build/sp16_release/bin in the Stream Projects view to see the app_sys executable. You still need to build the DSP MIPS executable as described in the next section before you can run the System MIPS executable.

9.6.2Create DSP MIPS Module

Repeat the procedure of the preceding section to create a DSP MIPS module for the spm_demo application. Use the module name app_dsp and module type DSP-MIPS executable. The DSP MIPS executable uses only sources component/gsr.c and gsr_pipeline.sc, so the filter should exclude all other sources (Figure 23).


Figure 23: DSP MIPS Exclusion Pattern

Select release mode on the toolbar and hit the build icon. When the build completes, you can expand spm_demo/build/sp16_release/bin in the Stream Projects view to see the app_dsp executable. The next section describes how to run the complete application on stream processor hardware.



9.6.3Run application

Finally, you need to define a run configuration to run the complete component-based spm_demo application on stream processor hardware.



  1. Click the arrow next to the Run button on the toolbar and select Run Configurations...

  2. In the Run Configurations window, right-click on Stream Application and select New.

  3. Enter app_hw as the Name of the run configuration.

  4. Pull down app_sys as the Primary module.

  5. Pull down the Module list to spm_demo::app_dsp and hit Add to add the DSP MIPS module. The run configuration will run app_sys, but it also requires module app_dsp, so you must specify app_dsp as an additional module.

  6. Hit Apply (Figure 24).

Figure 24: Application Run Configuration





  1. Click on the Target tab.

  2. Select the Device radio button.

  3. Enter the user name, IP address, and working directory.

  4. Enter workspace-relative input filename spm_demo/src/data/sample.bmp and hit Add.

  5. Enter workspace-relative output filename spm_demo/src/data/result.bmp and hit Add.

  6. Hit Apply.

  7. Select the Arguments tab and enter program arguments. The app_dsp module builds a DSP MIPS image named app_dsp. By default, the System MIPS program tries to load a DSP MIPS image named spm_demo.dsp.out to DSP MIPS, so in addition to the project-relative input and output file arguments, its argument list must include a -i option giving the name of the image:

-i app_dsp src/data/sample.bmp src/data/result.bmp

  1. Hit Run. The result of running the program appears in the Console view (Figure 25).

Figure 25: Run Application







Download 0.95 Mb.

Share with your friends:
1   ...   21   22   23   24   25   26   27   28   ...   32




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

    Main page