HOWTO get the size of code generated

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO get the size of code generated

8,164 Views
claw
Contributor I
Working with CW 5.0, I've tried in vain to find the size of code generated.
Please, tell me where can I find this information.

Thanks in advance.
Labels (1)
0 Kudos
Reply
12 Replies

895 Views
PsychoDebugger
Contributor I
I need to know the code generated, because of my lecense.
I need only the total k, example 7k.
Do I have everytime to read the map file ad to sum all rows?
0 Kudos
Reply

895 Views
mke_et
Contributor IV
Must be a 'C' issue. I see no option for a map file with assembler
0 Kudos
Reply

895 Views
CrasyCat
Specialist III
Hello
MAP file is generated by the linker.
That means you should be able to get a MAP file for an ANSI C or relocatable assembler application.
 
Anything which gets through the linker to generate an executable file.
If you are using absolute assembly, you will not get any MAP file.
 
Basic idea is that programmer is controlling object allocation when programming in absolute assembly. So we suppose you know where you put your stuff.
 
You should be able to let the assembler generate a listing file though.
In HC08 V5.0 you have an assembly option -L for that. Please take also a look at option -Lasmc to configure whatever you want to see in the listing file.
 
CrasyCat
0 Kudos
Reply

895 Views
offgrid
Contributor III
I am having same problem in Metrowerks (not Freescale) Codewarrior Ver 7.3 for DSP56800. I cannot find the switch to set for listing output file at all. It is pretty important on the target which is a '8013 chip with only 16K of FLASH!!

Anyone come across that???

Thanks!!

Tim
0 Kudos
Reply

895 Views
CrasyCat
Specialist III

Hello

Are you looking for a way to generate a map file in CodeWarrior for DSP568xx?

If you are building from the IDE:
    - Start IDE
    - Open the project
    - Open the Target Setting dialog (pressing ALT+F7)
    - Switch to "M56800E Linker" or "M56800 Linker" depending on the CPU you are targeting
    - Make sure "Generate Link Map File " is checked.

If you are building from command line make sure to link with option -Map.

I hope this helps.

CrasyCat

0 Kudos
Reply

895 Views
offgrid
Contributor III
There is a check box labeled "Generate Link Map" under "Linker", "M56800E Linker", and that is checked. There is no "*.map" file
generated however.

The only output file that is close is "sdm_pROM_xRAM.elf.xMAP" which is not at all like the HC05 map file I am used to seeing. There is no summary of memory used, no RAM used, are there even starting and ending addresses here??

Here is the listing (so you can see what I mean!!):

# Link map of F_EntryPoint



# .interrupt_vectorsboot
#>00000000 F_vector_addr (linker command file)
00000000 00000004 interrupt_vectorsboot.text F_vectboot (Vectors.c)

# .interrupt_vectors
00000000 0000005C interrupt_vectors.text F_vect (Vectors.c)

# .ApplicationCode
#>0000005C F_Pcode_start_addr (linker command file)
0000005C 00000033 .text F_EntryPoint (Cpu.c)
0000008F 00000007 .text FCpu_Interrupt (Cpu.c)
00000096 00000021 .text FPE_low_level_init (Cpu.c)
000000B7 00000059 .text Fmain (Tims_PWM_test.c)
00000110 00000045 startup.text Finit_56800_ (56F80xx_init.asm)
00000110 00000045 startup.text startup.text (56F80xx_init.asm)
#>00000155 F_Pcode_end_addr (linker command file)
#>00000156 __pROM_data_start (linker command file)

# .data_in_p_flash_ROM
#>00000001 __xRAM_data_start (linker command file)
#>00000002 __xRAM_data_end (linker command file)
#>00000001 __data_size (linker command file)

