Forum Discussion
How to reduce ROM/RAM requirements for a NIOSV Compact CPU Platform?
Hello ALTERA NIOSV Experts,
I am trying to create a system in Quartus Platform Designer which has the following components:
- A 1G Tri mode ethernet IP (with 32 bit AVALON-ST TX/RX interfaces using minimum sized FIFOs)
- A RS 232 UART with no FIFO
- A couple of small FIFOs using AVALON-ST interfaces for data in and out of Platform via Conduits
- A NIOSV Compact CPU
- A JTAG UART
- ROM for NIOSV
- RAM for NIOSV
My questions are about how to reduce the ROM (for the NIOSV compacts program) and RAM to the minimum amount. I am trying to shoehorn this all into a MAX10 FPGA ( Altera Max 10 part number 10M08SAU169I7G). When i build the BSP for this platform, with a "Hello World" program, it seems to need around 128 Bytes of ROM and several KBytes of RAM. Why is the program so large ? I expect it has to do with the BSP adding in drivers for all the Platform IP and it is getting bloated.
What tactics are available for me to use in the Ashling RISC FREE IDE which i am using to create my BSP and/or Platform Designer to reduce the program size ? The FPGA i am trying to use only has around 48 K Bytes of RAM available in total ...so maybe this is not possible and i need a bigger FPGA of course !
Thanks for your help,
Dr Barry
4 Replies
- KelvinK_Altera
Occasional Contributor
Hi Dr Barry,
You can reduce the Nios V software size through BSP setting. 3.2.1. Nios® V Processor Board Support Package Editor
Here is comparison on the BSP setting on a Hello world program. 2.3. Software Optimization
If this still not able to fit in your FPGA, you might want to look to a larger FPGA.
- LiangYuG_Altera
Contributor
Hi drbarryh ,
You might be interested in this chapter : Nios V Processor Software Developer Handbook - Reducing Code Footprint in Embedded Systems.
My first recommendation is Apply Compiler Flags in the BSP.Remember to run the cmake with "CMAKE_BUILD_TYPE=Release" to enforce the optimization flag.
Without it, the ELF will be unoptimized for debug purpose.cmake -S sw/app -B sw/app/build -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=ReleaseRegards,
Liang Yu- drbarryh
Contributor
Thanks for your help Liang, And the compiler flag suggestions i will try out. Yes your right i do need to use the Release version during my compiles !!
Cheers, Dr Barry H
- BoonBengT_Altera
Moderator
Dear drbarryh ,
Since clarification has been provided and no further follow‑up questions have been raised, we will assume the issue has been resolved.
This thread will now be transitioned to community support, where other users can continue to assist with any additional inquiries.
For new questions, please feel free to open a fresh thread — we’ll be happy to support you there.Thank you for being part of the community!
Best regards,
Altera Technical Support