Stream User’s Guide



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

9.4Profile mode

Functional mode and fast functional mode simulate a program functionally on the host. Debug mode, profile mode and release mode instead build programs that run under the Stream simulator or on stream processor hardware. For the testbench module, the generated program runs on DSP MIPS, either in simulation or on hardware. This section describes how to build a program in profile mode and then run it in simulation or on hardware. Debug mode is similar but is not described here. You can set breakpoints and control debug mode program execution in the IDE, just as described for functional mode above.



9.4.1Build

Select the Stream perspective; you may need to drag the separator to the left of the Debug perspective icon near the upper right to expose the Stream perspective button. To build spm_demo testbench in profile mode, pull down the arrow next to the mode on the toolbar and select profile, then pull down the arrow next to the build icon and select spm_demo. The resulting DSP MIPS executable runs either under the simulator or on stream processor hardware.



9.4.2Run under simulator

To run the testbench module under the simulator, pull down the arrow next to the run icon and select testbench. The IDE simulates program execution on DSP MIPS. Since spm_demo reads and writes a large file, execution under the simulator is rather slow; be patient. The console view shows the banner from the simulator and then the output of the simulated program (Figure 16). Wait for the “Program terminated” message from the monitor before you examine the generated profile.

Figure 16: Simulation


You can set simulator flags in the Target tab of the run configuration.

9.4.3View profile data

Profile mode allows the developer to monitor and improve program performance through the use of stream command traces. Simulation or hardware execution of a program built in profile mode produces a stream trace. After simulation or hardware execution of the program:




  1. Expand build under spm_demo in the Stream Projects view.

  2. Expand sp16_profile and expand profile.

  3. Double-click on testbench (the profile file named testbench in the profile subdirectory, not the identically named testbench subdirectory in the sp16_profile directory). The IDE displays program execution information in its testbench (Analysis) view and in its testbench (Visual) view.

  4. You can use the scroll bar and the zoom buttons in the Tools menu to view the image (Figure 17).

Figure 17: Stream Trace View



The testbench (Analysis) view displays performance information in tabular form, as generated by spperf. The testbench (Visual) view displays performance information visually. The vertical axis represents time, with a time scale ruler on the left edge of the window. The horizontal axis represents resources. In Figure 17, the mouse hovers over a call to kernel gsr_compute_average; the IDE displays the properties of the kernel call in the Properties view. The Optimization chapter below gives much more detail about how to use the performance data that spide displays to improve program performance.


9.4.4Run on hardware

You need to define a new run configuration to run the testbench program on a stream processor device. The run configuration specifies the target hardware and program arguments.



  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. [Alternatively, click on Stream Application, then click on the New icon on the toolbar.]

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

  4. Hit Browse... and select spm_demo as the Project.

  5. Pull down testbench as the Primary module (Figure 18). Do not hit Run yet, as you still must enter the target and argument information for the run configuration.

Figure 18: Hardware Run Configuration



  1. Click on the Target tab.

  2. Click on the Device radio button to indicate execution on a stream processor hardware device.

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

  4. Enter input filename spm_demo/src/data/sample.bmp and hit Add. Target input and output filenames are workspace-relative, not project-relative, as the directory structure on the device mirrors the directory structure in the spide workspace.

  5. Enter output filename spm_demo/src/data/result.bmp and hit Add (Figure 19).


Figure 19: Target Run Configuration



  1. Click on the Arguments tab.

  2. Enter the program arguments: src/data/sample.bmp src/data/result.bmp. The program arguments are project-relative, not workspace-relative, so they do not include the spm_demo project component of the input file and output file pathnames specified in the device run configuration above. If you want to change the default SPM log mask settings, you can add one or more --spi_log_mask=mask,value options as additional arguments.

  3. Hit Run (Figure 20).

Figure 20: Execution on Device


The Console view shows the work done by the IDE. It creates the specified working directory on the device, downloads the input file and the executable to the working directory, runs the program with the specified arguments, and uploads the output file to the desired location. The directory structure on the device mirrors the directory structure in the spide workspace.



Download 0.95 Mb.

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




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

    Main page