Hello all,

given the following case

-- file entity_foo.vhd
entity foo is
    port(a,b:in bit; z: out bit);
end;

-- file arch_foo1.vhd
architecture foo1 of foo is
begin
    z <= a xor b;
end;

-- file arch_foo2.vhd
architecture foo1 of foo is
begin
    process begin
        wait on a,b;
        z <= a xor b;
    end process;
end;

I do compile them into lib_foo with

ghdl -a --work=lib_foo entity_foo.vhd
ghdl -a --work=lib_foo arch_foo1.vhd
ghdl -a --work=lib_foo arch_foo2.vhd

when I use this entity from other file

-- file user.vhd
entity main is end;
architecture main of main is
   signal x,y,z: bit;
begin
   foo1: entity foo port map(a=>x,b=>y,z=>z);
end;

which architecture is actually used?
would the sequence of analizing the architectures
change the choice?
ghdl -a --work=lib_foo arch_foo2.vhd
ghdl -a --work=lib_foo arch_foo1.vhd

what if I place those two architectures into one file
which one would be taken then for default?

is the default architecture choice tool specific behaviour?

Thanks in advance

Regards, Daniel

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

Reply via email to