Resolve multiple constant drivers for net Error

让人想犯罪 __ 提交于 2019-12-10 12:08:22

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!