0
votes

I'm trying to implement a linear programming problem on FPGA. I have used real data type to generate floating point numbers. The program compiled fine, but when I'm trying to synthesize it for my Xilinx Spartan-3E FPGA board it shows error that real is not supported by verilog. It seems that we cannot use real for synthesizable codes. So any suggestions on how to remove this error.

3
If you look at documentation, you will see that only integer data types are supported during synthesis. The real data type is only used for simulationStrikeskids
Is there a way by which I can have my FPGA working with floating point numbers, because otherwise it won't be of any use??user3185902

3 Answers

0
votes

While you can use floating point datatypes (reals) for your chip, but you need to instantiate an IP core for each operation that you want. Note that floating point arithmetic costs a lot of logic and time.

So: usually people switch to integer (or fixed-point) arithmetic when doing computations on FPGA.

0
votes

Some of the later Xilinx parts have dedicated DSP resources that can do floating point operations. The Spartan-3E, however, does not. The closest thing it has are dedicated multipliers (MULT18X18).

Your best bet is to devise an algorithm that works with the hardware you have available, as Philippe suggested.

It's also important to note that you must manually instantiate these components, as the synthesizers aren't smart enough to utilize these resources by themselves.

0
votes

Verilog supports the real variable. But none of the FPGA will support synthesis. You can following option do it.

  1. Represent your input as 32 bit binary with input should be given in IEEE-754 format. But you have to internally manipulate in the coding.
  2. Built your design with ip core based from core gen and arch. Wizard which will have the floating point based operations. But the logic utilization will be very high. So you have to go for higher end device.