]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-dad.git/blob - hw/dff2.vhd
Implemented multiple samples per pixel and times tuning in the test software.
[fpga/lx-cpu1/lx-dad.git] / hw / dff2.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
4 use work.lx_dad_pkg.all;
5
6 -- D circuit (filtered)
7
8 entity dff2 is
9   port
10         (
11     clk_i   : in std_logic;
12     d_i     : in std_logic;
13     q_o     : out std_logic
14   );
15 end dff2;
16
17 architecture behavioral of dff2 is
18         signal d_2r   : std_logic;
19         signal d_r    : std_logic;
20   signal data_s : std_logic;
21
22         -- XST attributes
23   attribute REGISTER_DUPLICATION : string;
24         attribute REGISTER_DUPLICATION of d_2r : signal is "NO";
25         attribute REGISTER_DUPLICATION of d_r  : signal is "NO";
26
27 begin
28   q_o <= data_s;
29
30 seq:
31         process
32         begin
33     wait until clk_i'event and clk_i = '1';
34                 if d_2r = d_r then
35                         data_s <= d_r;
36                 end if;
37
38                 d_2r    <= d_r;
39                 d_r     <= d_i;
40   end process;
41
42 end behavioral;