2014-07-04 3 views
0

VHDL의 초보자이고 버튼을 눌러 7 세그먼트 디스플레이에 표시된 값을 증가시킬 수있는 무언가를 쓰려고했습니다. (각 디스플레이에 대한 버튼). 그것은 종합하고 생성하지만 경고와 함께 그리고 결국 보드의 버튼을 누르면 아무 일도 일어나지 않습니다. 여기에 내 경고 사항이 있습니다 :신호가 불완전하여 신호가 설계에서로드 핀을 구동하지 않음

경고 : PhysDesignRules : 367 - 신호가 불완전합니다. 신호 은 설계에서로드 핀을 구동하지 않습니다.

경고 : Par : 288 - 신호 B1_IBUF에는 부하가 없습니다. PAR은이 신호를 라우팅하지 않습니다. 물론

내가 이러한 솔루션 The signal <n1<1>_IBUF> is incomplete VHDL - PhysDesignRules:367

을 검토 한 결과 각 버튼 하나가 그러나 나는 그들을 이해할 수 없었다 아니면 그들은

물론 여기 정말 관련이없는 내 코드입니다 :

library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_ARITH.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 

-- Uncomment the following library declaration if using 
-- arithmetic functions with Signed or Unsigned values 
--use IEEE.NUMERIC_STD.ALL; 

-- Uncomment the following library declaration if instantiating 
-- any Xilinx primitives in this code. 
--library UNISIM; 
--use UNISIM.VComponents.all; 

entity top is 
Port (CLKIN : in std_logic; 
     B1 : in std_logic; --buttons 
     B2 : in std_logic; 
     B3 : in std_logic; 
     B4 : in std_logic;   
     AN3 : inout std_logic; --if the display is on or not 
    AN2 : inout std_logic; 
    AN1 : inout std_logic; 
    AN0 : inout std_logic; 
    LED : out std_logic_vector(6 downto 0)); --the logic vector to be used for each display 
end top; 

architecture Behavioral of top is 
signal CTR : STD_LOGIC_VECTOR(8 downto 0); 
signal LED0 : std_logic_vector(6 downto 0); -- since every display will have different     number I need for vectors 
signal LED1 : std_logic_vector(6 downto 0); 
signal LED2 : std_logic_vector(6 downto 0); 
signal LED3 : std_logic_vector(6 downto 0); 
shared variable int1 : integer range 0 to 11 :=0; --counter for each display 
shared variable int2 : integer range 0 to 11 := 0; 
shared variable int3 : integer range 0 to 11 := 0; 
shared variable int4 : integer range 0 to 11 := 0; 
begin 

--it does display these things! 
LED0 <= "1000000"; -- displaying 0 
LED1 <= "1000000"; 
LED2 <= "1000000"; 
LED3 <= "1000000"; 

-- button listener 
process(B1,B2,B3,B4) 
begin 
if(B1='1') then 
    int1:=int1+1; --when I press a button it increases the number 
    if (int1=10) then -- if it is more than 9 it should reset 
     int1:=0; 
    end if; 
elsif (B2='1') then 
    int2:=int2+1; 
    if (int2=10) then 
     int2:=0; 
    end if; 
elsif (B3='1') then 
    int3:=int3+1; 
    if (int3=10) then 
     int3:=0; 
    end if; 
elsif (B4='1') then 
    int4:=int4+1; 
    if (int4=10) then 
     int4:=0; 
    end if; 
end if; 


end process; 

    Process (CLKIN) 
    begin 
    case int1 is --all of these "case" s are for converting from integer to display vector 
when 0=> LED0 <="0000001"; -- '0' 
when 1=> LED0 <="1001111"; -- '1' 
when 2=> LED0 <="0010010"; -- '2' 
when 3=> LED0 <="0000110"; -- '3' 
when 4=> LED0 <="1001100"; -- '4' 
when 5=> LED0 <="0100100"; -- '5' 
when 6=> LED0 <="0100000"; -- '6' 
when 7=> LED0 <="0001111"; -- '7' 
when 8=> LED0 <="0000000"; -- '8' 
when 9=> LED0 <="0000100"; -- '9' 
when others=> LED0 <="1111111"; 
end case; 

case int2 is 
when 0=> LED1 <="0000001"; -- '0' 
when 1=> LED1 <="1001111"; -- '1' 
when 2=> LED1 <="0010010"; -- '2' 
when 3=> LED1 <="0000110"; -- '3' 
when 4=> LED1 <="1001100"; -- '4' 
when 5=> LED1 <="0100100"; -- '5' 
when 6=> LED1 <="0100000"; -- '6' 
when 7=> LED1 <="0001111"; -- '7' 
when 8=> LED1 <="0000000"; -- '8' 
when 9=> LED1 <="0000100"; -- '9' 
when others=> LED1 <="1111111"; 
end case; 

