无法推断注册" RunStop"因为它的行为与任何支持的寄存器模型都不匹配(Quartus II)

时间:2016-05-22 13:34:54

标签: vhdl

错误:10821,10822 ......还有更多..请帮助..(单独模块)

  

错误(10821):AxisCounter.vhd(48)的HDL错误:无法推断注册" RunStop"因为它的行为与任何支持的寄存器模型都不匹配
  错误(10821):AxisCounter.vhd(39)的HDL错误:无法推断注册" RunStop"因为它的行为与任何支持的寄存器模型都不匹配
  错误(10821):AxisCounter.vhd(38)的HDL错误:无法推断注册" RunStop"因为它的行为与任何支持的寄存器模型都不匹配
  错误(10822):AxisCounter.vhd(35)处的HDL错误:无法在此时钟边沿上为分配实现寄存器
  错误(10822):AxisCounter.vhd(38)处的HDL错误:无法在此时钟边沿上为分配实现寄存器
  错误(12152):无法详细说明用户层次结构" AxisCounter:\ Check:0:AxisCounter_X"
  错误:Quartus II 64位分析&合成不成功。 6个错误,9个警告
      错误:峰值虚拟内存:486兆字节
      错误:处理已结束:Sun May 22 18:19:32 2016
      错误:经过时间:00:00:01
      错误:总CPU时间(在所有处理器上):00:00:01
      错误(293001):Quartus II完全编译失败。 8个错误,9个警告

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


entity AxisCounter is
    Port ( 
              BASECLK_IN      :  in   STD_LOGIC;
             START_STOP     :  in   STD_LOGIC;
             RESET_COUNT        :  in   STD_LOGIC;
              DIVISOR           :  in   Integer ;
              STEPS             :  in   Integer ;
             COUNT_STATUS   :  out  STD_LOGIC;
           AXISCLK_OUT      :  out  STD_LOGIC ;
              STEPSOVER         :  out  Integer);
end AxisCounter ;

architecture Behavioral of AxisCounter is
-- signals, variables and constants
   signal cnt_r         : Integer := 0 ;
   signal steps_r   : Integer := 0 ;
   signal blink_o   : std_logic := '0' ;
   signal RunStop   : std_logic := '1' ;
   --signal Compare1    : Integer := 75000000;  -- 1000000 ;
   --signal Steps1     : Integer := 12 ;

begin

  process(BASECLK_IN,RESET_COUNT,START_STOP) 
  begin
     if (START_STOP' event and START_STOP = '1') then
        RunStop <= '1';
     end if ;
    if rising_edge(BASECLK_IN) then
        if (RESET_COUNT = '0') then
            steps_r <= 0 ;
            cnt_r   <= DIVISOR ;
       elsif (RunStop = '1')then -- counter enabled
           cnt_r <= cnt_r - 1;
            if (cnt_r > (DIVISOR/2)) then
                blink_o <= '1' ;
            else
                blink_o <= '0' ;
                if (cnt_r = 0) then
                    steps_r <= steps_r + 1 ;
                    STEPSOVER <= steps_r ;
                    if (steps_r = STEPS) then
                        RunStop <= '0' ;
                    else
                        cnt_r <= DIVISOR ;
                    end if ;
                end if ;
            end if ;
        else
            blink_o <= '0' ;
        end if ;
    end if ;
  end process;


  AXISCLK_OUT <= blink_o ;
  COUNT_STATUS <= RunStop ;

end Behavioral;

1 个答案:

答案 0 :(得分:0)

你要问的是为RunStop创建一个触发器,它必须由两个不同的时钟信号计时:BASECLK_IN和START_STOP

此问题有多种解决方案:

  1. 您可以定义RunStop的行为,使其不再由两个来源计时

  2. 创建两个版本的RunStop,每个时钟1个,并在稍后组合它们(异步)。