In a previous blog I wrote about the Fastline plugin developed for Arm Fast Models, and how it can be used with the Streamline performance analyzer. With the recent release of DS-5 5.28, we have enhanced this experience, including all necessary files within the DS-5 installation, and built-in setup wizards to make it easier to set up and configure. In this blog I will take you through the basic steps necessary. I will use the Fixed Virtual Platforms (FVPs) supplied with DS-5, but this applies equally for any Fast Model based system.
I created a DS-5 Eclipse workspace, and imported the fireworks_A9x1-FVP_AC6 DS-5 example (though of course any code could be used). The Streamline GUI does not necessarily make use of this workspace, but we will return to this later. Launch Streamline, and you will now find the Fastline wizard under the Streamline menu
The first time you launch this, you will be asked to point to your FastModels installation. If you only have DS-5 available, it is sufficient to point this to the \\sw\models\bin directory of your DS-5 installation. For most users, it is sufficient to set this just once, and check the remember box. If you do need to update this again, you can do this from the Window - Preferences - Fastline Preferences pane.
You will then be asked for the model you wish to use, based on the location specified in the previous step. In this example I will use the Cortex-A9 single core FVP. You can use the filter text box at the top to zoom in on the required model.
You will next be asked what type of code you will run on the target. Essentially this is a choice between Linux or not. This is a necessary step because of the way Streamline will parse the data later on. You can also label a CPU as unused if you do not want to include it in your Streamline report.
Point to the image that you will load...
Then select the counter(s) that you wish to use. Unlike real hardware, there is no limit to the number of counters that you can track, but note that this will affect the execution performance of the model. Using many counters will also greatly increase the size of the report generated.
You then specify the location of where you wish the Streamline data to be stored, as well as some additional parameters (such as sampling frequency) if desired.
We are almost ready to go. I recommend selecting to generate a launch script, so that we do not need to go through the above steps each time. It is also useful to see the full command line used. Note that the script encodes the name of the final report (with the -C TRACE.st.apc-capture option), so be aware to rename the report therein if you want to preserve older reports.
Specify the location to save this script and other files.
Open a command prompt, and navigate to the specified location. You will find launch-fastline.bat (or the equivalent script on Linux hosts). This will launch the model to all the options specified above. Execute the script, and simply kill the model when done. Now lets look at the data we collected.
In the Streamline GUI, you can either use File - Import - Import Capture to pull the data in, or you can use the Window - Preferences - Data Locations to point to where the report is stored. The latter makes sense if you will generate multiple reports.
Double-click on the report and you can analyze in the usual manner. You can use Streamline to quickly and easily see what parts of your code you are spending the bulk of your time in, to know where to spend your optimization efforts.
Finally, you may want to control execution of the model within your DS-5 Debugger environment. Go to the DS-5 GUI Debug Control view, and open the Debug Configurations pane. You likely already have a working debug configuration for your existing code, so I recommend you create a duplicate of this working configuration. You can revisit the launch script generated previously, and see the complete command line used to launch the model before. Extract the options used to the model executable, and add them to the Model parameters specified.
This includes loading the image, so you may need to adjust the Files view to only load the debug symbols of the model to the debugger.
Note that the Streamline report is only finalized once you disconnect from the model in the debugger, which has the same effect as killing the model when running stand alone. Attempting to analyze the report in Streamline before disconnecting results in a corrupted report, and you will need to repeat.
Regardless of the way you generate the report(s), you will find this a useful way to easily visualize performance of your code. For example, below I ran the same code compiled at various optimization levels to see the differences.
I hope this blog encourages you to try out this powerful feature within DS-5. Please comment on your experiences or any questions you may have below.
For more information on DS-5 please click on the button below:
DS-5 Development Studio