错误(10536):VHDL循环语句计数错误.vhd(25):循环必须在10,000次迭代中终止

时间:2018-12-25 15:06:27

标签: vhdl quartus

我正在尝试使用while循环制作一部电梯。但是我不断收到相同的循环错误

  library ieee;
 use ieee.std_logic_1164.all;
use work.all;

use IEEE.STD_LOGIC_UNSIGNED.ALL;
 entity counts is
Port ( CLK : in  STD_LOGIC;     -- input clock
      S,NF : in  STD_LOGIC_VECTOR (2 downto 0);
          RESET: in STD_LOGIC;
          Output : out  STD_LOGIC_VECTOR (2 downto 0));    
 end counts;

   architecture Behavioral of counts is
signal count: STD_LOGIC_VECTOR (2 downto 0):="000";
begin


process (CLK, RESET,NF)
     begin
 if (RESET = '1') then
   count <= "000";
    elsif (CLK'Event and CLK = '1' and RESET = '0') then
       if (S < NF and S > "000") then
          count <= S;
countup: while (count < NF and NF <= "111" ) loop
 count <= count + '1';
 Output <=  count;
 end loop countup;

       elsif (S > NF and S > "111") then  
 count <= S;
countdown: while (count > NF and NF >= "000") loop
 count <= count - '1';
 Output <=  count;
  end loop countdown;
  else 
 count <= S;
        end if;
    end if;
end process;

-- display count
Output <=  count;

end Behavioral;   

我不知道为什么我总是收到此错误,但这是阻碍我项目的唯一错误。错误如下所示。

错误(10536):VHDL循环语句计数错误。vhd(25):循环必须在10,000次迭代内终止

0 个答案:

没有答案