Forum Discussion

Chris039's avatar
Chris039
Icon for Occasional Contributor rankOccasional Contributor
3 years ago

Floating point not working in Nios V

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/

Nios V is not working

Could you help me?

8 Replies

  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    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


  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    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


  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    Hi,

    Any updates from your side regarding the new information provided?


    Thank you.

    Regards,

    Kelly


  • Chris039's avatar
    Chris039
    Icon for Occasional Contributor rankOccasional Contributor

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

  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    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



  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    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