10 use IEEE.STD_LOGIC_1164.
ALL;
11 USE ieee.std_logic_arith.
all;
12 LIBRARY xil_defaultlib;
28 rx_resetdone : IN std_logic;
32 Mux_Value :OUT std_logic_vector (3 DOWNTO 0)
39 signal delay_count:unsigned (3 downto 0);
42 idle, wt_rstdone, wt_comma, wt_ttc_redge
45 SIGNAL current_state : STATE_TYPE;
51 clocked_proc :
PROCESS (
58 current_state <= idle;
60 mux_value <= (others => '0');
62 delay_count <= (others => '0');
65 delay_count <= (others => '0');
66 mux_value <= (others => '0');
73 current_state <= wt_rstdone;
75 current_state <= idle;
78 IF (rx_resetdone ='1') THEN
79 current_state <= wt_comma;
81 current_state <= wt_rstdone;
85 delay_count <= (others=>'0');
87 current_state <= idle;
89 delay_count <= delay_count+1;
90 current_state <= wt_ttc_redge;
92 current_state <= wt_comma;
95 delay_count <= delay_count+1;
97 delay_count <= (others =>'0');
98 mux_value <= std_logic_vector(delay_count);
100 current_state <= idle;
102 current_state <= wt_ttc_redge;
105 current_state <= idle;
109 END PROCESS clocked_proc;
First Stage state machine.
First Stage state machine.
out Mux_Value std_logic_vector( 3 DOWNTO 0)
delay count
in MGT_Commadet std_logic
MGT commadet.
out Reg_enable std_logic
enable
in TTC_CLK_edge std_logic
raising edge of TTC clock of 40NHz
in clk_280M std_logic
MGT rx clock of 280MHz for process and 160MHz for control.
in Start std_logic
start of synchronisation