2015-10-14 25 views
0

多个固定驱动器我有以下VHDL代码示例:错误(10028):解决净误差

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; 

编译我获得以下错误消息后无法解析净多不断驱动程序“UserLed [0]“at Test.vhd(28)

我发现的是,该行UserLed(0)< ='0';给出了这个问题,但我不完全明白为什么,因为我没有在别处使用过UserLed的信号。它看起来像一个简单的'问题'在这里...

在此先感谢!

+0

你已经使用'UserLed':在端口映射。 –

回答

1

你需要引入一个本地信号,这样你就可以重新组装LED导线:别处

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; 
+0

好的,但是引入本地信号“misc_leds”的原因是什么?您还将端口映射从** UserLed **更改为** misc_leds **。为什么我的例子不起作用? – Norick

+0

为什么行** UserLed(4 downto 1)<= misc_leds(4 downto 1); **如果我只想设置** UserLed(0)**? – Norick

+0

您正在双向分配led矢量的位0。所以这个工具会抱怨有2个驱动程序:misc和'0'。我的解决方案将所有值存储在中间信号中,并将位4..1分配给输出。位0直接分配。所以misc的第0位是'浮动'/未使用。 – Paebbels