From: bhaskar on
Hi to all,
I am the begginer in microblaze. I want to just print the value of
the float variable "fpu" (=2.345) on the uart. can you please tell me how
to write it in the microblaze (C), Can you tell me right from the include
statements, because I not even know what are the header files it usesw to
include floating point unit. I have just added FPU in the BSB launcher when
the EDK invokes. I dont know what should i do later. Plz help me

Thanks

Bhaskar



---------------------------------------
Posted through http://www.FPGARelated.com
From: Martin Thompson on
"bhaskar" <bhaskar15nov(a)n_o_s_p_a_m.gmail.com> writes:

> Hi to all,
> I am the begginer in microblaze. I want to just print the value of
> the float variable "fpu" (=2.345) on the uart. can you please tell me how
> to write it in the microblaze (C), Can you tell me right from the include
> statements, because I not even know what are the header files it usesw to
> include floating point unit. I have just added FPU in the BSB launcher when
> the EDK invokes. I dont know what should i do later. Plz help me

Have you tried - does something like this not work?

#include <stdio.h>

int main(void)
{
float somefloat=2.345f;
printf("%f\n", somefloat);
}

XPS should sort everything out behind the scenes for this to work.You
do have to use "proper" printf() rather than xil_printf() which means
your elf file gets pretty big all of a sudden though. Don't try and
run it out of internal memory!

Cheers,
Martin

--
martin.j.thompson(a)trw.com
TRW Conekt - Consultancy in Engineering, Knowledge and Technology
http://www.conekt.net/electronics.html