【问题标题】:Unwanted Asynchronous Reset不需要的异步复位
【发布时间】:2026-01-05 04:10:02
【问题描述】:

我编写了以下 VHDL 代码,假设它会生成一个带有同步复位的计数器!但是,当我查看 Vivado 2020.2 中的精心设计时,计数器有一个异步重置!如果没有看到时钟的上升/下降沿,则不应评估该过程!该工具是如何推断异步重置的?!

PS。 count 被定义为无符号信号(不是 std_logic_vector)

非常感谢任何解释!

process(clk)
    begin
        if rst='1' then
            count <= (others => '0');
        elsif rising_edge(clk) then
            count <= count + 1;
        end if;
end process;

【问题讨论】:

  • 这不是同步复位的 RTL 形式,也不是灵敏度列表中没有 rst 的异步复位。以同步复位if rising_edge(clk) then if rst = '1' then count &lt;= (others =&gt; '0'); else count &lt;= count + 1; end if; end if; 为例。请参见 UG901 VHDL 顺序逻辑,初始化寄存器示例二 (VHDL)。

标签: asynchronous vhdl reset xilinx vivado


【解决方案1】:

综合工具通常会忽略敏感度列表,并根据代码中的设计模式创建逻辑。在您的代码中,rst 分支覆盖了时钟分支,因此它创建了一个异步重置。另外,重置不依赖clk

要创建同步复位,rst 分支应位于时钟分支内,因为复位仅应发生在时钟沿。

process(clk)
begin
  if rising_edge(clk) then
    count <= count + 1;

    if rst = '1' then 
      count <= (others => '0');
    end if;
  end if;
end process;

【讨论】: