SOMNIUM DRT is a C/C++ IDE for ARM Cortex-M based devices such as the Atmel (a wholly owned subsidiary of Microchip Inc) SMART family, the STM32 family from ST Microelectronics, and the Kinetis and LPC families from NXP.
DRT is fully compatible with industry-standard tools such as the GNU toolchain and Eclipse IDE. Unlike the "vanilla" tools used in other free of charge and commercial products, SOMNIUM's patented techniques generate smaller, faster, more energy efficient code. DRT also includes some advanced debugging tools, including live memory viewing, fault analysis and trace.
The latest releases of DRT include an extra tool called the Object File Analyser. This can be used to compare two object files and display details of differences in code and data sizes. This is currently provided as a stand-alone tool, rather with the DRT IDE, to allow more flexibility in usage.
The DRT Object File Analyser displays the symbols present in the files and compares their sizes. You could get some of this information using command line tools such as objdump. The value of the Object File Analyser is that it automates the process of matching up the data from two object files. It also allows the data to be interactively sorted, filtered and searched in various ways. This is another example of DRT improving productivity by extracting high-level information and presenting it to the developer in an easy to use form.
You could use the Object File Analyser to compare two files compiled with the DRT toolchain with different optimization options, for example. Or you could use it to compare the DRT tools with an alternative toolchain. The displayed data can be easily sorted and filtered to highlight the code size reductions made by DRT.
When you run the Object File Analyser it displays the Summary page. You can use the Browse buttons to select files to analyse and compare. When a file is opened summary data for that file will be displayed, as shown below:
You can switch to the Symbol Table page to see a list of all the symbols in the file. This shows the name, section and size of each symbol. If you open two files, then the symbols from the two files are listed side by side, with a final column ("Delta") showing the difference in size between them:
You can sort the list of symbols by clicking any of the column headers. (Clicking again will reverse the sort order.) Clicking on the Delta column is a quick way of seeing the symbols that make the largest contribution to the overall size difference.
You can use various filtering options to choose the symbols to be displayed. You can choose the level of differences to display: all symbols, only those that differ between the files, or only those that appear in one or other file. You can choose to display only the symbols from specific sections (for example, to focus on code size, you could choose to only display the .text section). And finally, you can use the search function to find all functions with particular names (this uses regular expressions and sol allows pretty sophisticated searches).
You can select one or more rows. When you do this, the status bar lists: the number of rows selected, the totals sizes of those symbols and the size difference.
You can see more details about any of the symbols by right-clicking and selecting more information from the context menu. In addition to the information already shown, this will display the address of the symbol, its type, any linker flags associated with it, and the source file where the symbols was defined.
Finally, the data can be exported to a file for further analysis, or so you can keep a log of results for different tools or build options.
We have found the Object File Analyser to be a really valuable tool for understanding where code savings can be made. We hope you find it useful too.
You can find out more about DRT's features and benefits on:
- the SOMNIUM website
- our YouTube channel
You can download a free trial of DRT from the SOMNIUM portal.