d_reg
我在这段代码中有一个涉及我的信号的锁存器。我是 VHDL 新手,我似乎找不到这个锁存器的原因。我已经为每个 in_data 的情况为 d_reg 分配了一个值。谁能解释为什么我有一个闩锁,以及将来如何防止这种情况发生?
我收到的警告是:
WARNING:Xst:1710 - FF/Latch
<d_reg_0>
(无初始值)在 block 中有一个常数值 0<delay_incrementor>
。此 FF/Latch 将在优化过程中被修整。
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;