case int3 is 
when 0=> LED2 <="0000001"; -- '0' 
when 1=> LED2 <="1001111"; -- '1' 
when 2=> LED2 <="0010010"; -- '2' 
when 3=> LED2 <="0000110"; -- '3' 
when 4=> LED2 <="1001100"; -- '4' 
when 5=> LED2 <="0100100"; -- '5' 
when 6=> LED2 <="0100000"; -- '6' 
when 7=> LED2 <="0001111"; -- '7' 
when 8=> LED2 <="0000000"; -- '8' 
when 9=> LED2 <="0000100"; -- '9' 
when others=> LED2 <="1111111"; 
end case; 

case int4 is 
when 0=> LED3 <="0000001"; -- '0' 
when 1=> LED3 <="1001111"; -- '1' 
when 2=> LED3 <="0010010"; -- '2' 
when 3=> LED3 <="0000110"; -- '3' 
when 4=> LED3 <="1001100"; -- '4' 
when 5=> LED3 <="0100100"; -- '5' 
when 6=> LED3 <="0100000"; -- '6' 
when 7=> LED3 <="0001111"; -- '7' 
when 8=> LED3 <="0000000"; -- '8' 
when 9=> LED3 <="0000100"; -- '9' 
when others=> LED3 <="1111111"; 
end case; 
--this is the clock counter, this part works fine, I've tried it before 
if CLKIN'event and CLKIN = '1' then 
    if (CTR="000000000") then 
    if (AN0='0') then 
     AN0 <= '1';  
     LED <= LED0;    -- the letter n 
     AN1 <= '0'; 
    elsif (AN1='0') then 
     AN1 <= '1';   
     LED <= LED1;    -- the letter n 
     AN2 <= '0'; 
    elsif (AN2='0') then 
     AN2 <= '1';  
     LED <= LED2;    -- the letter A 
     AN3 <= '0'; 
    elsif (AN3='0') then 
     AN3 <= '1'; 
     LED <= LED3;    -- the letter E 
     AN0 <= '0'; 
    end if; 
    end if; 
    CTR<=CTR+"000000001"; 
    if (CTR > "100000000") then -- counter reaches 2^13 
    CTR<="000000000"; 
    end if; 
end if; 
    End Process; 
End Behavioral; 

내가 아주 간결 아니라고가 알고 있지만 내가 더 잘 얻을하려고합니다 :)

01 23,516,

여기 내 .ucf

NET "LED<0>" LOC = "L14"; 
NET "LED<1>" LOC = "H12"; 
NET "LED<2>" LOC = "N14"; 
NET "LED<3>" LOC = "N11"; 
NET "LED<4>" LOC = "P12"; 
NET "LED<5>" LOC = "L13"; 
NET "LED<6>" LOC = "M12"; 
NET "AN0" LOC ="F12"; 
NET "AN1" LOC ="J12"; 
NET "AN2" LOC ="M13"; 
NET "AN3" LOC ="K14"; 
NET "CLKIN" LOC ="B8"; 
NET "B1" LOC ="A7"; 
NET "B2" LOC ="M4"; 
NET "B3" LOC ="C11"; 
NET "B4" LOC ="G12"; 

덕분에!

답변

0

여기에 초기 상태가 확실하지 않습니다.

내가 본 것을 보면, 초기 상태에서 '0'과 동일한 AN0에서 AN3까지는 테스트가 없습니다. 결과적으로 LEDAN0에서 AN3까지 업데이트하는 블록이 실행되지 않으므로 신중하게 준비된 LED 상태는 사용되지 않으므로 출력에 영향을주지 않는 입력으로 다시 최적화됩니다.

이 단계에서 컴파일러는 왜 디자인에 영향을주지 않는 입력을 선언했는지 궁금합니다.

+0

신호 또는 변수를 초기화하지 않으면 자동으로 0 또는 null을 넣을 것이라고 생각했습니다. 또한 0000을 표시합니다. 변경할 수 없습니다. – Ege

+0

아니요. 이보다 더 나쁩니다. 이니셜 라이저는 시뮬레이션에서만 사용됩니다. 합성을 위해서는 명시 적 리셋 메커니즘이 필요합니다. –

관련 문제