2015-10-15 37 views
0

這裏有一個簡單的代碼,它解決了編譯器無法爲網絡「led_int [0]」解析多個常量驅動程序的問題。VHDL內部信號聲明給出了驅動程序錯誤

architecture bdf_type of Test is 
    signal led_int : 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 => led_int 
    ); 

    led_int(0) <= '0'; 
    UserLed <= led_int; 
end architecture; 

爲什麼我得到同樣的錯誤消息,但這裏錯誤(10028):無法解析淨 「led_int [0]」 在Test.vhd(11)多個恆定的驅動程序?

我該如何解決這個簡單的問題?

+2

可能重複[解決多個常量驅動程序的網絡錯誤](http://stackoverflow.com/questions/33122276/resolve-multiple-constant-drivers-for-net-error) – Paebbels

回答

0

您有兩個led_in(0)信號驅動程序。

led_int(0) <= '0';不斷拉低它,userleds_external_connection_export => led_int根據雜項模塊中的內容將其拉高或拉低。

你不允許在vhdl中有一個信號的驅動程序。如果你不需要兩個驅動程序,你需要在它們之間有一些邏輯 - 例如or門,and門,多路複用器或類似的。