Mam zdefiniowane dwa komponenty w VHDL'u (prawie identyczne, to tylko przykład):
-------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity U1 is
port(a,b:in std_logic;q:out std_logic);
end entity U1;
architecture behavior of U1 is
begin
q<=a when b='1' else 'Z';
end architecture behavior;
------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity U2 is
port(a,b:in std_logic;q:out std_logic);
end entity U2;
architecture behavior of U2 is
begin
q<=a when b='1' else 'Z';
end architecture behavior;
-------------------------------------
I teraz chcialem ich wyjścia podłączyć do jednej magistrali. Nie powinno być problemu, bo jeśli jedno będzie wysterowane, to na drugim będzie wysoka impedancja.
No więc wklepałem takie coś:
--------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity test is
port(We:in std_logic;szyna:out std_logic);
end entity test;
architecture behavior of test3 is
component U1 is
port(a,b:in std_logic;q:out std_logic);
end component U1;
component U2 is
port(a,b:in std_logic;q:out std_logic);
end component U2;
signal B:std_logic;
begin
B<='0'; --czyli na obu wyjściach 'Z'
U_1:U1 port map (We,B,Szyna);
U_2:U2 port map (We,B,Szyna);
end architecture behavior;
-------------------------------------
I niestety

Natomiast Xilinx WebPack kompiluje ten kod bez problemu, informując (warning) o tym podwójnym źródle.
Jak ten problem rozwiązać?