Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Reducing syslib size

I use Nios II and Quartus 5.0. When I build my application using "small" syslib. The library takes about 15 kB. Is there a way to make my own custom library that would contain only startup code and would leave everything else for application?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by keijo@Nov 21 2005, 08:03 AM

    i use nios ii and quartus 5.0. when i build my application using "small" syslib. the library takes about 15 kb. is there a way to make my own custom library that would contain only startup code and would leave everything else for application?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11069)

    --- quote end ---

    --- Quote End ---

    A good place to start would be the Reducing Code Footprint section of the Nios Software Developers Handbook. You should be able to get the syslib down to the same size you could by hand coding everything in your application.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks!

    Now I have been able to squeeze footprint to ~3.5k.

    It also turned out that I had also misinterpreted the linker result. I build my project to run from RAM during testing and I had ignored the fact that linker reported size includes also zeroed ram area.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Do I need to initialize jtag uart if one is present in the system? I noticed that I could reduce footprint by writing my own alt_main which does not initialize any device drivers. I have jtag uart and epcs controller, but the bootloader that I am writing is not going to use them. It turned out that if I don&#39;t initialize jtag uart I can&#39;t get my code to work!

    Does this have something to do with time-limited version that I am testing with or a feature that will remain even when I get a license?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Do I need to initialize jtag uart if one is present in the system?[/b]

    --- Quote End ---

    Only if you intend to use it. I suggest you start with the generated alt_main and remove things one by one to see what it is that&#39;s breaking your system.