I'm starting out in learning FPGA programming using Altera's Quartus package.
I have some legacy code that includes the following:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
library floatfixlib;
use floatfixlib.fixed_pkg.all; --this is the VHDL93 implementation of the VHDL08 fixed point code from http://www.eda-stds.org/fphdl/
use work.ioarrays.all;
Unfortunately the link in the comment is now dead.
Initially I had the following error:
Error (10481): VHDL Use Clause error at myvhdlfile.vhd(8): design library "floatfixlib" does not contain primary unit "fixed_pkg"
After reading around I used this answer to attribute the relevant ieee library files (fixed_float_types_c.vhdl
,fixed_pkg_c.vhdl
,float_pkg_c.vhdl
) to the ieee_proposed library and changed the code to this:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
library ieee_proposed;
use ieee_proposed.fixed_pkg.all;
use work.ioarrays.all;
which then appears to compile.
However, I'm not certain that this is the correct approach and my understanding of the high level story behind the development of these libraries is lacking.
Hence; Please describe the relationship between the ieee and floatfixlib vhdl libraries. A succinct description of the reason for their development, a brief timeline and their present status would be ideal.
The fphdl in the link stood for Floating-Point HDL Packages, available for both VHDL and Verilog and providing synthesis eligible packages for IEEE-754 standard for binary floating-point arithmetic.
The VHDL part of that effort submitted as proposal VHDL-200x-fp to add the packages to the next revision of the standard (IEEE Std 1076-2008).
The VHDL file names you quote indicate they come from from the -1993 compatibility distribution provided in lieu of wide spread -2008 revision adoption by synthesis vendors. The links to all the zip files are all dead while the VHDL source files for general -1993 compatible can be accessed on the Internet Archive fphdl link.
Originally you could access individual dated vendor targeted distributions that included README files that would tell you the purpose:
This is the "ieee_proposed" library. This is a compatability library, which is designed to provide all of the functionality of the VHDL-200X-FT packages in VHDL-93. The "_c" after the package name is used to denote that this is a 1993 compliant version of this package. Otherwise, the name of the file and the name of the package are the same.
Please compile the following files into a library named "ieee_proposed": standard_additions_c.vhdl
env_c.vhdl
standard_textio_additions_c.vhdl
std_logic_1164_additions.vhdl
numeric_std_additions.vhdl
numeric_std_unsigned_c.vhdl
fixed_pkg_c.vhdl
float_pkg_c.vhdl
The fixed and float packages were adopted into the -2008 revision, See IEEE Std 1076-2008 16.10 Fixed-point package and 16.11 Floating-point packge. They are included in library ieee. If you had -2008 compatible tools you could use those. Also see Annex G G.4 Using the fixed-point package.
In lieu of using VHDL tools that are compliant with revision -2008 containing in the this case package fixed_pkg you could compile these synthesis eligible sources into a library.
As you can see from Brian's and Jim's comments the packages could be targeted to a different resource library (including work) with a bit of tinkering with use clauses in the needed packages.
Starting around 2011 it was common for synthesis vendors to support these packages in library ieee_proposed providing VHDL synthesis eligible floating-point. Some number of vendors would provide pre-analyzed resource libraries.
If your code analyzes and elaborates referencing them in library ieee_proposed, you've either analyzed the packages into the library or they are provided by your vendor who may also offer -2008 compatibility where these packages are found in library ieee.
Failing that you can analyze the code into resource packages yourself. Stackoverflow has several questions demonstrating vendor specific difficulties doing so. Historically they tended to demonstrate VHDL -1993 language issues in vendor tools requiring workarounds. The good news is user demand for these features has helped drive -2008 feature uptake.
There are differences between in the compatibility distribution and -2008 based on availability of features such as package generics. The compatibility package also provides more than just fixed and floating-point binary arithmetic, the idea being to support -2008 compatibility with -1993 capable tools.
The loss of readily available history is the result of Accellera's recent discontinued hosting the vhd.org/eda.org websites. Accellera originally developed a -2006 revision of the VHDL standard under their auspices, which after various changes become the IEEE -2008 standard revision.