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++
12612 Discussions

Running Optimization Flags for NiosV app and bsp

farah
Novice
1,130 Views

I am trying to condense my code to resolve a "can't place all RAM cells in design" compilation error and am new to the niosv processor. Is there a way to run optimization flags on both niosV application code along with bsp?

 

I have looked through the niosv design handbook and I have been able to optimize my bsp by running

 

niosv-bsp -c <path to settings.bsp> -qpf=<path to .qpf> --cmd="set_setting hal.make.cflags_optimization {-O2 -fno-tree-vectorize}"

 

Is there a similar -O2 or -Os command that can be run using niosv-app? Or small c library support similar to niosii?

0 Kudos
1 Solution
wwanalim_intel
Employee
969 Views

Hi,

 

This is from the NiosV Embedded Processor Design Handbook on page 81.

wwanalim_intel_0-1700022165286.png

 

This is from the NiosV Processor Software Developer Handbook on page 103.

wwanalim_intel_1-1700022228906.png

 

Thank you.

Regards,

 

Fathulnaim

 

View solution in original post

0 Kudos
8 Replies
wwanalim_intel
Employee
1,082 Views

Hi,

 

Greetings and welcome to Intel's forum.

Please give me some time to check and get back to you with update.

 

Thank you.

Regards,

Fathulnaim


0 Kudos
farah
Novice
1,071 Views

Hello,

 

For more information, I looked at the sw/app/CMakeLists.txt and realized it does include "include(../bsp/toolchain.cmake)." Correct me if I am wrong, but this makes me believe that adding optimization on the bsp also optimizes the app code?

 

I have tried adding additional flags according to the embedded design handbook.

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

 

 

niosv-bsp -c <path to settings.bsp> -qpf=<path to .qpf> --cmd="set_setting hal.make.cflags_optimization {-Os}" --cmd="set_setting hal.enable_reduced_device_drivers" --cmd="set_setting hal.enable_lightweght_device_driver_api"

 

(Note: it would not let me enable the small c library...)

 

My application code is still rather large and I am curious if there is any additional flags or options for niosv

0 Kudos
Oliver_I_Sedlacek
New Contributor III
954 Views

Apologies for the thread hijack but I've been trying to respond to Fathulnaim on my own thread https://community.intel.com/t5/Nios-V-II-Embedded-Design-Suite/Debugger-wont-connect-to-NIOS-II-hello-world-on-Cyclone-GX/m-p/1544031#M52319 and I just can't. I'm so frustrated by the forum software and my problem isn't resolved. Please investigate why I can't post and please remove this post as I really, really don't like to hijack another user's thread.

0 Kudos
wwanalim_intel
Employee
1,014 Views

Hi,

 

Yes, adding optimization on the bsp also optimizes the app code.

 

Based on the link you provided above, it seems you referring to the NiosII handbook.

 

For NiosV, you can get the information about the developing, debugging and optimizing embedded systems on the NiosV Embeded Processor Design Handbook which is on the below link. 


https://www.intel.com/content/www/us/en/docs/programmable/726952/23-3/about-the-embedded-processor.html


0 Kudos
farah
Novice
996 Views

Hello,

 

I have reviewed the NiosV embedded processor handbook and there is nothing in there about reducing code footprint or how to optimize (which is why I was referencing Nois II/added this post to the forum).

 

Could you point me towards NiosV specific documentation on this topic?

 

Thanks.

0 Kudos
wwanalim_intel
Employee
970 Views

Hi,

 

It seems you need to download the latest version of the NiosV Embedded Processor Design Handbook to be able to see the part of the code footprint. Will attached below the part of the book which I refer to the downloaded version.

https://www.intel.com/content/www/us/en/docs/programmable/726952/23-3/about-the-embedded-processor.html

 

At the same time, you also can refer to the NiosV Processor Software Developer Handbook on this part.

https://www.intel.com/content/www/us/en/docs/programmable/743810/23-3/reducing-code-footprint-in-embedded-systems.html


0 Kudos
wwanalim_intel
Employee
970 Views

Hi,

 

This is from the NiosV Embedded Processor Design Handbook on page 81.

wwanalim_intel_0-1700022165286.png

 

This is from the NiosV Processor Software Developer Handbook on page 103.

wwanalim_intel_1-1700022228906.png

 

Thank you.

Regards,

 

Fathulnaim

 

0 Kudos
wwanalim_intel
Employee
916 Views


I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.



0 Kudos
Reply