Go to Post The teams who have the best chance at success are the ones who know where they can save time and money on machining by using or using part of some premade equivalent. - Bill Gold [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-12-2005, 00:02
kc8nod's Avatar
kc8nod kc8nod is offline
Registered User
AKA: Ted Hansen
FRC #1216 (Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Oak Park Michigan
Posts: 43
kc8nod is on a distinguished road
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
Reply With Quote
  #2   Spotlight this post!  
Unread 23-12-2005, 00:05
prograid's Avatar
prograid prograid is offline
Registered User
AKA: Ben Cherian
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2004
Location: San Jose
Posts: 80
prograid will become famous soon enough
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-12-2005, 23:19
kc8nod's Avatar
kc8nod kc8nod is offline
Registered User
AKA: Ted Hansen
FRC #1216 (Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Oak Park Michigan
Posts: 43
kc8nod is on a distinguished road
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-12-2005, 19:52
prograid's Avatar
prograid prograid is offline
Registered User
AKA: Ben Cherian
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2004
Location: San Jose
Posts: 80
prograid will become famous soon enough
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-01-2006, 11:03
kc8nod's Avatar
kc8nod kc8nod is offline
Registered User
AKA: Ted Hansen
FRC #1216 (Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Oak Park Michigan
Posts: 43
kc8nod is on a distinguished road
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-01-2006, 11:20
kc8nod's Avatar
kc8nod kc8nod is offline
Registered User
AKA: Ted Hansen
FRC #1216 (Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Oak Park Michigan
Posts: 43
kc8nod is on a distinguished road
Re: White Paper Discuss: Handy script to examine the size of your code

BTW, here's the proper output from the .map file you posted.
Attached Files
File Type: txt 254codesize.txt (11.4 KB, 36 views)
Reply With Quote
  #7   Spotlight this post!  
Unread 06-01-2006, 19:50
prograid's Avatar
prograid prograid is offline
Registered User
AKA: Ben Cherian
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2004
Location: San Jose
Posts: 80
prograid will become famous soon enough
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.

Last edited by prograid : 06-01-2006 at 19:56. Reason: More Information
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
White Paper Discuss: 2003 Automated Dead Reckoning Test Code CD47-Bot Extra Discussion 10 07-09-2005 11:25
White Paper Discuss: FIRST Sponsorship = Excellent Corporate Strategy Chris Fultz Extra Discussion 0 12-04-2005 20:23
White Paper Discuss: Joystick Sensitivity Demystified - Version 2 marccenter Extra Discussion 0 28-02-2005 16:54
White Paper Discuss: Continuous Improvement Process for FIRST Teams Chris Fultz Team Organization 2 05-01-2005 20:52
White Paper Discuss: CopyCat Code v1.1 CD47-Bot Extra Discussion 7 31-03-2003 12:37


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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