這是完整的代碼不能推斷出的Quartus II(VHDL)註冊
library ieee;
use ieee.std_logic_1164.all;
entity move_key_detector is
PORT(
clk : IN STD_LOGIC;
done : IN STD_LOGIC;
hex : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
up, down : out std_logic
);
END move_key_detector;
architecture arch of move_key_detector is
type statetype is (IDLE, RECEIVED_BREAK);
signal next_state, current_state : statetype :=IDLE;
begin
process (Clk) begin
if(rising_edge(Clk)) then
current_state <= next_state;
end if;
end process;
process(done) begin
next_state <= current_state;
case current_state is
when IDLE=>
if(done = '1') then
if (hex = "00011101") then up <= '1';
elsif(hex = "00011011") then down <= '1';
--check to see if a break code is sent
elsif (hex = "11110000") then next_state <= RECEIVED_BREAK;
end if;
end if;
when RECEIVED_BREAK=>
if(done ='1') then
if (hex = "00011101") then up <= '0';
elsif(hex="00011011") then down <= '0';
end if;
next_state <= IDLE;
end if;
end case;
end process;
的錯誤是:
錯誤(10821):在move_key_detector.vhd HDL錯誤(31) :不能推斷註冊「向下」,因爲其行爲不符合任何支持寄存器模型
信息(10041):推斷爲鎖「向下」在move_key_detector.vhd(29)
錯誤(10821):move_key_detector.vhd(31)處的HDL錯誤:無法推斷「up」寄存器,因爲其行爲與任何支持的寄存器模型不匹配
Info(10041):推斷「up」在move_key_detector.vhd(29)
錯誤(10818):無法推斷在move_key_detector.vhd(41)註冊 「next_state」,因爲它不保持時鐘邊沿以外的值
誤差(10818 ):無法在move_key_detector.vhd(33)推斷「next_state」的寄存器,因爲它在時鐘邊緣外不保持其值。
我一直在收到這種錯誤。我遵循這個recommendation,閱讀HDL手冊,我仍然不知道如何解決這個問題。
任何人都可以幫助我嗎?非常感謝你!