이것은 내가 물었던 별도의 질문에서 벗어났습니다. 나는 내가하고 싶은 일과 좋아하지 않는 것에 대해 더 깊이 설명 할 것이다. 이것은 학교 프로젝트이므로 표준을 따를 필요가 없습니다.편집 - 동작이 지원되는 레지스터 모델과 일치하지 않으므로 등록을 유추 할 수 없습니다. VHDL
나는 SIMON 게임을 만들려고합니다. 바로 지금, 내가하려고하는 것은 레벨을위한 스위치 케이스를 사용하고 각 레벨은 더 빠름 (따라서 다른 주파수 디바이더)으로되어있다. 첫 번째 레벨은 첫 번째 주파수로 가정되고 LED의 패턴은 밝아지고 사라지게됩니다. 스위치 케이스에 넣기 전에, 첫 번째 레벨은 그 자체로 (두 번째 수준의 물건이 없었습니다) 켜져 있어야하고 사라져야하는 것처럼 사라졌습니다. 또한 출력을 입력과 비교하기 위해 compare = 0
을 사용했습니다. (사용자는 그들이 본 조명 패턴으로 스위치를 뒤집어 놓기로되어있다.) 이것은 첫 번째 레벨이 그 자체 일 때 작동했지만 스위치가 된 지금은 compare
을 좋아하지 않습니다. 나는 출력을 입력과 비교하기 위해 그것을 어떻게 극복해야할지 모르겠습니다.
가 오류 (10821) : FP.vhd에서 HDL 오류가 (75) : 추론 할 수없는 것은 그 행동이 일치하지 않기 때문에 "비교"에 등록 어떤 지원 내가 얻고
오류는 이전과 비슷합니다 모델 등록
오류 (10821) : FP.vhd에서 HDL 오류 (75) : 추론 할 수없는 것은 "계산 [0]"그 동작이 지원되는 모든 레지스터 모델과 일치하지 않기 때문에
오류에 등록 (10821) : FP.vhd (75)의 HDL 오류 : 해당 동작이 지원되는 레지스터 모델과 일치하지 않기 때문에 "count [1]"에 대한 레지스터를 추론 할 수 없습니다.
,451,515,오류 (10821) : FP.vhd에서 HDL 오류 (75) : HDL : 추론 할 수없는 것은 "계산은 [2]"그 동작이 지원되는 모든 레지스터 모델과 일치하지 않기 때문에
오류 (10822)에 등록 FP.vhd (80)에서 오류가 발생했습니다 :이 클럭 에지에서 할당을위한 레지스터를 구현할 수 없습니다.
오류 (10822) : FP.vhd (102)에서의 HDL 오류 :이 클럭 에지에서 할당을위한 레지스터를 구현할 수 없습니다.
는 (12153)는오류를 : 최상위 사용자 계층에게
정교한 수 없습니다 나는 또한 d를 이해 oesn't는 rising_edge(toggle)
를 좋아한다. 그러나 나는 그것이 LED 패턴을 밝게하고 사라지게하기 위해 그것을 필요로한다.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
entity FP is
port(
clk, reset : in std_logic;
QF : out std_logic_vector (3 downto 0);
checkbtn : in std_logic;
Switch : in std_logic_vector(3 downto 0);
sel : in std_logic_vector (1 downto 0);
score : out std_logic_vector (6 downto 0)
);
end FP;
architecture behavior of FP is
signal time_count: integer:=0;
signal toggle : std_logic;
signal toggle1 : std_logic;
signal count : std_logic_vector (2 downto 0);
signal seg : std_logic_vector (3 downto 0);
signal compare : integer range 0 to 1:=0;
type STATE_TYPE is (level1, level2);
signal level : STATE_TYPE;
--signal input : std_logic_vector (3 downto 0);
--signal sev : std_logic_vector (6 downto 0);
begin
process (clk, reset, sel)
begin
if (reset = '0') then
time_count <= 0;
toggle <= '0';
elsif rising_edge (clk) then
case sel is
when "00" =>
if (time_count = 1249999) then
toggle <= not toggle;
time_count <= 0;
else
time_count <= time_count+1;
end if;
when "01" =>
if (time_count = 2499999) then
toggle1 <= not toggle1;
time_count <= 0;
else
time_count <= time_count+1;
end if;
when "10" =>
if (time_count = 4999999) then
toggle <= not toggle;
time_count <= 0;
else
time_count <= time_count+1;
end if;
when "11" =>
if (time_count = 12499999) then
toggle <= not toggle;
time_count <= 0;
else
time_count <= time_count+1;
end if;
end case;
end if;
end process;
Process (toggle, compare, switch)
begin
case level is
when level1 =>
if sel = "00" then
count <= "001";
seg <= "1000";
elsif (rising_edge (toggle)) then
count <= "001";
compare <= 0;
if (count = "001") then
count <= "000";
else
count <= "000";
end if;
end if;
if (switch = "1000") and (compare = 0) and (checkbtn <= '0') then
score <= "1111001";
level <= level2;
else
score <= "1000000";
level <= level1;
end if;
when level2 =>
if sel = "01" then
count <= "010";
seg <= "0100";
elsif (rising_edge (toggle1)) then
count <= "010";
compare <= 1;
if (count = "010") then
count <= "000";
else
count <= "000";
end if;
end if;
if (switch = "0100") and (compare = 1) and (checkbtn <= '0') then
score <= "0100100";
else
score <= "1000000";
level <= level1;
end if;
end case;
case count is
when "000"=>seg<="0000";
when "001"=>seg<="1000";
when "010"=>seg<="0100";
when "011"=>seg<="0110";
when "100"=>seg<="0011";
when others=>seg<="0000";
end case;
end process;
QF <= seg;
end behavior;
다시 한번 감사드립니다.
이전 편집에서 레이아웃을 수정했지만 되돌릴 수는 있습니다 ... 왜 그런 짓을했는지 모르겠지만, 이것은 내 시간 낭비입니다 ... – JHBonarius
이전에 약간 다르기 때문에 제 질문을 편집했습니다. . 나는 또 다른 질문을 썼다. 그러나 나는 그렇게 했으므로 나의 오래된 것을 편집하도록 요청 받았다. 죄송합니다 – KC1
아, 그냥 코멘트 할 수있는 능력을 얻으 십시요 :) 그래서 나는 너의 포스트를 편집했다. 적절하게 의도 된 코드를 갖는 것이 매우 중요합니다. 조만간 내 대답을 편집 할 것입니다. – Staszek