Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Extra Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=68)
-   -   White Paper Discuss: Handy script to examine the size of your code (http://www.chiefdelphi.com/forums/showthread.php?t=41000)

kc8nod 23-12-2005 00:02

White Paper Discuss: Handy script to examine the size of your code
 
Thread created automatically to discuss a document in the White Papers.

Handy script to examine the size of your code by kc8nod

prograid 23-12-2005 00:05

Re: White Paper Discuss: Handy script to examine the size of your code
 
Hi, I'm having a few problems with this script.
When I tried using the script the first two lines were as follows.
Code:

Unused Memory            28651 bytes 93.3%
vfprintf()                3062 bytes 10.0%  vfprintf.c

Is this a bug in the script, or is it something I'm doing?
I have a feeling that my code is actually larger than the maximum possible size and somehow this is affecting the result.

Thanks.

kc8nod 25-12-2005 23:19

Re: White Paper Discuss: Handy script to examine the size of your code
 
Quote:

Originally Posted by prograid
I have a feeling that my code is actually larger than the maximum possible size and somehow this is affecting the result.

Quite possibly. The size of the flash is hard coded in the script as 0x7FFF. If your code exceeds that size bad things might happen. If you could post or email your .map file I could probably figure out what's going on.

prograid 27-12-2005 19:52

Re: White Paper Discuss: Handy script to examine the size of your code
 
Thanks for replying.
By the way, I don't think this should make a difference but the script is being run as a post-build command from within eclipse.
The mapfile is in the attachment in the FRCMapfile.zip archive because the forum does not allow text file attachments of greater than 100kb.

Thanks.

kc8nod 03-01-2006 11:03

Re: White Paper Discuss: Handy script to examine the size of your code
 
Quote:

Originally Posted by prograid
...the script is being run as a post-build command from within eclipse.

Sorry for the slow response, I've been offline last week.

I'm guessing that you are doing something clever with your linker script and that is confusing the codsize script. Are you even using the linker script? I can only imagine what hacks you have had to perpetrate to make mcc18 work under Eclipse. Anyway, from your mapfile:
Code:

                              Program Memory Usage
                              Start        End     
                          ---------  ---------     
                            0x000800    0x000814     
                            0x000818    0x0063a0     
                            0x300000    0x30000d     
            23468 out of 33816 program addresses used, program memory utilization is 69%

My codesize script is improperly concluding that your program ends at address 0x000814 rather than 0x0063a0. My unfounded guess is that you have an extra CODEPAGE entry in your .lkr file.
At any rate, the bug is indeed in my script. I'll think about this a bit more and post a fix in a day or two.

kc8nod 03-01-2006 11:20

Re: White Paper Discuss: Handy script to examine the size of your code
 
1 Attachment(s)
BTW, here's the proper output from the .map file you posted.

prograid 06-01-2006 19:50

Re: White Paper Discuss: Handy script to examine the size of your code
 
Quote:

Originally Posted by kc8nod
Sorry for the slow response, I've been offline last week.
I'm guessing that you are doing something clever with your linker script and that is confusing the codsize script. Are you even using the linker script? I can only imagine what hacks you have had to perpetrate to make mcc18 work under Eclipse.

Does your script use the linker script (I'm assuming you mean the 18f8520user.lkr file.) in calculating the usage of code? B/c in eclispe the linker script is a directory level up from the mapfile, but in the same level as your perl script.
This is the command I run in order to run your script:
Code:

perl "..\codesize.pl" "FRCMapfile.map"
Thanks, for your help.

EDIT:

I tried running your script from within the plain old windows command line after copying the mapfile into the same directory as your script and the .lkr file (and run this command: perl codesize.pl FRCMapfile.map), but still get the same output. I'm using ActivePerl 5.87 Build 815 on Windows XP just for your info.


All times are GMT -5. The time now is 00:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi