Forum Discussion
Floating point divider - compilation error
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
11 Replies
- Altera_Forum
Honored Contributor
what's the error?
- Altera_Forum
Honored Contributor
you didnt write much about the error.... just guessing; are you using vlog for compilation or vcom?
- Altera_Forum
Honored Contributor
It's not impossible to edit instance files, just not suggested. But you can instantiate the fp_divider in your own code if you know what you're doing.
- Altera_Forum
Honored Contributor
The error is : ".......link to the file......../Floating_Point_M_W_inst.vhd(1):
near "Floating_Point_M_W_i" : syntax error " - Altera_Forum
Honored Contributor
Floating_Point_M_W - the project's name
- Altera_Forum
Honored Contributor
Is it possible to see the content of Altera's IP codes?
- Altera_Forum
Honored Contributor
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. - Altera_Forum
Honored Contributor
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? - Altera_Forum
Honored Contributor
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. - Altera_Forum
Honored Contributor
Thanks a lot.
This conversion function is only for floating point? Is it possible to convert to fixed point?