解决多个常量驱动程序以解决净错误 [英] Resolve multiple constant drivers for net Error

查看:140
本文介绍了解决多个常量驱动程序以解决净错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实有以下VHDL代码示例:

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;

编译后,我收到以下错误消息:错误(10028):无法解决多个错误Test.vhd(28)上的网 UserLed [0]的常量驱动程序

After compiling I get following error message: Error (10028): Can't resolve multiple constant drivers for net "UserLed[0]" at Test.vhd(28)

我发现的是, UserLed( 0)< ='0'; 给出了问题,但我不完全理解为什么,因为我没有在其他地方使用过UserLed信号。看来这里是一个简单的问题 ...

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...

预先感谢!

推荐答案

您需要引入本地信号,以便重新组装LED导线:

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;

这篇关于解决多个常量驱动程序以解决净错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