问题
I do have following VHDL code example:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY work;
ENTITY Test IS
PORT
( Nios_Reset_n : IN STD_LOGIC;
UserLed : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)
);
END Test;
ARCHITECTURE bdf_type OF Test IS
COMPONENT misc
PORT( reset_reset_n : IN STD_LOGIC;
userleds_external_connection_export : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)
);
END COMPONENT;
BEGIN
b2v_M1 : misc
PORT MAP( reset_reset_n => Nios_Reset_n,
userleds_external_connection_export => UserLed);
UserLed(0) <= '0';
END bdf_type;
After compiling I get following error message: Error (10028): Can't resolve multiple constant drivers for net "UserLed[0]" at Test.vhd(28)
What I figured out is, that the line UserLed(0) <= '0'; gives the problem but I do not fully understand why because I have not used the signal UserLed elsewhere. It looks like an easy 'problem' here...
Thanks in advance!
回答1:
You'll need to introduce a local signal, so you can reassemble the LED wires:
architecture bdf_type of Test is
signal misc_leds : STD_LOGIC_VECTOR(4 downto 0);
component misc
port (
reset_reset_n : IN STD_LOGIC;
userleds_external_connection_export : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)
);
end component;
begin
b2v_M1 : misc
port map (
reset_reset_n => Nios_Reset_n,
userleds_external_connection_export => misc_leds
);
UserLed(0) <= '0';
UserLed(4 downto 1) <= misc_leds(4 downto 1);
end architecture;
来源:https://stackoverflow.com/questions/33122276/resolve-multiple-constant-drivers-for-net-error