Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

Fixed point

Altera_Forum
Honored Contributor II
1,528 Views

Hello all, 

 

I'm a beginner and have been reading up on how to implement fixed point in vhdl designs. I've downloaded the Altera package for fixed point from the eda stds website.  

 

The problem is, I'm having trouble going further. What must be done so that I can use the ufixed data types? nothing seems to be working. Do I need to make a library out of the downloaded files or do some sort of component instantiation?  

 

Thanks in advance.  

 

EDIT - I am using Quartus 9.1sp2
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
469 Views

I have included the following three files in my project folder: fixed_float_types_c.vhdl, fixed_pkg_c.vhdl, and float_pkg_c.vhdl.  

 

Then as my top level VHDL file I have the following headings:  

 

LIBRARY IEEE; 

USE IEEE.STD_LOGIC_1164.ALL; 

USE IEEE.NUMERIC_STD.ALL; 

 

LIBRARY WORK; 

USE WORK.fixed_pkg.ALL; 

 

ENTITY help IS 

...  

 

I get an error in quartus saying: 

design library "work" does not contain primary unit "fixed_pkg"  

 

Any help is greatly appreciated.
0 Kudos
Altera_Forum
Honored Contributor II
469 Views

Try this: 

 

library floatfixlib; 

use floatfixlib.fixed_pkg.all; 

 

But have you included the files in the project, rather than just put them in the project folder? Quartus doesnt have native support for them yet (hopefully soon) so you have to include them in your list of files included in each project.
0 Kudos
Altera_Forum
Honored Contributor II
469 Views

Actually including the files in Quartus worked, I was unaware that was necessary. Either library heading worked also, Thanks so much for the help.

0 Kudos
Reply