I'm trying to use the Mega Wizard Floating Point Divider Code in my project. The Quartos compilation was passed successfully, but it's failed in the Model Sim one. At the end of compilation there is an error message that talking about the syntax error in the Altera's automatically created code file that called "my project name_inst.vhd. As I know, it's impossible to make changes in IP files. How can i solve this problem? Thanks
Do I understand right, that the instance file name ends ".vhd(1)". This is unlikely to be accepted by Modelsim. It also means, that the error isn't inside the instance file.Nevertheless, at least the instance files are readable code. You can view it by just clicking on the instance in Quartus hierarchy browser if you're not aware of the file location.
I've found the solution, There is no necessity to create the ***_inst.vhd file by Mega Wizard. I had selected this file in addition to the default name.vhd file. All IP programs that related to FLOATING POINT cannot pass the compilation stage cause ***_inst.vhd file. It have to be unselected during the Mega Wizard file creating.Also,I would like to answer, how is it possible to convert decimal numbers to IEEE 754 single precision 32 bit vector? According to the information I read, the conversion can be implemented by IEEE function (float_pkg) by David Bishop And the second option is to use the library altera.mf? what can you suggest me to use? what is the better of? And the last one, how can I use it? what is the procedure needed for get the converted 32 bit vector that describes the decimal number?
The Float_pkg (actually the part of the VHDL2008 standard, the David Bishop version you refer to is a 93 compatible version) has no pipelining and is therefore not suitable for implementable designs.You need the ALTFP_CONVERT block from the megawizard (or instantiate it yourself) as several clock cycles are needed to convert from integer to floating point.
The ALTFP_CONVERT will convert fixed point or integer values (because they are basically the same thing) to floating point and vice versa.fixed point is just a human concept, and uses integer arithmatic, and requires no special IP blocks for arithmatic or conversion..