我已經撰寫了以下 VHDL 代碼,假設它將生成一個帶有同步復位的計數器!但是,當我查看 Vivado 2020.2 中精心設計的設計時,計數器具有異步重置!不應該在沒有看到時鐘的上升/下降沿的情況下評估該程序!該工具如何推斷異步復位?!
附注。計數被定義為無符號信號(不是 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;
uj5u.com熱心網友回復:
綜合工具通常會忽略敏感度串列,并根據代碼中的設計模式創建邏輯。在您的代碼中,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;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/404459.html
標籤:
