cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
8,421 Views
Registered: ‎07-07-2009

Floating point data calculation time

Hi, I am using SPARTAN-3E s500. starter board, with microblaze soft processor. I found the calculation time is different for the fix point data and floating point data. For floating point data, it is very slow,,,,,,anybody has any idea or this?

 

Best Regards,

Roy from the UK

0 Kudos
11 Replies
Highlighted
Historian
Historian
8,415 Views
Registered: ‎02-25-2008

Re: Floating point data calculation time


zrh0913 wrote:

Hi, I am using SPARTAN-3E s500. starter board, with microblaze soft processor. I found the calculation time is different for the fix point data and floating point data. For floating point data, it is very slow,,,,,,anybody has any idea or this?

 

Best Regards,

Roy from the UK


The MicroBlaze does not have a native hardware floating-point unit, so it does such calculations in software. And as such, one would expect performance to suffer greatly.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Observer
Observer
8,412 Views
Registered: ‎07-07-2009

Re: Floating point data calculation time

Thank you for your reply, any solutions except of using the fixed point data.

 

Best Regards,

Roy

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
8,409 Views
Registered: ‎08-13-2007

Re: Floating point data calculation time

As indicated, software implementation of floating point operations is much slower than fixed point due to the implementation differences in the operations.

However, there is a actually single precision IEEE-754 FPU configuration available with MicroBlaze (V2P and later). See the MicroBlaze user guide for additional information.

 

bt

0 Kudos
Highlighted
Historian
Historian
8,394 Views
Registered: ‎02-25-2008

Re: Floating point data calculation time


zrh0913 wrote:

Thank you for your reply, any solutions except of using the fixed point data.

 

Best Regards,

Roy


bt's suggestion of using the floating-point core is a good one, EXCEPT: it's a REALLY HUGE core.

 

Most engineers avoid the use of floating-point arithmetic in architectures that do not support it in hardware. You might wish to use a Virtex4 or Virtex5 device which includes the hard PowerPC; that processor has a floating-point unit.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
8,389 Views
Registered: ‎08-13-2007

Re: Floating point data calculation time

It is also likely worth noting that the PPC FPUs are also implemented in fabric logic:

http://www.xilinx.com/products/ipcenter/apu_fpu.htm (APU Floating Point Unit)
http://www.xilinx.com/products/ipcenter/apu_fpu_virtex5.htm (Virtex-5 APU Floating Point Unit)
Granted, the Virtex devices are generally bigger (as well as faster and more $) than their Spartan counterparts so sometimes this is less of an issue.

 

There is the trade-off of resolution, performance, and device resource consumption when considering fixed vs floating point.

 

bt

0 Kudos
Highlighted
Historian
Historian
8,381 Views
Registered: ‎02-25-2008

Re: Floating point data calculation time


timpe wrote:

It is also likely worth noting that the PPC FPUs are also implemented in fabric logic:

http://www.xilinx.com/products/ipcenter/apu_fpu.htm (APU Floating Point Unit)
http://www.xilinx.com/products/ipcenter/apu_fpu_virtex5.htm (Virtex-5 APU Floating Point Unit)
Granted, the Virtex devices are generally bigger (as well as faster and more $) than their Spartan counterparts so sometimes this is less of an issue.

 

There is the trade-off of resolution, performance, and device resource consumption when considering fixed vs floating point.

 

bt


I stand corrected -- I haven't had a need for floating-point processing and I assumed that the PPC405 and PPC450 included a hardware FPU.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Observer
Observer
8,380 Views
Registered: ‎07-07-2009

Re: Floating point data calculation time

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 

As indicated, software implementation of floating point operations is much slower than fixed point due to the implementation differences in the operations.

However, there is a actually single precision IEEE-754 FPU configuration available with MicroBlaze (V2P and later). See the MicroBlaze user guide for additional information.

 

bt

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Thanks you for your reply, do i need any special core for IEEE-754 FPU, looks like it is already included in the MicroBlaze?

 

Best Regards,

Roy

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
8,375 Views
Registered: ‎08-13-2007

Re: Floating point data calculation time

I'll admit I'm not the FPU expert...

But unlike the PPC cores which use the APU port as an interface to another peripheral, the MicroBlaze option appears to be part of the processor and configured by the appropriate parameter (C_USE_FPU) in the mhs. I assume the compiler also needs to know this to target the single-precision to HW instructions instead of SW emulation.

 

BSB (Base System Builder) asks you if you want floating point when you initially configure the MicroBlaze project - that is probably the recommended flow. Note that you can create a new project and have it import the old .bsb as a starting point.

 

bt

0 Kudos
Highlighted
Observer
Observer
8,177 Views
Registered: ‎07-07-2009

Re: Floating point data calculation time

Based on the test, the FPU carried by the MICROBLAZE is not fast......

 

Will other FPU (Hardware) can improve the performance???

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
2,786 Views
Registered: ‎08-06-2007

Re: Floating point data calculation time

Hi,

 

MicroBlaze FPU is roughly 1000 LUTs which is not huge although it's not tiny either.

It only supports single-precision so if you use double-precision, you will not gain anything.

But with single-precision you get at 100x improvement in floating-point operations which is a substantial improvement.

 

Göran

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
2,774 Views
Registered: ‎04-23-2008

Re: Floating point data calculation time

If you've verified that your hardware system has the optional FPU, and that you are indeed using single precision (float data types, not double, sinf() style functions, not sin()) then try using -ffast-math and/or -fsingle-precision-constant compiler options.  This will speed things up at the cost of precision.  If _thats_ not enough, MicroBlaze is probably not the solution for you.

 

-Brian

 

0 Kudos