Package: ghdl
Version: 0.29+gcc4.3.4+dfsg-1
Severity: normal

--- Please enter the report below this line. ---

I found that during simulation, it is possible to convert -1 to an
unsigned without any error raised. Doing that with any number under -1
will make raise an error during simulation.

The following vhdl code shows the problem.

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

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity tb_test is end;

architecture arch_tb of tb_test is
   signal reset_s, clk_s : std_logic;
   signal i_s : integer := -1;
   signal j_s : integer := -2;
   -- Here, as it should, an error will be raised during compilation
   signal u_s : unsigned(7 downto 0) := to_unsigned(-1, 8);
   --
   signal v_s : unsigned(7 downto 0);
   signal w_s : unsigned(7 downto 0);
begin
   -- Here, as it should, a bound check failure will be raised during simulation
   w_s <= to_unsigned(j_s, 8);
   --
   -- Here it won't have any error during simulation, but it should
   v_s <= to_unsigned(i_s, 8);
   --
end architecture arch_tb;

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

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.32-5-686

Debian Release: squeeze/sid
  700 testing         ftp.ch.debian.org 
  600 unstable        ftp.ch.debian.org 
    1 experimental    ftp.ch.debian.org 

--- Package information. ---
Depends             (Version) | Installed
=============================-+-=============
libc6                (>= 2.7) | 2.11.1-3
libgcc1          (>= 1:4.1.1) | 1:4.4.4-4
libgmp3c2                     | 2:4.3.2+dfsg-1
libgnat-4.4      (>= 4.4.3-1) | 4.4.4-4
libmpfr1ldbl                  | 2.4.2-3
gnat-4.4                      | 4.4.4-4
zlib1g-dev                    | 1:1.2.3.4.dfsg-3


Recommends      (Version) | Installed
=========================-+-===========
gtkwave                   | 3.3.6-1


Package's Suggests field is empty.





--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to