Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
768 Views

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

0 Kudos
11 Replies
Altera_Forum
Honored Contributor I
50 Views

what's the error?

Altera_Forum
Honored Contributor I
50 Views

you didnt write much about the error.... just guessing; are you using vlog for compilation or vcom?

Altera_Forum
Honored Contributor I
50 Views

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 I
50 Views

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 I
50 Views

Floating_Point_M_W - the project's name

Altera_Forum
Honored Contributor I
50 Views

Is it possible to see the content of Altera's IP codes?

Altera_Forum
Honored Contributor I
50 Views

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
50 Views

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 I
50 Views

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 I
50 Views

Thanks a lot. 

This conversion function is only for floating point? 

Is it possible to convert to fixed point?
Altera_Forum
Honored Contributor I
50 Views

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..
Reply