Quoting [EMAIL PROTECTED]: > Hello all, Hi,
> > 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? The one in arch_foo2. > 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 Because arch_foo2.vhd and arch_foo1.vhd defines the same architecture (same name), the last one analyzed discards the previous one. > > what if I place those two architectures into one file > which one would be taken then for default? The last one. > is the default architecture choice tool specific behaviour? Not in this case. Tristan. _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
