what causes this error?

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Code:
signal x : std_logic_vector ( 31 downto 0 ) ;
signal y : std_logic_vector ( 31 downto 0 ) ;
signal nibble: std_logic_vector ( 2 downto 0 ) ;

nibble <= x ( 30 downto 28 ) ;
y <= ( 30 downto 28 => nibble  , others => 'Z' ) ; -- compilation fails on this line
The above code fails compilation with the following error:
"Expression does not match type std_ulogic"

Why?
 

Vectors aggregate is only possible in vhdl 2008. In ealier versions u can aggregate only bits.

so
Code:
 y <= ( 30 => nibble(2)  , 29 => nibble(1), 28 => nibble(0), others => 'Z' ) ;
 
or instead write:

y(30 downto 28) <= nibble;
y(31) <= 'Z';
y(27 downto 0) <= (others => 'Z');
 
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
By the way is there any free vhdl enviroment that support vhdl 2008 with PSL commands ?. I know about AHDL and Questa but both are quite expensive
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…