Floating point in Nios SDK

Hello... Can anybody tell me that why Nios SDK cant display floating point datatype if I include excalibur.h as the header file? The C code that process simple floating point works correctly only if I exclude the excalibur.h file. The problem occur when I need the software subroutine for the standand peripherals but I cant display the processing time if the calculation formula involved floating point.

Reply to
Maxlim
Loading thread data ...

Hi Maxlim,

The reason for this is the printf() routine compiled into your library, defined when you include 'excalibur.h' in your C code is a 'small' printf() that does not support floating point numbers to save on space (useful for systems running out of on-chip memory). This is an SDK option that can be switched for printf() that supports floating point.

You can disable this small printf routine and use the full-sized one (and still use excalibur.h in your source code) by opening SOPC Builder, editing the Nios CPU settings for your processor, and under "Software" tab, un-checking the "Use small printf" checkbox. After this, re-generate the SDK and re-compile your code; you should now be able to print floating point numbers correctly while including excalibur.h. I just tried a simple test to verify this, so if you have any questions please email me and I'll send you the example.

Regards,

Jesse Kempa Altera Corp. jkempa at altera dot com

Reply to
Jesse Kempa

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.