NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Find Source of Code Size Increase

From Texas Instruments Wiki
Jump to: navigation, search
{{#switchcategory:MSP430=<McuHitboxHeader/>|C2000=<McuHitboxHeader/>|Stellaris=<McuHitboxHeader/>|TMS570=<McuHitboxHeader/>|MCU=<McuHitboxHeader/>|MAVRK=<MAVRKHitboxHeader/>|<HitboxHeader/>}}

UPDATED LOCATION[edit]

This article has moved to here. This older article remains here for legacy reasons.

Problem Statement[edit]

You are compiling your code with two different options sets, or two different compiler versions, and you want to find the functions which have the largest code size increase between the builds.

Presumptions[edit]

  • The number and name of all the functions in the two builds is exactly the same
  • All function names are unique
    • Though you can probably deal with this if you really want to
  • You have some experience with Excel. You know how to sort data, enter basic formulas, etc.

Collect Code Size Data[edit]

Collect code size data by using the --func_info option of the Object File Display (OFD) utility. OFD is described in the Assembly Language Tools Guide for your device family. The executable is named something like ofd6x, ofd55, or ofd470. The option --func_info is first available in the compiler tools version shown here:

Target Version
C6000 v6.1.0
ARM v4.5.0
C5500 v4.2.0
MSP430 v3.0.0
C2000 v5.1.0

The topic Compiler Releases tells you where to get compiler updates.

So, to collect code size data on your two builds ...

% ofd55 --func_info file1.out > size_data1.csv
% ofd55 --func_info file2.out > size_data2.csv

View Code Size Data with Excel[edit]

The output from using --func_info is in CSV format. CSV stands for comma separated values. It is a very simple format. For example ...

C:\dir>ofd6x --func_info file.out | more
"HOSTclose","SHARED/trgdrv.c",0x00004ee0,0x00004f7c,156
"HOSTlseek","SHARED/trgdrv.c",0x000042a0,0x00004374,212
...

Each row represents data for one function. The data is separated by commas. The data on one row is: function name, file name, starting address, ending address, size.

The details of the format don't matter much in this article. Just let Excel deal with that. On a typically configured Windows system, you can "execute" a .csv file to bring it up in Excel ...

% size_data1.csv

Compare Code Size Data with Excel[edit]

  1. Bring up both .csv files in Excel
  2. Delete the file name, starting address, and ending address columns
  3. Sort both files by function name
  4. Copy the columns from one file into the other
  5. Put the name columns next to each other and visually inspect one last time to make sure they are exactly the same
  6. Delete one name column
  7. Add a formula to subtract the two size columns, called the delta
  8. Sort by the delta

The functions with the largest delta are now at the top of the spreadsheet. Here is an example, with column headings added for clarity.

Codesize compare.jpg

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Find Source of Code Size Increase here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Find Source of Code Size Increase here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Find Source of Code Size Increase here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Find Source of Code Size Increase here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Find Source of Code Size Increase here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Find Source of Code Size Increase here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Find Source of Code Size Increase here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Find Source of Code Size Increase here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Find Source of Code Size Increase here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity

{{#switchcategory:MSP430=<McuHitboxFooter/>|C2000=<McuHitboxFooter/>|Stellaris=<McuHitboxFooter/>|TMS570=<McuHitboxFooter/>|MCU=<McuHitboxFooter/>|MAVRK=<MAVRKHitboxFooter/>|<HitboxFooter/>}}