PSoC >> PSoC Mixed-Signal Array

Pages: 1
Filippo - ELMARC
stranger


Reged: Apr 17 2008
Posts: 5
Unused routines on program memory
      #51102 - Thu Apr 17 2008 03:33 AM

I added a library file on my project and I call only some routines but all of them are on program memory?
how can I delete them to save flash?
Is there a compiler option?


Post Extras: Print Post   Remind Me!   Notify Moderator  
alager
Tester - PRO for PSoC


Reged: Aug 02 2007
Posts: 47
Re: Unused routines on program memory [Re: Filippo - ELMARC]
      #51192 - Fri Apr 18 2008 11:26 AM Attachment (56 downloads)

Someone a while back wrote a perl script called reduce.pl and posted it to psocdeveloper.com. I've attached it here. It will remove unused API functions, with one caveat, that is discussed in this link:
External code sublimator

This is the only way to remove unused APIs safely on a 29x part for the ICC compiler, and the only way I know of when using the HiTech compiler.

The forum forces certain file extensions for attachments, so I renamed the file to .lst. Perl usually used .pl, so just rename it to reduce.pl and you're good to go. Also make sure you have perl installed on your computer.

Aaron

Edited by alager (Fri Apr 18 2008 11:27 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
bkropf
Cypress AE


Reged: Jul 12 2007
Posts: 21
Re: Unused routines on program memory [Re: Filippo - ELMARC]
      #51212 - Fri Apr 18 2008 11:54 AM

Unfortunately, HI-TECH doesn't do any removal of assembly language routines. It either links in a whole .asm file or it doesn't.

Another way you can accomplish what you want is by adding your own source .asm file. You can cut and paste only the routines and code you want from the library .asm file (and any needed .inc or .h files). You could change the names of each of the routines in the same way. Then, your calls to the routines will only go to your custom file, and there will be no calls to routines in your library .asm file. Then, the library .asm file won't get linked in at all, whereas your customer .asm file will. Now, you're only linking in exactly the routines you want. This may be slightly tedious, but it should work fine. You also wouldn't need to worry about trusting someone else's perl script

Best regards,
Ben


Post Extras: Print Post   Remind Me!   Notify Moderator  
alager
Tester - PRO for PSoC


Reged: Aug 02 2007
Posts: 47
Re: Unused routines on program memory [Re: bkropf]
      #51412 - Mon Apr 21 2008 11:47 AM

Ben,

This is exactly what the perl script does. Only it does it in about 1.5 seconds, including the spawn time for the command window. The nice thing is, you don't have to worry about regenerating, because it'll only cost you another 1.5 seconds, not 30 minutes, when you have more than a few modules and more than one configuration.

Trust is another issue that must be decided by each.
Let the machines work for you, not the other way around.

Aaron


Post Extras: Print Post   Remind Me!   Notify Moderator  
Filippo - ELMARC
stranger


Reged: Apr 17 2008
Posts: 5
Re: Unused routines on program memory [Re: alager]
      #55052 - Thu May 08 2008 05:01 AM

Sorry me but I still have understood how to use the script.
With difficulty I downloaded perl but are suorce files (C files).
Someone can help me and explain the detailed instructions?
thank you

Filippo


Post Extras: Print Post   Remind Me!   Notify Moderator  
mikerjModerator
Guru
****

Reged: Oct 19 2003
Posts: 1283
Loc: Devon, UK
Re: Unused routines on program memory [Re: Filippo - ELMARC]
      #55072 - Thu May 08 2008 05:21 AM

You can download a pre-compiled Perl release for numerous different platforms from http://www.activestate.com/.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Serhiy
stranger


Reged: May 09 2008
Posts: 2
Re: Unused routines on program memory [Re: bkropf]
      #55352 - Fri May 09 2008 12:53 PM

Hello Ben,

You are right. But why HI-TECH compiler doesn't support the special Assembler derectives like Section. and Endsection. under ImageCraft compiler that allow the asm Dead-Code elimination specified between these directives?

The .SECTION directive must be followed by an exported global label. If there is no call to the global
label, the code will be eliminated and call offsets will be adjusted appropriately. The .ENDSECTION
directive ends the dead-code section.

Why the same mechanism of the Dead-Code Elimination isn't supported under HI-TECH compiler? Who know about it? Let me know.

Thanks.

Best Regards,
Serhiy

Edited by Serhiy (Fri May 09 2008 12:56 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
clydeAdministrator
HI-TECH team member
*****

Reged: Oct 16 2003
Posts: 633
Re: Unused routines on program memory [Re: Serhiy]
      #55372 - Fri May 09 2008 05:21 PM

It's on the list to be added to the assembler/linker in a future version.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Serhiy
stranger


Reged: May 09 2008
Posts: 2
Re: Unused routines on program memory [Re: clyde]
      #55642 - Mon May 12 2008 06:17 AM

Hello Clyde!

Thank you for the great news. Could you inform me when it is planned to be realized and done? This information will be helpful for me for planning of the asm-functions library for the one of the PSoC tool.

Best Regards,
Serhiy Prudkyy


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
1 registered and 1 anonymous users are browsing this forum.

Moderator:  ndouglas, Dan Henry, jtemples, jeff, Andrew L, mikerj, dave g, meisty, josh stevo 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 2140

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5