NIOS V Compiler Settings/Optimizations
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?
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.
You could refer the old Nios II BSP settings to reduce code size in table 54 in the document below.
Do take note that the small c library option is no longer supported in NiosV.
Regards
Jingyang, Teh