Functions | |
string | ExtendString ( string_in: in string , string_len: in integer ) |
extend a string | |
Processes | |
PROCESS_374 | ( CLK , START_INIT ) |
Synchronize Reset. | |
PROCESS_375 | ( CLK ) |
Synchronize LOCK. | |
PROCESS_376 | ( CLK ) |
Synchronize PCS_ERROR and generate a pulse when PCS_ERROR is high. | |
PROCESS_377 | ( CLK ) |
Counter for holding PMA reset for an amount of C_DELAY_PMA_RESET. | |
PROCESS_378 | ( CLK ) |
PROCESS_379 | ( CLK ) |
Counter for holding SYNC for an amount of C_DELAY_SYNC. | |
PROCESS_380 | ( CLK ) |
Counter for holding PCS reset for an amount of C_DELAY_PCS_RESET. | |
PROCESS_381 | ( CLK ) |
Counter for waiting C_DELAY_WAIT_PCS after de-assertion of PCS reset. | |
PROCESS_382 | ( CLK ) |
Counter for PCS error. | |
PROCESS_383 | ( CLK ) |
Counter for the READY signal. | |
PROCESS_384 | ( CLK ) |
GT11 Initialization FSM. | |
PROCESS_385 | ( 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 " |
C_DELAY_SYNC | unsigned ( 7 downto 0 ) := " 01000000 " |
C_DELAY_PCS_RESET | unsigned ( 2 downto 0 ) := " 011 " |
C_DELAY_LOCK | unsigned ( 4 downto 0 ) := " 10000 " |
C_DELAY_WAIT_PCS | unsigned ( 3 downto 0 ) := " 0101 " |
C_DELAY_WAIT_READY | unsigned ( 7 downto 0 ) := " 01000000 " |
C_PCS_ERROR_COUNT | unsigned ( 4 downto 0 ) := " 10000 " |
C_RESET | unsigned ( 7 downto 0 ) := " 00000001 " |
GT11 Initialization FSM. | |
C_PMA_RESET | unsigned ( 7 downto 0 ) := " 00000010 " |
GT11 Initialization FSM. | |
C_WAIT_LOCK | unsigned ( 7 downto 0 ) := " 00000100 " |
GT11 Initialization FSM. | |
C_SYNC | unsigned ( 7 downto 0 ) := " 00001000 " |
GT11 Initialization FSM. | |
C_PCS_RESET | unsigned ( 7 downto 0 ) := " 00010000 " |
GT11 Initialization FSM. | |
C_WAIT_PCS | unsigned ( 7 downto 0 ) := " 00100000 " |
GT11 Initialization FSM. | |
C_ALMOST_READY | unsigned ( 7 downto 0 ) := " 01000000 " |
GT11 Initialization FSM. | |
C_READY | unsigned ( 7 downto 0 ) := " 10000000 " |
GT11 Initialization FSM. | |
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 |
lock2sync_ready_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 |
lock_pulse_i | std_logic |
shift_register_0_q_i | std_logic |
shift_register_0_d_i | std_logic |
shift_register_1_q_i | std_logic |
shift_register_1_d_i | std_logic |
shift_register_2_q_i | std_logic |
shift_register_2_d_i | std_logic |
shift_register_3_q_i | std_logic |
shift_register_3_d_i | std_logic |
stage_1_enable_i | std_logic |
stage_2_enable_i | std_logic |
stage_3_enable_i | std_logic |
shift_register_1_enable_i | std_logic |
shift_register_2_enable_i | std_logic |
shift_register_3_enable_i | std_logic |
not_lock_i | std_logic |
Component Instantiations | |
shift_register_0 | SRL16E |
SRL16 Stage Zero - First stage of shifting. | |
flop_stage_0 | FDE |
extra FF, 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 |
SRL16 Stage Three - Fourth stage of shifting. | |
flop_stage_3 | FDRE |
extra FF, last stage |
this entity produces signal sequences for initializing rio tx
Definition at line 79 of file sata_gt11_init_tx.vhd.
string ExtendString | ( string_in in string , | |
string_len in integer ) |
extend a string
Definition at line 208 of file sata_gt11_init_tx.vhd.
00208 function ExtendString (string_in : string; 00209 string_len : integer) 00210 return string is 00211 variable string_out : string(1 to string_len) := (others => ' '); 00212 begin 00213 if string_in'length > string_len then 00214 string_out := string_in(1 to string_len); 00215 else 00216 string_out(1 to string_in'length) := string_in; 00217 end if; 00218 return string_out; 00219 end ExtendString;
PROCESS_374 | ( CLK , | |
START_INIT ) |
Synchronize Reset.
Definition at line 231 of file sata_gt11_init_tx.vhd.
00231 process (CLK, START_INIT) 00232 begin 00233 if (START_INIT = '1') then 00234 reset_r <= "11"; 00235 elsif (rising_edge(CLK)) then 00236 reset_r <= '0' & reset_r(1); 00237 end if; 00238 end process;
PROCESS_375 | ( CLK ) |
PROCESS_376 | ( CLK ) |
Synchronize PCS_ERROR and generate a pulse when PCS_ERROR is high.
Definition at line 253 of file sata_gt11_init_tx.vhd.
00253 process(CLK) 00254 begin 00255 if(CLK'event and CLK = '1') then 00256 if(reset_r(0) = '1') then 00257 pcs_error_r1 <= '0'; 00258 else 00259 pcs_error_r1 <= PCS_ERROR; 00260 end if; 00261 end if; 00262 end process;
PROCESS_377 | ( CLK ) |
Counter for holding PMA reset for an amount of C_DELAY_PMA_RESET.
Definition at line 273 of file sata_gt11_init_tx.vhd.
00273 process(CLK) 00274 begin 00275 if(CLK'event and CLK = '1') then 00276 if(init_state_r /= C_PMA_RESET) then 00277 pma_reset_count_r <= C_DELAY_PMA_RESET; 00278 else 00279 pma_reset_count_r <= pma_reset_count_r - 1; 00280 end if; 00281 end if; 00282 end process;
PROCESS_378 | ( CLK ) |
Counter for the wait time between assertion of TXLOCK and assertion to TXSYNC cycles. There is a requirement of 12,000 TXUSRCLK2 cycles between these two points. Please refer to the reset section of the User Guide for more information. This is built with SRL16s. In this module, we assume 1 USRCLK2 = 1 USRCLK (please adjust the address of the fourth SRL16 stage as neccessary). The whole four stages give 12,288 cycles of delay (16 * 16 * 16 * 3); note that the last stage has an extra FF at the end. Create a pulse from TXLOCK to initialize SRL16's. Need to register the LOCK signal from the GT11 twice since the LOCK is based on REFCLK
Definition at line 304 of file sata_gt11_init_tx.vhd.
00304 process(CLK) 00305 begin 00306 if(CLK'event and CLK = '1') then 00307 if (reset_r(0) = '1') then 00308 lock_r2 <= '0'; 00309 else 00310 lock_r2 <= lock_r; 00311 end if; 00312 end if; 00313 end process;
PROCESS_379 | ( CLK ) |
Counter for holding SYNC for an amount of C_DELAY_SYNC.
Definition at line 439 of file sata_gt11_init_tx.vhd.
00439 process(CLK) 00440 begin 00441 if(CLK'event and CLK = '1') then 00442 if(init_state_r /= C_SYNC) then 00443 sync_count_r <= C_DELAY_SYNC; 00444 else 00445 sync_count_r <= sync_count_r - 1; 00446 end if; 00447 end if; 00448 end process;
PROCESS_380 | ( CLK ) |
Counter for holding PCS reset for an amount of C_DELAY_PCS_RESET.
Definition at line 453 of file sata_gt11_init_tx.vhd.
00453 process(CLK) 00454 begin 00455 if(CLK'event and CLK = '1') then 00456 if(init_state_r /= C_PCS_RESET) then 00457 pcs_reset_count_r <= C_DELAY_PCS_RESET; 00458 else 00459 pcs_reset_count_r <= pcs_reset_count_r - 1; 00460 end if; 00461 end if; 00462 end process;
PROCESS_381 | ( CLK ) |
Counter for waiting C_DELAY_WAIT_PCS after de-assertion of PCS reset.
Definition at line 467 of file sata_gt11_init_tx.vhd.
00467 process(CLK) 00468 begin 00469 if(CLK'event and CLK = '1') then 00470 if(init_state_r /= C_WAIT_PCS) then 00471 wait_pcs_count_r <= C_DELAY_WAIT_PCS; 00472 else 00473 wait_pcs_count_r <= wait_pcs_count_r - 1; 00474 end if; 00475 end if; 00476 end process;
PROCESS_382 | ( CLK ) |
Counter for PCS error.
Definition at line 481 of file sata_gt11_init_tx.vhd.
00481 process(CLK) 00482 begin 00483 if(CLK'event and CLK = '1') then 00484 if(init_state_r = C_PMA_RESET) then 00485 pcs_error_count_r <= C_PCS_ERROR_COUNT; 00486 elsif (((init_state_r = C_ALMOST_READY) or (init_state_r = C_READY)) and (pcs_error_r1 and lock_r) = '1') then 00487 pcs_error_count_r <= pcs_error_count_r - 1; 00488 end if; 00489 end if; 00490 end process;
PROCESS_383 | ( CLK ) |
Counter for the READY signal.
Definition at line 495 of file sata_gt11_init_tx.vhd.
00495 process(CLK) 00496 begin 00497 if(CLK'event and CLK = '1') then 00498 if((init_state_r /= C_ALMOST_READY) or (pcs_error_r1 = '1')) then 00499 wait_ready_count_r <= C_DELAY_WAIT_READY; 00500 elsif(pcs_error_r1 = '0') then 00501 wait_ready_count_r <= wait_ready_count_r - 1; 00502 end if; 00503 end if; 00504 end process;
PROCESS_384 | ( CLK ) |
GT11 Initialization FSM.
Definition at line 509 of file sata_gt11_init_tx.vhd.
00509 process (CLK) 00510 begin 00511 if (rising_edge(CLK)) then 00512 if (reset_r(0) = '1') then 00513 init_state_r <= C_RESET; 00514 else 00515 init_state_r <= init_next_state_r; 00516 end if; 00517 end if; 00518 end process;
PROCESS_385 | ( 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: 1. C_RESET: Upon system reset of this block, PMA reset will be asserted 2. C_PMA_RESET: PMA reset is held for 3 USRCLK cycles 3. C_WAIT_LOCK: Wait for LOCK. After LOCK is asserted, wait for 12,000 USRCLK2 cycles and wait for the USRCLK of the GT11s to be stable before going to the next state to assert the PCS reset. If LOCK gets de-asserted, we reset the counter and wait for LOCK again. 4. C_SYNC: Assert SYNG for 64 SYNC cycles. If LOCK gets de-asserted, we go back to Step 3. 5. C_PCS_RESET: Assert PCS reset for 3 USRCLK cycles. If LOCK gets de-asserted, we go back to Step 3. 6. C_WAIT_PCS: After de-assertion of PCS reset, wait 5 USRCLK cycles. If LOCK gets de-asserted, we go back to Step 3. 7. C_ALMOST_READY: Go to the Almost Ready state. If LOCK gets de-asserted, we go back to Step 3. If there is a PCS error (i.e. buffer error) detected while LOCK is high, we go back to Step 4. If we cycle PCS reset for an N number of C_PCS_ERROR_COUNT, we go back to Step 1 to do a PMA reset. 8. C_READY: Go to the Ready state. We reach this state after waiting 64 USRCLK cycles without any PCS errors. We assert the READY signal to denote that this block finishes initializing the GT11. If there is a PCS error during this state, we go back to Step 4. If LOCK is lost, we go back to Step 3.
Definition at line 553 of file sata_gt11_init_tx.vhd.
00553 process (reset_r(0), pma_reset_done_i, init_fsm_wait_lock_check, lock_r, 00554 sync_done_i, pcs_reset_done_i, wait_pcs_done_i, pcs_error_r1, 00555 pcs_error_count_done_i, wait_ready_done_i) 00556 variable init_fsm_name : string(1 to 25); 00557 begin 00558 case init_state_r is 00559 00560 when C_RESET => 00561 00562 if (reset_r(0) = '1') then 00563 init_next_state_r <= C_RESET; 00564 else 00565 init_next_state_r <= C_PMA_RESET; 00566 end if; 00567 init_fsm_name := ExtendString("C_RESET", 25); 00568 00569 when C_PMA_RESET => 00570 00571 if (pma_reset_done_i = '1') then 00572 init_next_state_r <= C_WAIT_LOCK; 00573 else 00574 init_next_state_r <= C_PMA_RESET; 00575 end if; 00576 init_fsm_name := ExtendString("C_PMA_RESET", 25); 00577 00578 when C_WAIT_LOCK => 00579 00580 if(init_fsm_wait_lock_check = '1') then 00581 init_next_state_r <= C_SYNC; 00582 else 00583 init_next_state_r <= C_WAIT_LOCK; 00584 end if; 00585 init_fsm_name := ExtendString("C_WAIT_LOCK", 25); 00586 00587 when C_SYNC => 00588 if (lock_r = '1') then 00589 if (sync_done_i = '1') then 00590 init_next_state_r <= C_PCS_RESET; 00591 else 00592 init_next_state_r <= C_SYNC; 00593 end if; 00594 else 00595 init_next_state_r <= C_WAIT_LOCK; 00596 end if; 00597 init_fsm_name := ExtendString("C_SYNC", 25); 00598 00599 when C_PCS_RESET => 00600 if (lock_r = '1') then 00601 if (pcs_reset_done_i = '1') then 00602 init_next_state_r <= C_WAIT_PCS; 00603 else 00604 init_next_state_r <= C_PCS_RESET; 00605 end if; 00606 else 00607 init_next_state_r <= C_WAIT_LOCK; 00608 end if; 00609 init_fsm_name := ExtendString("C_PCS_RESET", 25); 00610 00611 when C_WAIT_PCS => 00612 if (lock_r = '1') then 00613 if (wait_pcs_done_i = '1') then 00614 init_next_state_r <= C_ALMOST_READY; 00615 else 00616 init_next_state_r <= C_WAIT_PCS; 00617 end if; 00618 else 00619 init_next_state_r <= C_WAIT_LOCK; 00620 end if; 00621 init_fsm_name := ExtendString("C_WAIT_PCS", 25); 00622 00623 when C_ALMOST_READY => 00624 if (lock_r = '0') then 00625 init_next_state_r <= C_WAIT_LOCK; 00626 elsif ((pcs_error_r1 = '1') and (pcs_error_count_done_i = '0')) then 00627 init_next_state_r <= C_SYNC; 00628 elsif ((pcs_error_r1 = '1') and (pcs_error_count_done_i = '1')) then 00629 init_next_state_r <= C_PMA_RESET; 00630 elsif (wait_ready_done_i = '1') then 00631 init_next_state_r <= C_READY; 00632 else 00633 init_next_state_r <= C_ALMOST_READY; 00634 end if; 00635 init_fsm_name := ExtendString("C_ALMOST_READY", 25); 00636 00637 when C_READY => 00638 if ((lock_r = '1') and (pcs_error_r1 = '0')) then 00639 init_next_state_r <= C_READY; 00640 elsif ((lock_r = '1') and (pcs_error_r1 = '1')) then 00641 init_next_state_r <= C_PCS_RESET; 00642 else 00643 init_next_state_r <= C_WAIT_LOCK; 00644 end if; 00645 init_fsm_name := ExtendString("C_READY", 25); 00646 00647 when others => 00648 init_next_state_r <= C_RESET; 00649 init_fsm_name := ExtendString("C_RESET", 25); 00650 00651 end case; 00652 end process;
C_ALMOST_READY unsigned ( 7 downto 0 ) := " 01000000 " [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] |
shift_register_1 SRL16E [Component Instantiation] |
shift_register_2 SRL16E [Component Instantiation] |
shift_register_3 SRL16E [Component Instantiation] |
SRL16E [Component] |