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

Floating point not working in Nios V

Chris039
Novice
828 Views

Hi,

 

I run the code below using both Nios V processor and online C code compiler,

 


#include <stdio.h>

int main() {
double total = 5;
int number = 1;
float percentage = number / total ;
printf("%.5f",percentage);

return 0;
}

 

Online compiler is working

https://www.programiz.com/c-programming/online-compiler/

Chris039_0-1669482686408.png

 

Nios V is not working

Chris039_1-1669482720043.png

 

Could you help me?

 

 

0 Kudos
8 Replies
KellyJialin_Goh
Employee
804 Views

Hi,

I will further duplicate and validate from my side to see whether it's a bug. Will keep you updated if I have any findings.


Thank you.

Regards,

Kelly


0 Kudos
KellyJialin_Goh
Employee
793 Views

Hi,

Have you added the hardware floating point component on platform designer to carry out the calculation? If not, the Floating Point Hardware component is under Embedded Processors on the Component Library tab.


We do have NIOS II Custom Instruction guide which should be similar to the application of NIOS V for your reference here: https://www.intel.com/content/www/us/en/docs/programmable/683242/current/nios-ii-floating-point-hardware-2-component.html


Thank you.

Regards,

Kelly


0 Kudos
Chris039
Novice
786 Views

Can you share the steps to add the library?

0 Kudos
KellyJialin_Goh
Employee
779 Views

Hi,

As Nios V is still at an early stage of release, we do not have the exact documentation of steps for NIOS V newlib set up. But here is adding the NIOS II new lib which should work the same for your reference : https://www.intel.com/content/www/us/en/docs/programmable/683242/current/nios-ii-fph2-and-the-newlib-library.html


Thank you.

Regards,

Kelly


0 Kudos
KellyJialin_Goh
Employee
768 Views

Hi,

Any updates from your side regarding the new information provided?


Thank you.

Regards,

Kelly


0 Kudos
Chris039
Novice
749 Views

I am still not sure how to add the library, Can you guide me by steps?

0 Kudos
KellyJialin_Goh
Employee
742 Views

Hi Chris,

I just got some news back from the engineering team. Unfortunately support for hardware Floating Point Unit (FPU) is not currently available in Nios V therefore floating point cannot be performed. This feature is expected to be released in future Quartus version.


Thank you so much for posting on Intel forum and I shall set this case to close-pending in the next few days.


Regards,

Kelly



0 Kudos
KellyJialin_Goh
Employee
708 Views

Hi Chris,

 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.


p/s: If any answer from the Intel Support is helpful, please feel free to provide ratting with 4/5 survey.


Thank you.

Regards,

Kelly Jialin, GOH


0 Kudos
Reply