我的 VHDL 程序中的闩锁在哪里?

Where's the latch in my VHDL program?

我在这段代码中有一个锁存器涉及我的信号 d_reg。我是 VHDL 的新手,我似乎找不到这个闩锁的原因。我已经为 in_data 的每个案例分配了一个值 d_reg。谁能解释为什么我有闩锁,以及将来如何防止这种情况发生?

我收到的警告是:

WARNING:Xst:1710 - FF/Latch <d_reg_0> (without init value) has a constant value of 0 in block <delay_incrementor>. This FF/Latch will be trimmed during the optimization process.

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

entity delay_incrementor is
    Port ( clk,reset: in STD_LOGIC;
           in_data : in  STD_LOGIC_VECTOR (7 downto 0);
           out_data : out  STD_LOGIC_VECTOR (7 downto 0);
           d : out  STD_LOGIC_VECTOR (25 downto 0));
end delay_incrementor;

architecture Behavioral of delay_incrementor is
  signal d_reg,d_next: std_logic_vector (25 downto 0);
begin
  --Register
  process(clk,reset)
  begin
    if reset='1' then
      d_reg <= (others => '0');
    elsif (clk='1' and clk'event) then
      d_reg <= d_next;
    end if;
  end process;

  --Next-State Logic
  d_next <= std_logic_vector(unsigned(d_reg) + "1001100010010110100000000") when in_data = "01010101" else
             std_logic_vector(unsigned(d_reg) + "1001100010010110100000000") when in_data = "01000100" else
             d_reg;
  out_data <= "00010111" when in_data /= "00000000" else
                (others=>'0');

  --Output Logic
  d <= d_reg;
end Behavioral;

XST 警告 1710 只是所有内存元件(锁存器、触发器等)的常见警告。

警告指出您的 FF 具有恒定值,因此未使用或更改或修剪可能的 d 输入或 ce 时钟启用 :)。

发现闩锁警告是 XST Warning 737:

WARNING:Xst:737 - Found n-bit latch for signal .