error message while using floating point package

Discussion in 'VHDL' started by kdas, Apr 18, 2008.

  1. kdas

    kdas

    Joined:
    Apr 17, 2008
    Messages:
    1
    Hi,

    I need to perform a division operation that can be synthesized in xilinx and the "/" operator works with unsigned, integer and float types but not with std_logic types. I have synthesized that successfully in a test code. However, I am getting error messages in the modelsim even though the signals were loaded correctly. The values that is shown initially seems to be garbage values for one of the signals that is s2 in the following code.

    library ieee, ieee_proposed;
    ---library ieee_proposed;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;
    --use ieee.std_logic_arith.all;
    use ieee_proposed.float_pkg.all;
    --use work.fphdl_base_pkg.all;
    entity divider is
    port(DI : in std_logic_vector(7 downto 0);
    DO1: out std_logic_vector(7 downto 0);
    DO : inout std_logic_vector(7 downto 0));
    end divider;
    architecture archi of divider is
    signal s1,s2: float(7 downto 0);----unsigned(7 downto 0);
    --signal s3: float;-----unsigned(3 downto 0);
    begin
    s1 <= to_float(DI,s1);
    s2 <= s1 / "0000101";
    DO <= std_logic_vector(to_unsigned(s2,8));
    ---s3 <= s2;
    DO1 <= std_logic_vector(to_unsigned(s2,8));

    end archi;
    ---v1 <= conv_std_logic_vector(u1, 4);


    I am also attaching themessages in modelsim and the error messages can be seen at the end

    # Reading C:/Modeltech_xe_starter/tcl/vsim/pref.tcl
    # do {divider.fdo}
    # ** Warning: (vlib-34) Library already exists at "work".
    # ** Warning: (vlib-34) Library already exists at "ieee_proposed".
    # Model Technology ModelSim XE III vcom 6.2g Compiler 2007.02 Feb 22 2007
    # -- Loading package standard
    # -- Loading package std_logic_1164
    # -- Loading package numeric_std
    # -- Loading package textio
    # -- Compiling package fixed_pkg
    # -- Loading package math_real
    # -- Loading package std_logic_textio
    # -- Compiling package body fixed_pkg
    # -- Loading package fixed_pkg
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/fixed_pkg_c.vhd(1298): Range 0 downto 1 is null.
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/fixed_pkg_c.vhd(1299): Range 0 downto 1 is null.
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/fixed_pkg_c.vhd(1300): Range 0 downto 1 is null.
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/fixed_pkg_c.vhd(6308): Range 2 to 1 is null.
    # ** Warning: (vlib-34) Library already exists at "ieee_proposed".
    # Model Technology ModelSim XE III vcom 6.2g Compiler 2007.02 Feb 22 2007
    # -- Loading package standard
    # -- Loading package std_logic_1164
    # -- Loading package numeric_std
    # -- Loading package textio
    # -- Loading package fixed_pkg
    # -- Compiling package float_pkg
    # -- Loading package math_real
    # -- Loading package std_logic_textio
    # -- Compiling package body float_pkg
    # -- Loading package float_pkg
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/float_pkg_c.vhd(913): Range 0 downto 1 is null.
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/float_pkg_c.vhd(914): Range 0 downto 1 is null.
    # ** Warning: [3] ../../../Xilinx9.2/vhdl/src/ieee_proposed/float_pkg_c.vhd(5592): Range 2 to 1 is null.
    # Model Technology ModelSim XE III vcom 6.2g Compiler 2007.02 Feb 22 2007
    # -- Loading package standard
    # -- Loading package std_logic_1164
    # -- Loading package numeric_std
    # -- Loading package textio
    # -- Loading package fixed_pkg
    # -- Loading package float_pkg
    # -- Compiling entity divider
    # -- Compiling architecture archi of divider
    # vsim -lib work -t 1ps divider
    # Loading C:\Modeltech_xe_starter\win32xoem/../std.standard
    # Loading C:\Modeltech_xe_starter\win32xoem/../ieee.std_logic_1164(body)
    # Loading C:\Modeltech_xe_starter\win32xoem/../ieee.numeric_std(body)
    # Loading C:\Modeltech_xe_starter\win32xoem/../std.textio(body)
    # Loading C:\Modeltech_xe_starter\win32xoem/../ieee.math_real(body)
    # Loading C:\Modeltech_xe_starter\win32xoem/../ieee.std_logic_textio(body)
    # Loading ieee_proposed.fixed_pkg(body)
    # Loading ieee_proposed.float_pkg(body)
    # Loading work.divider(archi)
    # .main_pane.mdi.interior.cs.vm.paneset.cli_0.wf.clip.cs.pw.wf
    # .main_pane.workspace.interior.cs.nb.canvas.notebook.cs.page2.cs
    # .main_pane.signals.interior.cs
    # ** Error: FLOAT_GENERIC_PKG.CLASS: Floating point number detected with a bad range
    # Time: 0 ps Iteration: 0 Instance: /divider
    # ** Error: FLOAT_GENERIC_PKG.CLASS: Floating point number detected with a bad range
    # Time: 0 ps Iteration: 0 Instance: /divider
    # ** Error: FLOAT_GENERIC_PKG: Unbounded number passed, was a literal used?
    # Time: 0 ps Iteration: 0 Instance: /divider
    # ** Error: FLOAT_GENERIC_PKG.CLASS: Floating point number detected with a bad range
    # Time: 0 ps Iteration: 1 Instance: /divider
    # ** Error: FLOAT_GENERIC_PKG.CLASS: Floating point number detected with a bad range
    # Time: 0 ps Iteration: 1 Instance: /divider

    Please help! Where is the error in the code?

    Thanks in advance.
    K.
    kdas, Apr 18, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. H aka N
    Replies:
    15
    Views:
    15,620
    Ben Jones
    Mar 2, 2006
  2. Motaz Saad
    Replies:
    7
    Views:
    6,461
  3. ravi81082@gmail.com

    Problem with using Floating Point Package

    ravi81082@gmail.com, Oct 30, 2006, in forum: VHDL
    Replies:
    0
    Views:
    504
    ravi81082@gmail.com
    Oct 30, 2006
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,298
    Saraswati lakki
    Jan 6, 2012
  5. teeshift
    Replies:
    2
    Views:
    242
    Chris Pearl
    Dec 1, 2006
Loading...

Share This Page