]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blob - hw/dff2.vhd
Support 8 IRCs, refactorization (IRC and LXMaster registers and wiring)
[fpga/lx-cpu1/lx-rocon.git] / hw / dff2.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
5 use ieee.numeric_std.all;
6 use work.lx_rocon_pkg.all;
7
8 -- D circuit (filtered)
9
10 entity dff2 is
11   port
12         (
13     clk_i   : in std_logic;
14                 reset_i : in std_logic;
15     d_i     : in std_logic;
16     q_o     : out std_logic
17   );
18 end dff2;
19
20 architecture behavioral of dff2 is
21         signal last_d_s : std_logic;
22   signal data_s : std_logic;
23 begin
24   q_o <= data_s;
25
26 seq:
27         process
28         begin
29     wait until clk_i'event and clk_i = '1';
30                 if reset_i = '1' then
31                         last_d_s <= '0';
32                         data_s <= '0';
33                 else
34                         if d_i = last_d_s then
35                                 data_s <= d_i;
36                         end if;
37                 end if;
38
39                 last_d_s <= d_i;
40   end process;
41
42 end behavioral;