- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi there,
I´m using the MAX10 Eval Board with a 10M08SAE144C8GES FPGA and an Nios II/f processor. But when i try to print a float value the JTAG output just skips the value. I´m using the Hallo_world_Small template: # include <stdio.h># include "system.h"# include "sys/types.h"# include "altera_nios_custom_instr_floating_point_2.h" int main ( void ) { __uint64_t PI = 3.1415926535; if(PI > 3.141592653) printf ("True\n"); printf("PI: %f" ,PI); printf("Hello_World\n"); printf("Sizeof(PI) %d",sizeof(PI)); printf("Goodbye\n"); printf("\n"); } OUTPUT: PI: Hello_World Sizeof(PI) Seems that the processor freezes. Any ideas on that? Thank you very much!Lien copié
2 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Is your Nios CPU compiled with the floating point custom instructions? If not you need to use software emulation. I think there is a compiler flag for it.
Second, __uint64_t sounds more like a integer type, and using it with a %f in printf may lead to undefined behaviour.- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Maybe can refer to this procedure.
https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/tt/tt_floating_point_custom_instructions.pdf
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable