【问题标题】:VHDL-“Signal cannot be synthesized, bad synchronous description” [duplicate]VHDL-“信号无法合成,同步描述错误” [重复]
【发布时间】:2018-01-18 08:01:44
【问题描述】:

在 Xilinx 中合成此代码时出现错误。这个错误是: "信号 Z_1 无法合成,同步描述错误"

entity uk3 is
     port(
         rst : in BIT;
         C : in INTEGER;
         clk : in BIT;
         S : out INTEGER
         );
end uk3;

--}} End of automatically maintained section

architecture uk3 of uk3 is
begin
    process (C,clk,rst)
    variable Z_1 : integer:=0;
    begin
        if rst='1' then Z_1:=0;
        elsif rst='0'and clk'event and clk='1'and C=1
            then 
            Z_1:=Z_1 + 1;
        elsif rst='0'and clk'event and clk='1'and C=2
            then
            Z_1:=Z_1 + 2;   
        else
            Z_1:=Z_1;
        end if;
        S<=Z_1;
        end process;

     -- enter your statements here --

end uk3;

为什么?请

【问题讨论】:

  • 同一个问题不要问两次。

标签: vhdl active-hdl


【解决方案1】:

您可能应该正确描述您的同步过程。这不是 c/c++,你应该使用适当的模板,否则它不会合成。特别是,您应该只有一个对时钟边缘敏感的语句。

例如:

process (clk,rst)
variable Z_1 : integer:=0;
begin
    if rst='1' then 
        Z_1:=0;
    elsif rising_edge(clk) then
        case C is
            when 1 =>
                Z_1:=Z_1 + 1;
            when 2 => 
                Z_1:=Z_1 + 2;
            when others =>
                null;
        end case;
        S<=Z_1;
    end if;

end process;

注意,敏感度列表中没有 C,因为它不是必需的。如果没有上升沿,它无论如何都不会触发(它与时钟的上升沿同步)

我还没有测试过这段代码,但它应该可以工作。

实际上,你为什么不制作 Z_1 信号,而不是变量?

【讨论】:

  • Teraz nie da się wykompliować: uk3 的架构 uk3 是开始进程 (clk,rst) 变量 Z_1 : INTEGER:=0;如果 rst='1' 则开始,然后 Z_1:=0; elsifrising_edge(clk) then case C is when 1=> Z_1:=Z_1 +1;当 2=> Z_1:=Z_1 + 2;结束案例; D
  • # Error: COMP96_0093: uk3.vhd : (47, 21): 子程序调用中的实际参数类型与子程序形式参数类型不匹配。 # 错误: COMP96_0301: uk3.vhd : (48, 4): 选项 OTHERS 必须在没有涵盖所有备选方案时出现
  • @Pietryno 另见my answer here
  • @Pietryno 您的 cmets 似乎是另一个问题。如果是这样,请再问一个问题。
  • 我建议使用同步重置。并使Z_1 成为信号而不是变量。
猜你喜欢
  • 2014-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多