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 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer: W. Fedorko
4 --
5 -- Create Date: 30 Apr 2013
6 -- Design Name:
7 -- Module Name: mini_fifo_synchroniser - Behavioral
8 -- Project Name:
9 -- Target Devices:
10 -- Tool versions:
11 -- Description: This modules provides synchronisers for the mini fifos that
12 -- transfer the data into the GTX TX Clock domains
13 --
14 --
15 -- Dependencies: CoreGen wrapper for a Block Ram
16 --
17 -- Revision:
18 -- Revision 0.01 - File Created
19 -- Additional Comments:
20 --
21 ----------------------------------------------------------------------------------
22 library IEEE;
23 use IEEE.STD_LOGIC_1164.ALL;
24 
25 library work;
26 use work.CMXpackage.all;
27 
28 
29 -- Uncomment the following library declaration if using
30 -- arithmetic functions with Signed or Unsigned values
31 -- use IEEE.NUMERIC_STD.ALL;
32 
33 -- Uncomment the following library declaration if instantiating
34 -- any Xilinx primitives in this code.
35 --library UNISIM;
36 --use UNISIM.VComponents.all;
37 
38 entity mini_fifo_synchroniser is
39  port (
40  set_mem_ctr_i_out : out std_logic;
41  set_mem_ctr_o_out : out std_logic;
42  clk_i_dom : in std_logic; --input domain clock
43  clk_o_dom : in std_logic; --output domain clock
44  set : in std_logic); --set signal (active high)
45 end mini_fifo_synchroniser;
46 
47 architecture Behavioral of mini_fifo_synchroniser is
48 
49  attribute keep : string;
50 
51  signal set_r_clk_i : std_logic;
52  signal set_rr_clk_i : std_logic;
53 
54 
55 
56  signal set_rr_clk_i_r_clk_o : std_logic;
57 
58  signal set_mem_ctr_i : std_logic;
59  signal set_mem_ctr_o : std_logic;
60 
62 
63 
64 begin
65 
66 
67  i_ctr_proc: process (clk_i_dom)
68  begin -- process i_ctr_proc
69  if rising_edge(clk_i_dom) then
70  set_mem_ctr_i<=set_rr_clk_i;
71  set_rr_clk_i<=set_r_clk_i;
72  set_r_clk_i<=set;
73  end if;
74  end process i_ctr_proc;
75 
76  o_ctr_proc: process (clk_o_dom)
77  begin -- process i_ctr_proc
78  if rising_edge(clk_o_dom) then
79 
80  set_mem_ctr_o <= set_rr_clk_i_r_clk_o;
81  set_rr_clk_i_r_clk_o <= set_rr_clk_i;
82  end if;
83  end process o_ctr_proc;
84 
85  set_mem_ctr_o_out<=set_mem_ctr_o;
86  set_mem_ctr_i_out<=set_mem_ctr_i;
87 
88 
89 end Behavioral;
90