Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

Code optimisation



I am beggining to use the NIOS II development kit, Cyclone II edition. The examples are working well. 


Now I am trying to make a design with the UART link, the LCD and one led. First, I used the reduced C library in order to optimise code (I am only using ON-chip memory). But now, I want to use the fopen() function and this is not supported under the small C library. 


I have done all what is preconised in the SW developpers Handbook 4-23 and later. 


Now, when I compile the code, I do not have enough memory (44 kbytes on-chip memory). 

But if I try to increase the on-chip memory. The hardware design does not fit anymore. 


I have then some questions : 


- What is the size of the cells in bits when Quartus II returns :" 246 RAM cells cannot be placed" ? 


- In the NIOS II SW developpers Handbook 4-27, there's a paragraph explaining that we can remove device drivers if we don't want it. But I don't understand how to remove the UART driver for example. Does anybody knows ? 


- Are there other tips in order to optimise code or do I have to had external memory ? 


Thank you for any help, 


Jean LEE
0 Kudos
1 Reply
Honored Contributor I

44kB is approximately the most onchip memory you will get with a 2c35. 


If I were you I'd just take one of the example designs and rip it apart (just remove components you don't want in SOPC builder, remove unused pins, and recompile).
0 Kudos