DSPRelated.com
Forums

Program Code Size and Data Memory Usage

Started by Daniel May 5, 2005
Hi everybody!
I am programming a TI 6713 DSP with the Code Composer Studio V 2.21 in
C and have a question concerning it.

Is there an easy way to see the size of the program code (not the
C-Code, but the compiled code that is transmitted to the DSP) and the
maximum of data memory used?

I want to compare MATLAB-generated Code with my own handwritten code
and see which one is smaller and uses less data memory.

Thank you all

Daniel

Hello Daniel--

>Hi everybody! >I am programming a TI 6713 DSP with the Code Composer Studio V 2.21 in >C and have a question concerning it. > >Is there an easy way to see the size of the program code (not the >C-Code, but the compiled code that is transmitted to the DSP) and the >maximum of data memory used? > >I want to compare MATLAB-generated Code with my own handwritten code >and see which one is smaller and uses less data memory. > >Thank you all > >Daniel
It is possible to estimate these things in a number of different ways in TI development environment.I will just reccomend one of the many many methods: This is via the usage of a MAP file. This map file can be generated by enabling this option in project->build options->linker tab->under Map file name type in a name with .map extension (ex:.\Debug\dotproduct.map) Upong building the project based on these configuration you would find a dump of this text file name.map in your project folder. This is a sort of a symbol table+ section length info bundled into one. Basically if you are interested in code/data size,you shd look for the sizes of the following pre-defined sections: text ----> code bss ----> Global/Static Variables stack----> Stack for local variables sysmem----> Memory for malloc fcns (heap) cinit ----> Initial values for global/static vars far ------> Global and statics declared far cio ------> Buffers for stdio functions A Typical MAP file might read something like this(I hope the formatting is alright when you read it in a different resolution...) example.map ----------------------------------------------------------------------
>> Linked Wed Aug 07 11:13:39 2002
OUTPUT FILE NAME: <./Debug/hello.out> ENTRY POINT SYMBOL: "_c_int00" address: 00000900 SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- text 0 00000200 000004A0 00000200 00000260 rts6200.lib : memcpy.obj (.text) 00000460 00000240 test.obj (.text) bss 0 000006A0 000050 UNINITIALIZED 000006A0 00030 test.obj (.bss) 000006d0 000020 rts6200.lib : _lock.obj (.bss) cinit 0 00006f0 00000050 00006f0 00000050 rts6200.lib : exit.obj (.cinit) stack 0 00007408 00000400 UNINITIALIZED GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- 000006a0 .bss 00000200 .text 00000400 __STACK_SIZE 00000900 _c_int00 0000680 _h 000006a0 _main 000006b0 _x 0000690 _y 00006f0 cinit -------------------------------------------------------------------- --Bhooshan This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Yes, there should be a .map file in the debug directory that gives all the 
information on memory allocation.  I believe it's generated by default.  If 
it's not there then you can go to Project -> Options and then go to the 
linker tab and specify a file name in the field that shows map file.

Brad

"Daniel" <d.lohausen@freenet.de> wrote in message 
news:1115281265.581194.207050@o13g2000cwo.googlegroups.com...
> Hi everybody! > I am programming a TI 6713 DSP with the Code Composer Studio V 2.21 in > C and have a question concerning it. > > Is there an easy way to see the size of the program code (not the > C-Code, but the compiled code that is transmitted to the DSP) and the > maximum of data memory used? > > I want to compare MATLAB-generated Code with my own handwritten code > and see which one is smaller and uses less data memory. > > Thank you all > > Daniel > >
Under  you installed directory bin
there is
two command line  tool available.
"sizeti"  (which will give you in one shot how much code, data memory u
are using)
and second one "secti" (will give you usage per section , this is very
similar to map file result but in more readable format)
But if you like do dive in MAP file is the best.

soumit