Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

NIOS V Compiler Settings/Optimizations

Sleepy
Beginner
496 Views

Quartus Version - 21.4

Nios V compiler toolchain: GNU RISC-V Embedded GCC (as recommended on the Nios V handbook)

So I have a couple of C files currently running in a NIOS II system. I tried to migrate it to a NIOS V, however, after compilation, the .elf file cannot be generated as the instruction memory (.text) overflows by over 100 Kb. I find this a little surprising, as the code compiled on the NIOS 2 fits perfectly in the assigned memory space. I was wondering, what are some ways I could reduce the code footprint back to a similar level as on the NIOS II?

 

I know some optimization settings such as small c library are not present on the NIOS V BSP settings, but any idea on why the code footprint is more than 2x the size of it on the NIOS II?

0 Kudos
1 Solution
JingyangTeh
Employee
468 Views

Hi Sleepy


The small c library options not available for the NiosV, however there is the lightweight device driver option.


You could find the parameters to reduce code footprint in the BSP editor.

Below is a link to edit the interface to edit the BSP.

https://www.intel.com/content/www/us/en/docs/programmable/726952/22-2-21-3-0/nios-v-board-support-package-editor.html


You could refer the old Nios II BSP settings to reduce code size in table 54 in the document below.

https://www.intel.com/content/www/us/en/docs/programmable/683689/current/reducing-the-code-footprint.html


Do take note that the small c library option is no longer supported in NiosV.


Regards

Jingyang, Teh


View solution in original post

0 Kudos
3 Replies
JingyangTeh
Employee
469 Views

Hi Sleepy


The small c library options not available for the NiosV, however there is the lightweight device driver option.


You could find the parameters to reduce code footprint in the BSP editor.

Below is a link to edit the interface to edit the BSP.

https://www.intel.com/content/www/us/en/docs/programmable/726952/22-2-21-3-0/nios-v-board-support-package-editor.html


You could refer the old Nios II BSP settings to reduce code size in table 54 in the document below.

https://www.intel.com/content/www/us/en/docs/programmable/683689/current/reducing-the-code-footprint.html


Do take note that the small c library option is no longer supported in NiosV.


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
450 Views

Hi Sleepy


Any update on this case?

Did you managed to try out the settings I shared?


Regards

Jingyang, Teh



0 Kudos
JingyangTeh
Employee
439 Views

Hi Sleepy


Since there are no feedback for this thread, I shall set this thread to close pending. If you still need further assistance, you are welcome reopen this thread within 20days or open a new thread, someone will be right with you.


If you happened to close this thread you might receive a survey.  If you think you would rank your support experience less than 10 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.


Regards

Jingyang, Teh


0 Kudos
Reply