R
Ralf Hildebrandt
Guest
Hi!
I have noticed a strange behavior in my (very old (1997?)) Cadence
Leapfrog with the following code:
-------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL,IEEE.Numeric_STD.ALL;
entity foobar is
end foobar;
architecture behavior of foobar is
constant bitwidth : integer:=6;
-- errors if one of the following lines is uncommented
--constant const : std_ulogic_vector(bitwidth-1 downto 0):=
std_ulogic_vector(to_unsigned(16#0A#,bitwidth));
--constant const : std_ulogic_vector(5 downto 0):=(others=>'0');
-- no error, if this is used
constant const : std_ulogic_vector(5 downto 0):="001001";
signal sig : std_ulogic_vector(bitwidth-1 downto 0);
begin
process
begin
case sig is
when const => assert false report "test!" severity error;
when others => null;
end case;
end process;
end behavior;
-------------
The error message is:
when const => assert false report "test!" severity error;
|
duluth: *E,380 (/folder/testfile.vhd,19): expecting a locally static
expression of type STD_ULOGIC_VECTOR and length 6 [8.7].
So my question is: Why do I get these errors, if I use one of the
uncommented constant definitions? The constant const is always locally
static.
(Note, that even the error message of my Leapfrog is errogenous: [8.7]
ist the chapter in the LRM, that deals with the if-statement, [8.8] is
for case.)
The commented definitions would be more handy - especially, the 1st one,
because then I could easily change the bitwidth.
Thanks!
Ralf
I have noticed a strange behavior in my (very old (1997?)) Cadence
Leapfrog with the following code:
-------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL,IEEE.Numeric_STD.ALL;
entity foobar is
end foobar;
architecture behavior of foobar is
constant bitwidth : integer:=6;
-- errors if one of the following lines is uncommented
--constant const : std_ulogic_vector(bitwidth-1 downto 0):=
std_ulogic_vector(to_unsigned(16#0A#,bitwidth));
--constant const : std_ulogic_vector(5 downto 0):=(others=>'0');
-- no error, if this is used
constant const : std_ulogic_vector(5 downto 0):="001001";
signal sig : std_ulogic_vector(bitwidth-1 downto 0);
begin
process
begin
case sig is
when const => assert false report "test!" severity error;
when others => null;
end case;
end process;
end behavior;
-------------
The error message is:
when const => assert false report "test!" severity error;
|
duluth: *E,380 (/folder/testfile.vhd,19): expecting a locally static
expression of type STD_ULOGIC_VECTOR and length 6 [8.7].
So my question is: Why do I get these errors, if I use one of the
uncommented constant definitions? The constant const is always locally
static.
(Note, that even the error message of my Leapfrog is errogenous: [8.7]
ist the chapter in the LRM, that deals with the if-statement, [8.8] is
for case.)
The commented definitions would be more handy - especially, the 1st one,
because then I could easily change the bitwidth.
Thanks!
Ralf