使用整数递增永无止境的合成

时间:2012-12-17 11:15:33

标签: vhdl fpga synthesize

我有一段VHDL代码可以编译,但是当我尝试合成它时,我会陷入困境,这意味着合成永远不会结束,我在控制台中:

  

分析图书馆工作(架构)中的实体解释器。

我试图理解为什么,但我不能。我所知道的是,如果我对CPT_PAN <= CPT_PAN - 1;行进行评论,那么突然之间我就可以合成了。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity Interpretor is
    Port (SCAN_CODE : IN STD_LOGIC_VECTOR(7 downto 0));
end Interpretor;

architecture Behavioral of Interpretor is
Signal CPT_PAN : Integer range 0 to 255 := 0;
begin
process(SYS_CLK)
begin
if (SYS_CLK'EVENT and SYS_CLK = '1') then
    if SCAN_CODE = "01101011" then 
        if CPT_PAN /= 0 then    
            CPT_PAN <= CPT_PAN - 1; -- Line to be commented to synthesize
        end if;
    end if;
end if;
end process;     
end Behavioral;

1 个答案:

答案 0 :(得分:3)

哪种综合工具?知道它会很有用。

Xilinx XST 14.3只报告<sys_clk> is not declared.并退出。

为它添加一个输入端口,它正确合成,不产生任何硬件!

添加输出

entity Interpretor is
Port (
    SYS_CLK   : in std_logic;
    SCAN_CODE : IN STD_LOGIC_VECTOR(7 downto 0);
    Zero      : Out Boolean
 );
end Interpretor;

和架构的一行

Zero <= CPT_Pan = 0;

它会产生你想要的东西。自CPT_Pan初始化为0以来,它仍然优化为空,并且该过程根本不处理该情况。

我敢问你是否在尝试合成前模拟了这个?