When I try to compile the following code

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

entity test is
    port(
        x: in std_logic_vector(31 downto 0)
    );
end;

architecture first of test is
begin
    assert x/="00000000000000000000000000000000"
    report "Oops"
    severity failure;
end;


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

entity inst is
end;

architecture first of inst is
signal p: std_logic:='1';
begin
    r: entity work.test port map (
        x(31 downto 1)=>"0000000000000000000000000000000",
        x(0)=>p
    );
end;
------------------------

I get the error message:

test_vector.vhd:30:25: string length does not match that of the anonymous 
integer subtype defined at test_vector.vhd:7:35
test_vector.vhd:30:10: actual length does not match formal length
ghdl: compilation error

But I don't really understand why this is an error, since changing the
"0..."  to (others=>'0') works fine (but doesn't in modelsim)

greetings,

Mark van Doesburg

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to