Functions | |
string | ExtendString ( string_in: in string , string_len: in integer ) |
extend a string | |
Processes | |
PROCESS_169 | ( CLK , START_INIT ) |
Sync START_INIT. | |
PROCESS_170 | ( CLK ) |
Sync LOCK. | |
PROCESS_171 | ( CLK ) |
Sync PCS_ERROR. | |
PROCESS_172 | ( CLK ) |
Counter for holding PMA reset for an amount of C_DELAY_PMA_RESET. | |
PROCESS_173 | ( CLK ) |
PROCESS_174 | ( CLK ) |
Counter for holding SYNC for an amount of C_DELAY_SYNC. | |
PROCESS_175 | ( CLK ) |
Counter for holding PCS reset for an amount of C_DELAY_PCS_RESET. | |
PROCESS_176 | ( CLK ) |
Counter for waiting C_DELAY_WAIT_PCS after de-assertion of PCS reset. | |
PROCESS_177 | ( CLK ) |
Counter for PCS error. | |
PROCESS_178 | ( CLK ) |
Counter for the READY signal. | |
PROCESS_179 | ( CLK ) |
GT11 Initialization FSM reset. | |
PROCESS_180 | ( reset_r(0) , pma_reset_done_i , init_fsm_wait_lock_check , lock_r , sync_done_i , pcs_reset_done_i , wait_pcs_done_i , pcs_error_r1 , pcs_error_count_done_i , wait_ready_done_i ) |
Components | |
FDE | |
component FDE | |
SRL16E | |
component SRL16 | |
FDRE | |
component FDRE | |
Constants | |
C_DELAY_PMA_RESET | unsigned ( 2 downto 0 ) := " 011 " |
3 | |
C_DELAY_SYNC | unsigned ( 7 downto 0 ) := " 01000000 " |
64 | |
C_DELAY_PCS_RESET | unsigned ( 2 downto 0 ) := " 011 " |
3 | |
C_DELAY_LOCK | unsigned ( 4 downto 0 ) := " 10000 " |
16 | |
C_DELAY_WAIT_PCS | unsigned ( 3 downto 0 ) := " 0101 " |
5 | |
C_DELAY_WAIT_READY | unsigned ( 7 downto 0 ) := " 01000000 " |
64 | |
C_PCS_ERROR_COUNT | unsigned ( 4 downto 0 ) := " 10000 " |
16 | |
C_RESET | unsigned ( 7 downto 0 ) := " 00000001 " |
GT11 Initialization FSM state encoding. | |
C_PMA_RESET | unsigned ( 7 downto 0 ) := " 00000010 " |
GT11 Initialization FSM state encoding. | |
C_WAIT_LOCK | unsigned ( 7 downto 0 ) := " 00000100 " |
GT11 Initialization FSM state encoding. | |
C_SYNC | unsigned ( 7 downto 0 ) := " 00001000 " |
GT11 Initialization FSM state encoding. | |
C_PCS_RESET | unsigned ( 7 downto 0 ) := " 00010000 " |
GT11 Initialization FSM state encoding. | |
C_WAIT_PCS | unsigned ( 7 downto 0 ) := " 00100000 " |
GT11 Initialization FSM state encoding. | |
C_ALMOST_READY | unsigned ( 7 downto 0 ) := " 01000000 " |
GT11 Initialization FSM state encoding. | |
C_READY | unsigned ( 7 downto 0 ) := " 10000000 " |
GT11 Initialization FSM state encoding. | |
Signals | |
reset_r | unsigned ( 1 downto 0 ) |
lock_r | std_logic |
lock_r2 | std_logic |
pcs_error_r1 | std_logic |
pcs_error_r2 | std_logic |
pma_reset_count_r | unsigned ( 2 downto 0 ) |
sync_count_r | unsigned ( 7 downto 0 ) |
pcs_reset_count_r | unsigned ( 2 downto 0 ) |
wait_pcs_count_r | unsigned ( 3 downto 0 ) |
pcs_error_count_r | unsigned ( 4 downto 0 ) |
wait_ready_count_r | unsigned ( 7 downto 0 ) |
init_state_r | unsigned ( 7 downto 0 ) |
init_next_state_r | unsigned ( 7 downto 0 ) |
init_fsm_name | unsigned ( 40 *7 downto 0 ) |
init_fsm_wait_lock_check | std_logic |
pma_reset_done_i | std_logic |
lock_pulse_i | std_logic |
stage_1_enable_i | std_logic |
stage_2_enable_i | std_logic |
stage_3_enable_i | std_logic |
lockupdate_ready_i | std_logic |
shift_register_1_enable_i | std_logic |
shift_register_2_enable_i | std_logic |
shift_register_3_enable_i | std_logic |
shift_register_0_d_i | std_logic |
shift_register_1_d_i | std_logic |
shift_register_2_d_i | std_logic |
shift_register_3_d_i | std_logic |
shift_register_0_q_i | std_logic |
shift_register_1_q_i | std_logic |
shift_register_2_q_i | std_logic |
shift_register_3_q_i | std_logic |
sync_done_i | std_logic |
pcs_reset_done_i | std_logic |
wait_pcs_done_i | std_logic |
pcs_error_count_done_i | std_logic |
wait_ready_done_i | std_logic |
tied_to_ground_i | std_logic |
tied_to_vcc_i | std_logic |
not_lock_i | std_logic |
Component Instantiations | |
shift_register_0 | SRL16E |
flop_stage_0 | FDE |
extra FF for last stage | |
shift_register_1 | SRL16E |
SRL16 Stage One - Second stage of shifting. | |
flop_stage_1 | FDE |
extra FF last stage | |
shift_register_2 | SRL16E |
SRL16 Stage Two - Third stage of shifting. | |
flop_stage_2 | FDE |
extra FF last stage | |
shift_register_3 | SRL16E |
flop_stage_3 | FDRE |
extra FF last stage |
Definition at line 76 of file gt11_init_rx.vhd.
string ExtendString | ( string_in in string , | |
string_len in integer ) |
extend a string
Definition at line 212 of file gt11_init_rx.vhd.
00212 function ExtendString (string_in : string; 00213 string_len : integer) 00214 return string is 00215 variable string_out : string(1 to string_len) := (others => ' '); 00216 00217 begin 00218 if string_in'length > string_len then 00219 string_out := string_in(1 to string_len); 00220 else 00221 string_out(1 to string_in'length) := string_in; 00222 end if; 00223 return string_out; 00224 end ExtendString;
PROCESS_169 | ( CLK , | |
START_INIT ) |
Sync START_INIT.
Definition at line 235 of file gt11_init_rx.vhd.
00235 process (CLK, START_INIT) 00236 begin 00237 if (START_INIT = '1') then 00238 reset_r <= "11"; 00239 elsif (rising_edge(CLK)) then 00240 reset_r <= '0' & reset_r(1); 00241 end if; 00242 end process;
PROCESS_170 | ( CLK ) |
PROCESS_171 | ( CLK ) |
PROCESS_172 | ( CLK ) |
Counter for holding PMA reset for an amount of C_DELAY_PMA_RESET.
Definition at line 275 of file gt11_init_rx.vhd.
00275 process(CLK) 00276 begin 00277 if(CLK'event and CLK = '1') then 00278 if(init_state_r /= C_PMA_RESET) then 00279 pma_reset_count_r <= C_DELAY_PMA_RESET; 00280 else 00281 pma_reset_count_r <= pma_reset_count_r - 1; 00282 end if; 00283 end if; 00284 end process;
PROCESS_173 | ( CLK ) |
Create a pulse from RXLOCK to initialize SRL16's. Need to register the LOCK signal from the GT11 twice since the LOCK is based on REFCLK
Definition at line 299 of file gt11_init_rx.vhd.
00299 process(CLK) 00300 begin 00301 if(CLK'event and CLK = '1') then 00302 if (reset_r(0) = '1') then 00303 lock_r2 <= '0'; 00304 else 00305 lock_r2 <= lock_r; 00306 end if; 00307 end if; 00308 end process;
PROCESS_174 | ( CLK ) |
Counter for holding SYNC for an amount of C_DELAY_SYNC.
Definition at line 443 of file gt11_init_rx.vhd.
00443 process(CLK) 00444 begin 00445 if(CLK'event and CLK = '1') then 00446 if(init_state_r /= C_SYNC) then 00447 sync_count_r <= C_DELAY_SYNC; 00448 else 00449 sync_count_r <= sync_count_r - 1; 00450 end if; 00451 end if; 00452 end process;
PROCESS_175 | ( CLK ) |
Counter for holding PCS reset for an amount of C_DELAY_PCS_RESET.
Definition at line 457 of file gt11_init_rx.vhd.
00457 process(CLK) 00458 begin 00459 if(CLK'event and CLK = '1') then 00460 if(init_state_r /= C_PCS_RESET) then 00461 pcs_reset_count_r <= C_DELAY_PCS_RESET; 00462 else 00463 pcs_reset_count_r <= pcs_reset_count_r - 1; 00464 end if; 00465 end if; 00466 end process;
PROCESS_176 | ( CLK ) |
Counter for waiting C_DELAY_WAIT_PCS after de-assertion of PCS reset.
Definition at line 471 of file gt11_init_rx.vhd.
00471 process(CLK) 00472 begin 00473 if(CLK'event and CLK = '1') then 00474 if(init_state_r /= C_WAIT_PCS) then 00475 wait_pcs_count_r <= C_DELAY_WAIT_PCS; 00476 else 00477 wait_pcs_count_r <= wait_pcs_count_r - 1; 00478 end if; 00479 end if; 00480 end process;
PROCESS_177 | ( CLK ) |
Counter for PCS error.
Definition at line 485 of file gt11_init_rx.vhd.
00485 process(CLK) 00486 begin 00487 if(CLK'event and CLK = '1') then 00488 if(init_state_r = C_PMA_RESET) then 00489 pcs_error_count_r <= C_PCS_ERROR_COUNT; 00490 elsif (((init_state_r = C_ALMOST_READY) or (init_state_r = C_READY)) and (pcs_error_r1 and lock_r) = '1') then 00491 pcs_error_count_r <= pcs_error_count_r - 1; 00492 end if; 00493 end if; 00494 end process;
PROCESS_178 | ( CLK ) |
Counter for the READY signal.
Definition at line 499 of file gt11_init_rx.vhd.
00499 process(CLK) 00500 begin 00501 if(CLK'event and CLK = '1') then 00502 if((init_state_r /= C_ALMOST_READY) or (pcs_error_r1 = '1')) then 00503 wait_ready_count_r <= C_DELAY_WAIT_READY; 00504 elsif(pcs_error_r1 = '0') then 00505 wait_ready_count_r <= wait_ready_count_r - 1; 00506 end if; 00507 end if; 00508 end process;
PROCESS_179 | ( CLK ) |
GT11 Initialization FSM reset.
Definition at line 513 of file gt11_init_rx.vhd.
00513 process (CLK) 00514 begin 00515 if (rising_edge(CLK)) then 00516 if (reset_r(0) = '1') then 00517 init_state_r <= C_RESET; 00518 else 00519 init_state_r <= init_next_state_r; 00520 end if; 00521 end if; 00522 end process;
PROCESS_180 | ( reset_r(0) , | |
pma_reset_done_i , | ||
init_fsm_wait_lock_check , | ||
lock_r , | ||
sync_done_i , | ||
pcs_reset_done_i , | ||
wait_pcs_done_i , | ||
pcs_error_r1 , | ||
pcs_error_count_done_i , | ||
wait_ready_done_i ) |
GT11 Initialization FSM - This FSM is used to initialize the GT11 block asserting the PMA and PCS reset in sequence. It also takes into account of any error that may happen during initialization. The block uses USRCLK as reference for the delay. DO NOT use the output of the GT11 clocks for this reset module, as the output clocks may change when reset is applied to the GT11. Use a system clock, and make sure that the wait time for each state equals the specified number of USRCLK cycles.
The following steps are applied:
Definition at line 557 of file gt11_init_rx.vhd.
00557 process (reset_r(0), pma_reset_done_i, init_fsm_wait_lock_check, lock_r, 00558 sync_done_i, pcs_reset_done_i, wait_pcs_done_i, pcs_error_r1, 00559 pcs_error_count_done_i, wait_ready_done_i) 00560 variable init_fsm_name : string(1 to 25); 00561 begin 00562 case init_state_r is 00563 00564 when C_RESET => 00565 00566 if (reset_r(0) = '1') then 00567 init_next_state_r <= C_RESET; 00568 else 00569 init_next_state_r <= C_PMA_RESET; 00570 end if; 00571 init_fsm_name := ExtendString("C_RESET", 25); 00572 00573 when C_PMA_RESET => 00574 00575 if (pma_reset_done_i = '1') then 00576 init_next_state_r <= C_WAIT_LOCK; 00577 else 00578 init_next_state_r <= C_PMA_RESET; 00579 end if; 00580 init_fsm_name := ExtendString("C_PMA_RESET", 25); 00581 00582 when C_WAIT_LOCK => 00583 00584 if(init_fsm_wait_lock_check = '1') then 00585 init_next_state_r <= C_SYNC; 00586 else 00587 init_next_state_r <= C_WAIT_LOCK; 00588 end if; 00589 init_fsm_name := ExtendString("C_WAIT_LOCK", 25); 00590 00591 when C_SYNC => 00592 if (lock_r = '1') then 00593 if (sync_done_i = '1') then 00594 init_next_state_r <= C_PCS_RESET; 00595 else 00596 init_next_state_r <= C_SYNC; 00597 end if; 00598 else 00599 init_next_state_r <= C_PMA_RESET; --C_WAIT_LOCK; 00600 end if; 00601 init_fsm_name := ExtendString("C_SYNC", 25); 00602 00603 when C_PCS_RESET => 00604 if (lock_r = '1') then 00605 if (pcs_reset_done_i = '1') then 00606 init_next_state_r <= C_WAIT_PCS; 00607 else 00608 init_next_state_r <= C_PCS_RESET; 00609 end if; 00610 else 00611 init_next_state_r <= C_PMA_RESET; --C_WAIT_LOCK; 00612 end if; 00613 init_fsm_name := ExtendString("C_PCS_RESET", 25); 00614 00615 when C_WAIT_PCS => 00616 if (lock_r = '1') then 00617 if (wait_pcs_done_i = '1') then 00618 init_next_state_r <= C_ALMOST_READY; 00619 else 00620 init_next_state_r <= C_WAIT_PCS; 00621 end if; 00622 else 00623 init_next_state_r <= C_PMA_RESET; --C_WAIT_LOCK; 00624 end if; 00625 init_fsm_name := ExtendString("C_WAIT_PCS", 25); 00626 00627 when C_ALMOST_READY => 00628 if (lock_r = '0') then 00629 init_next_state_r <= C_PMA_RESET; --C_WAIT_LOCK; 00630 elsif ((pcs_error_r1 = '1') and (pcs_error_count_done_i = '0')) then 00631 init_next_state_r <= C_SYNC; 00632 elsif ((pcs_error_r1 = '1') and (pcs_error_count_done_i = '1')) then 00633 init_next_state_r <= C_PMA_RESET; 00634 elsif (wait_ready_done_i = '1') then 00635 init_next_state_r <= C_READY; 00636 else 00637 init_next_state_r <= C_ALMOST_READY; 00638 end if; 00639 init_fsm_name := ExtendString("C_ALMOST_READY", 25); 00640 00641 when C_READY => 00642 if ((lock_r = '1') and (pcs_error_r1 = '0')) then 00643 init_next_state_r <= C_READY; 00644 elsif ((lock_r = '1') and (pcs_error_r1 = '1')) then 00645 init_next_state_r <= C_PCS_RESET; 00646 else 00647 init_next_state_r <= C_PMA_RESET; --C_WAIT_LOCK; 00648 end if; 00649 init_fsm_name := ExtendString("C_READY", 25); 00650 00651 when others => 00652 init_next_state_r <= C_RESET; 00653 init_fsm_name := ExtendString("C_RESET", 25); 00654 00655 end case; 00656 end process;
C_ALMOST_READY unsigned ( 7 downto 0 ) := " 01000000 " [Constant] |
C_DELAY_LOCK unsigned ( 4 downto 0 ) := " 10000 " [Constant] |
C_DELAY_PCS_RESET unsigned ( 2 downto 0 ) := " 011 " [Constant] |
C_DELAY_PMA_RESET unsigned ( 2 downto 0 ) := " 011 " [Constant] |
C_DELAY_SYNC unsigned ( 7 downto 0 ) := " 01000000 " [Constant] |
C_DELAY_WAIT_PCS unsigned ( 3 downto 0 ) := " 0101 " [Constant] |
C_DELAY_WAIT_READY unsigned ( 7 downto 0 ) := " 01000000 " [Constant] |
C_PCS_ERROR_COUNT unsigned ( 4 downto 0 ) := " 10000 " [Constant] |
C_PCS_RESET unsigned ( 7 downto 0 ) := " 00010000 " [Constant] |
C_PMA_RESET unsigned ( 7 downto 0 ) := " 00000010 " [Constant] |
C_READY unsigned ( 7 downto 0 ) := " 10000000 " [Constant] |
C_RESET unsigned ( 7 downto 0 ) := " 00000001 " [Constant] |
C_SYNC unsigned ( 7 downto 0 ) := " 00001000 " [Constant] |
C_WAIT_LOCK unsigned ( 7 downto 0 ) := " 00000100 " [Constant] |
C_WAIT_PCS unsigned ( 7 downto 0 ) := " 00100000 " [Constant] |
FDE [Component] |
FDRE [Component] |
flop_stage_0 FDE [Component Instantiation] |
flop_stage_1 FDE [Component Instantiation] |
flop_stage_2 FDE [Component Instantiation] |
flop_stage_3 FDRE [Component Instantiation] |
shift_register_0 SRL16E [Component Instantiation] |
Counter for the LOCKUPDATE cycles for RXLOCK: This is built with SRL16s. Currently, we need to wait for 16 LOCKUPDATE cycles to qualify the RXLOCK signal. Each LOCKUPDATE = 1024 REFCLK cycles. In this module, we assume 1 REFCLK = 1 USRCLK (please adjust the address of the fourth SRL16 stage as neccessary). The whole four stages give 16,304 cycles of delay (16 * 16 * 16 * 4); note that the last stage has an extra FF at the end.
Definition at line 322 of file gt11_init_rx.vhd.
shift_register_1 SRL16E [Component Instantiation] |
shift_register_2 SRL16E [Component Instantiation] |
shift_register_3 SRL16E [Component Instantiation] |
SRL16 Stage Three - Fourth stage of shifting LOCKUPDATE ready is redundant here in resetting the SRL16 since the flop is already reset by RXLOCK from the MGT
Definition at line 415 of file gt11_init_rx.vhd.
SRL16E [Component] |