Code Generation Tools XML Processing Scripts

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search


  • Image:Google-16x16.png Search for an article here:


Contents

Introduction

This is a package of Perl scripts used to process the XML files that come from the TI code generation tools. Use it to do things like build a spreadsheet that details the size of all the sections, or figure out how much of the memory map is taken up by specific libraries.

These scripts are now post-processed as part of the release to create executables on Windows & Linux - so you don't need to have Perl installed as a prerequisite.

Also note that these scripts now work with COFF or ELF object file formats. They can also work with other vendor Codegen outputs - for example the scripts were tested against ELF libraries built by the MontaVista GCC ARM compiler. This is true for utilities like sectti which only depend on the (COFF or ELF) Object File information - however scripts like call_graph require detailed Dwarf debug information to obtain the call tree and stack size hence will only work with TI based CGT ELF output.

Download

  • cg_xml is available here
    • CG_XML v1.20 or later is recommended because it contains the executable versions of the scripts. Also the RTSC Package Wizards and the QualiTI tool depend on >= cg_xml v1.20

Sample Outputs

  • Categorizing memory usage: -
C:\dir>ofd6x -x app.out | sectti
Reading from stdin ...

************************************************************
REPORT FOR FILE: app.out
************************************************************
                Name : Size (dec)  Size (hex)  Type   Load Addr
-------------------- : ----------  ----------  ----   ----------
                .clk :         12  0x0000000c  UDATA  0x0000f0b4
            .hwi_vec :        512  0x00000200  CODE   0x00000000
                .swi :        220  0x000000dc  UDATA  0x0000ecd0
                .idl :         32  0x00000020  UDATA  0x0000dee0
                .bss :        896  0x00000380  UDATA  0x0000d800
                .far :       2124  0x0000084c  UDATA  0x0000c340                                        
<snip ...>

------------------------------------------------------------
Totals by section type
------------------------------------------------------------
  Uninitialized Data :       7604  0x00001db4
    Initialized Data :       9478  0x00002506
                Code :      48800  0x0000bea0
  • See Stack Usage and Call Graph
C:\dir> call_graph arm_hello.xml | more
Call Graph for arm_hello.out
**********************************************************************
_c_int00 : wcs = 668
|  __args_main : wcs = 668
|  |  _main : wcs = 668
|  |  |  _printf : wcs = 664
|  |  |  |  __printfi : wcs = 632
|  |  |  |  |  __pproc_fflags : wcs = 0
|  |  |  |  |  __pproc_fwp : wcs = 36
|  |  |  |  |  |  _atoi : wcs = 4
|  |  |  |  |  |  _memset : wcs = 8
|  |  |  |  |  __pproc_str : wcs = 56
|  |  |  |  |  |  _free : wcs = 20
|  |  |  |  |  |  |  _minit : wcs = 8
|  |  |  |  |  |  |  _minsert : wcs = 8
|  |  |  |  |  |  |  _mremove : wcs = 0
|  |  |  |  |  |  _malloc : wcs = 20
|  |  |  |  |  |  |  _minit : wcs = 8
|  |  |  |  |  |  |  _minsert : wcs = 8
|  |  |  |  |  |  |  _mremove : wcs = 0
...

More details on Stack usage in this context can be found on this wiki page.

Prerequisites

  • Presumes you are using TI Code Generation Tools (any target).

Instructions

  • cg_xml introduction
    • Point your browser to install_root/index.htm - you will then be able to see detailed information on each script.

For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Code Generation Tools XML Processing Scripts here.
Leave a Comment
Personal tools