i wrote:
 > is there a way in sdcc to see the memory requirements of individual
 > object files?  i'm thinking of the moral equivalent of "size *.o",


there was no response to the above, so i've put together a script that
attempts to extract this information from the .rel files for our 8051
project.

the output of my script looks like this:
    $ tools/sdcc_sizes 
    /home/pgf/work/ec-1.75
    Fri Dec 10 10:55:57 EST 2010
                            code   const   xdata    data     bit
    obj/ac.rel:              240      25       4       0       5
    obj/adc.rel:             172       0       1       0       0
    obj/battery.rel:        1048      75      16       0       0
    obj/build.rel:           206      46       5       0       0
    obj/event.rel:            20       0       1       0       0
    obj/io.rel:             2289      69      14       0       0
    obj/keyboard.rel:        532     162      34       0       0
    obj/lifebatt.rel:       3862     547      46      14       0
    obj/main.rel:            321      32       0       0       1
    obj/monitor.rel:        1165      54      24       4       1
    obj/mppt.rel:           3925     235      70       8       0
    obj/onewirebatt.rel:    6460     876     300       6       0
    obj/power.rel:          4102     818      22       0       0
    obj/ps2.rel:             764       9      75       1       0
    obj/ps2_private.rel:     493       0       1       1       0
    obj/sdi.rel:            1959     291      77       6       0
    obj/sdicmd.rel:          588      30       2       1       0
    obj/timer.rel:           564       5      22       6       0
    obj/touchpad.rel:        118       9       1       0       0
    obj/uart.rel:            503      17      80       5       1
    obj/updater.rel:         191    1379       3       0       1

    -- totals (no libraries) --------
    code:   29522
    const:  4679
    xdata:  798
    data:   52
    bits:   9


the .mem file for this build says:
    Other memory:
       Name             Start    End      Size     Max     
       ---------------- -------- -------- -------- --------
       PAGED EXT. RAM                         0      256   
       EXTERNAL RAM     0xf400   0xf773     884     2048   
       ROM/EPROM/FLASH  0x0000   0x9454   37973    62464   

the difference between the ROM/EPROM/FLASH value of 37973 and
my code+const value of 29522+4679 ( == 34201) is 3772.  does
that seem like a reasonable size for the library code?  i think
printf_large is roughly 1K, so maybe it's about right.

the script i'm using is attached.  comments/corrections welcome, of course.

paul
=---------------------
 paul fox, p...@laptop.org

Attachment: sdcc_sizes
Description: -

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to