d_reg
このコードにシグナルを含むラッチがあります。私は VHDL を初めて使用するので、このラッチの理由がわかりません。in_data のすべてのケースに対して、すでに d_reg に値を割り当てています。ラッチがある理由と、将来これを防ぐ方法を誰か説明できますか?
私が受け取る警告は次のとおりです。
WARNING:Xst:1710 - FF/Latch
<d_reg_0>
(初期値なし) には、ブロック内の定数値 0 があります<delay_incrementor>
。この FF/ラッチは、最適化プロセス中にトリミングされます。
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;