library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.numeric_std.all; use work.lx_rocon_pkg.all; -- D circuit (filtered) entity dff2 is port ( clk_i : in std_logic; reset_i : in std_logic; d_i : in std_logic; q_o : out std_logic ); end dff2; architecture behavioral of dff2 is signal d_2r : std_logic; signal d_r : std_logic; signal data_s : std_logic; begin q_o <= data_s; seq: process begin wait until clk_i'event and clk_i = '1'; if reset_i = '1' then d_r <= '0'; data_s <= '0'; elsif d_2r = d_r then data_s <= d_r; end if; d_2r <= d_r; d_r <= d_i; end process; end behavioral;