summaryrefslogtreecommitdiff
path: root/lib/misc/components/input_sync.vhd
blob: 4e3ac57a6e5e8fce2bead52a11801ce1c7c019de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
------------------------------------------------------------------
--  _____       ______  _____                                    -
-- |_   _|     |  ____|/ ____|  Institute of Embedded Systems    -
--   | |  _ __ | |__  | (___    Zuercher Hochschule fuer         -
--   | | | '_ \|  __|  \___ \   angewandte Wissenschaften        -
--  _| |_| | | | |____ ____) |  (University of Applied Sciences) -
-- |_____|_| |_|______|_____/   8401 Winterthur, Switzerland     -
------------------------------------------------------------------
--
-- Project     : SInet
-- Module      : synthesis library ines_misc
-- Description : input synchronisytion
--
-- $LastChangedDate $
-- $Rev$
-- $Author$
-----------------------------------------------------------------
--
-- Change History
-- Date     |Name      |Modification
-----------------------------------------------------------------
-- 01.02.08 | ffar + beut     | file created based on library component
-----------------------------------------------------------------


library ieee;
  use ieee.std_logic_1164.all;

package input_sync_pkg is
  component input_sync
    generic(
      G_INIT_VALUE      : std_logic := '0'
    );
    port(
      clk_i             : in  std_logic;
      reset_n_i         : in  std_logic;
      async_signal_i    : in  std_logic;
      sync_signal_o     : out std_logic 
    );
  end component input_sync;
end package input_sync_pkg;


library ieee;
  use ieee.std_logic_1164.all;
  use ieee.numeric_std.all;

entity input_sync is
  generic(
      G_INIT_VALUE      : std_logic := '0'
    );
    port(
      clk_i             : in  std_logic;
      reset_n_i         : in  std_logic;
      async_signal_i     : in  std_logic;
      sync_signal_o     : out std_logic 
    );
  end input_sync;

architecture rtl of input_sync is

 signal sync_signal_f     : std_logic;

begin
    sync_prc : process(clk_i, reset_n_i, async_signal_i, sync_signal_f)
    begin
      if reset_n_i = '0' then
        sync_signal_f      <= G_INIT_VALUE;
        sync_signal_o      <= G_INIT_VALUE;
      elsif clk_i'event and clk_i = '1' then
        sync_signal_f      <= async_signal_i;
        sync_signal_o      <= sync_signal_f;
      end if;
    end process sync_prc;
end rtl;