Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

floating point operating in vhdl (fixed_pkg)

Hi all;

I have write a code using fixed_pkg. It compile successfully in quartus, but when I try to simulate in ModelSim an error occur.

---------------------------------------------------------------------------------------------------------------

library ieee;

library ieee_proposed;

use work.fixed_pkg.all;

use ieee.numeric_std.all;

entity fix is

port (clk: in bit;

nprev: in integer range -127 to 127;

ip1: out ufixed (8 downto -9));

end fix;

architecture fix of fix is

signal n1: ufixed (4 downto -4);

begin

process(clk)

begin

if (clk'event and clk='1') then

ip1 <= (to_ufixed(0.483,n1)) * (to_ufixed(11,n1));

end if;

end process;

end fix;

----------------------------------------------------------------------------------------------

This is the error in ModelSim:# Compile of fix.vhd failed with 2 errors.# Compile of fix_tb.vhd failed with 2 errors.# Compile of fixed_float_types_c.vhdl was successful.# Compile of fixed_pkg_c.vhdl failed with 1 errors.# Compile of fixed_synth.vhdl failed with 2 errors.

This the error when I expand it:

** Error: H:/altera/mul_try_tb/fix_tb.vhd(2): Library ieee_proposed not found.

I have add all the fixed_pkg in the project (in quartus). Need your helps..

17 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    if you just run vcom it will add it to the work libarary. To add a file to the specific library, you need the -work option

    vcom fixed_float_types_c.vhdl -work ieee_proposed

    vcom fixed_pkg_c.vhdl -work ieee_proposed
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I write in the modelsim command window for create the ieee_proposed;

    vlib ieee_propose

    vcom vcom fixed_float_types_c.vhdl

    vcom fixed_pkg_c.vhdl

    There are no error for line 1 and 2. But, in line 3 this error occur:# ** Error: (vcom-11) Could not find ieee_proposed.fixed_float_types.# ** Error: fixed_pkg_c.vhdl(23): (vcom-1195) Cannot find expanded name "ieee_proposed.fixed_float_types".# ** Error: fixed_pkg_c.vhdl(23): Unknown expanded name.# ** Error: fixed_pkg_c.vhdl(25): VHDL Compiler exiting# C:/altera/10.1/modelsim_ase/win32aloem/vcom failed.

    What my false?..thanks for reply
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    on the modelsim command window (or in a tcl or do file):

    vlib floatfixlib

    vcom fixed_float_types_c.vhdl -work floatfixlib

    vcom fixed_pkg_c.vhdl -work floatfixlib

    etc.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    How to create the floatfixlib? Do you have any other idea for avoid the error..

    thanks for reply
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you will need to create the floatfixlib, as I dont think the starter edition ships with it.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I use ModelSim Altera Starter Edition 6.6d..After I remove the ieee_proposed library, this error occur in ModelSim:

    ** Error: H:/altera/mul_try_tb/fix.vhd(3): Library floatfixlib not found.

    ** Error: H:/altera/mul_try_tb/fix.vhd(4): (vcom-1136) Unknown identifier "floatfixlib".

    Thanks for reply
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    what version of modelsim?

    newer versions of modelsim have the fixed_pkg in the floatfixlib library, so I would delete all references to ieee_proposed and the fixed_pkg in the work library.