# .ApplicationData
#>00000004 F_Xbss_start_addr (linker command file)
#>00000004 _START_BSS (linker command file)
#>00000004 _END_BSS (linker command file)
#>00000000 F_Xbss_length (linker command file)
#>00000004 _HEAP_ADDR (linker command file)
#>00000100 _HEAP_SIZE (linker command file)
#>00000104 _HEAP_END (linker command file)
#>00000200 _min_stack_size (linker command file)
#>00000104 _stack_addr (linker command file)
#>00000304 _stack_end (linker command file)
#>00000004 F_heap_addr (linker command file)
#>00000104 F_heap_end (linker command file)
#>00000104 F_Lstack_addr (linker command file)
#>00000104 F_StackAddr (linker command file)
#>00000303 F_StackEndAddr (linker command file)
#>00000001 F_Ldata_size (linker command file)
#>00000001 F_Ldata_RAM_addr (linker command file)
#>00000156 F_Ldata_ROM_addr (linker command file)
#>00000000 F_xROM_to_xRAM (linker command file)
#>00000001 F_pROM_to_xRAM (linker command file)
#>00000004 F_start_bss (linker command file)
#>00000004 F_end_bss (linker command file)
#>00000304 __DATA_END (linker command file)
#>0000F000 FArchIO (linker command file)


# Memory map:
v_addr p_addr size name
0000F000 0000F000 00000000 .x_Peripherals
00000000 00000000 00000004 .p_Interruptsboot
00000000 00000000 0000005C .p_Interrupts
0000005C 0000005C 000000FA .p_Code
00000001 00000001 00000303 .x_Data
00000001 00000001 00000001 .p_flash_ROM_data
00008000 00008000 00000800 .p_internal_RAM

# Link start time: Tue Jun 13 09:32:08 2006
# Link end time: Tue Jun 13 09:32:08 2006
0 Kudos
Reply

895 Views
CrasyCat
Specialist III

Hello

The .xMAP file is the file you have to look into.

At the end of the file you have a section Memory Map looking as follows:

# Memory map:
  v_addr   p_addr   size     name
  00000000 00000000 000000A4 .p_interrupts_flash_ROM
  000000A4 000000A4 000004FE .p_flash_ROM
  000005A2 00000001 0000008D .p_flash_ROM_data
  00020000 00020000 0000008B .p_boot_flash_ROM
  0002F800 0002F800 00000800 .p_internal_RAM
  00000001 00000001 000006B5 .x_internal_RAM
  00001000 00001000 00000000 .x_flash_ROM
  0000F000 0000F000 00001000 .x_onchip_peripherals
  00FFFF00 00FFFF00 00000000 .x_EOnCE

This is where you find information around size of the application.

The MAP file is just a text file providing information on what happens during the link session. Format of this file is not standard and may vary from one CPU to the other.

I hope this helps.

CrasyCat

0 Kudos
Reply

895 Views
mke_et
Contributor IV
Is that unique to CW5? I don't see it with CW3.1. Maybe I'm just not setting an option the same way.

I always look at my listing file, and then check where things lie and how much room I have, since I may have things at fixed offsets and I need to be aware of not only what is where, but how I can 'expand' things without bumping into things that may be real bad!
0 Kudos
Reply

895 Views
peg
Senior Contributor IV

Hi,

Its the same in 3.1 and 5.

I haven't done anything special to get it like this. Here is the last few lines from two different projects' map files.

Code:

CW3.1:*********************************************************************************************STATISTIC SECTION---------------------------------------------------------------------------------------------ExeFile:--------Number of blocks to be downloaded: 6Total size of all blocks to be downloaded: 2749CW5:*********************************************************************************************STATISTIC SECTION---------------------------------------------------------------------------------------------ExeFile:--------Number of blocks to be downloaded: 3Total size of all blocks to be downloaded: 226


 

Regards David

 

0 Kudos
Reply

895 Views
jag
Contributor IV

peg wrote:

Code:

CW3.1:
*********************************************************************************************
STATISTIC SECTION
---------------------------------------------------------------------------------------------
ExeFile:
--------
Number of blocks to be downloaded: 6
Total size of all blocks to be downloaded: 2749
<hr/>



the dimension of one block is what? 1 byte? 2 byte?

Bye Jack
0 Kudos
Reply

895 Views
Sten
Contributor IV

Perhaps these lines from the end of the SECTION-ALLOCATION SECTION of the MAP-file are even more useful:


Code:

Summary of section sizes per section type:READ_ONLY (R):        FCA1 (dec:    64673)READ_WRITE (R/W):     1006 (dec:     4102)NO_INIT (N/I):         830 (dec:     2096)


 

0 Kudos
Reply

895 Views
CompilerGuru
NXP Employee
NXP Employee
Which core are you using, a HC08?

For a HC08, check the map file, it is by default in the bin folder.

Daniel
0 Kudos
Reply