error message while using floating point package

Joined
Apr 17, 2008
Messages
1
Reaction score
0
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top