CMX
CMX firmware code in-line documentation
 All Classes Namespaces Files Functions Variables
mini_fifo_synchroniser.vhd
Go to the documentation of this file.
1 ----------------------------------------------------------------------------------
27 ----------------------------------------------------------------------------------
28 library IEEE;
29 use IEEE.STD_LOGIC_1164.ALL;
30 
31 library work;
32 use work.CMXpackage.all;
33 
34 
35 -- Uncomment the following library declaration if using
36 -- arithmetic functions with Signed or Unsigned values
37 -- use IEEE.NUMERIC_STD.ALL;
38 
39 -- Uncomment the following library declaration if instantiating
40 -- any Xilinx primitives in this code.
41 --library UNISIM;
42 --use UNISIM.VComponents.all;
43 
45  port (
46  set_mem_ctr_i_out : out std_logic;
47  set_mem_ctr_o_out : out std_logic;
48  clk_i_dom : in std_logic; --input domain clock
49  clk_o_dom : in std_logic; --output domain clock
50  set : in std_logic); --set signal (active high)
51 end mini_fifo_synchroniser;
52 
53 architecture Behavioral of mini_fifo_synchroniser is
54 
55  attribute keep : string;
56 
57  signal set_r_clk_i : std_logic;
58  signal set_rr_clk_i : std_logic;
59 
60 
61 
62  signal set_rr_clk_i_r_clk_o : std_logic;
63 
64  signal set_mem_ctr_i : std_logic;
65  signal set_mem_ctr_o : std_logic;
66 
68 
69 
70 begin
71 
72 
73  i_ctr_proc: process (clk_i_dom)
74  begin -- process i_ctr_proc
75  if rising_edge(clk_i_dom) then
76  set_mem_ctr_i<=set_rr_clk_i;
77  set_rr_clk_i<=set_r_clk_i;
78  set_r_clk_i<=set;
79  end if;
80  end process i_ctr_proc;
81 
82  o_ctr_proc: process (clk_o_dom)
83  begin -- process i_ctr_proc
84  if rising_edge(clk_o_dom) then
85 
86  set_mem_ctr_o <= set_rr_clk_i_r_clk_o;
87  set_rr_clk_i_r_clk_o <= set_rr_clk_i;
88  end if;
89  end process o_ctr_proc;
90 
91  set_mem_ctr_o_out<=set_mem_ctr_o;
92  set_mem_ctr_i_out<=set_mem_ctr_i;
93 
94 
95 end Behavioral;
96 
_library_ IEEEIEEE
Definition: mini_fifo.vhd:14
_library_ workwork
Definition: mini_fifo.vhd:17