1 ----------------------------------------------------------------------------------------------- 2 -- (c) Copyright 2008 Xilinx, Inc. All rights reserved. 4 -- This file contains confidential and proprietary information 5 -- of Xilinx, Inc. and is protected under U.S. and 6 -- international copyright and other intellectual property 10 -- This disclaimer is not a license and does not grant any 11 -- rights to the materials distributed herewith. Except as 12 -- otherwise provided in a valid license issued to you by 13 -- Xilinx, and to the maximum extent permitted by applicable 14 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND 15 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES 16 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING 17 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- 18 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and 19 -- (2) Xilinx shall not be liable (whether in contract or tort, 20 -- including negligence, or under any other theory of 21 -- liability) for any loss or damage of any kind or nature 22 -- related to, arising under or in connection with these 23 -- materials, including for any direct, or any indirect, 24 -- special, incidental, or consequential loss or damage 25 -- (including loss of data, profits, goodwill, or any type of 26 -- loss or damage suffered as a result of any action brought 27 -- by a third party) even if such damage or loss was 28 -- reasonably foreseeable or Xilinx had been advised of the 29 -- possibility of the same. 31 -- CRITICAL APPLICATIONS 32 -- Xilinx products are not designed or intended to be fail- 33 -- safe, or for use in any application requiring fail-safe 34 -- performance, such as life-support or safety devices or 35 -- systems, Class III medical devices, nuclear facilities, 36 -- applications related to the deployment of airbags, or any 37 -- other applications that could lead to death, personal 38 -- injury, or severe property or environmental damage 39 -- (individually and collectively, "Critical 40 -- Applications"). Customer assumes the sole risk and 41 -- liability of any use of Xilinx products in Critical 42 -- Applications, subject only to applicable laws and 43 -- regulations governing limitations on product liability. 45 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS 46 -- PART OF THIS FILE AT ALL TIMES. 49 ------------------------------------------------------------------------------------------- 53 -- Description: This is the top level module for a 1 2-byte lane Aurora 54 -- reference design module. This module supports the following features: 60 use IEEE.STD_LOGIC_1164.
all;
61 use IEEE.STD_LOGIC_MISC.
all;
63 -- synthesis translate_off 68 -- synthesis translate_on 72 SIM_GTPRESET_SPEEDUP : := 0;
73 CLK_CORRECT_USE : := TRUE);
75 -- LocalLink TX Interface 82 -- LocalLink RX Interface 93 --GTP Reference Clock Interface 94 REFSELDYPLL : in (2 downto 0);
98 -- Error Detection Interface 105 -- Clock Compensation Control Interface 113 LOOPBACK : in (2 downto 0);
116 RXEQMIX_IN : in (1 downto 0);
117 DADDR_IN : in (7 downto 0);
120 DI_IN : in (15 downto 0);
122 DRPDO_OUT : out (15 downto 0);
129 attribute core_generation_info : ;
130 attribute core_generation_info of MAPPED : architecture is "klm_aurora,aurora_8b10b_v5_3,{user_interface=Legacy_LL, backchannel_mode=Sidebands, c_aurora_lanes=1, c_column_used=None, c_gt_clock_1=GTPD2, c_gt_clock_2=None, c_gt_loc_1=X, c_gt_loc_10=X, c_gt_loc_11=X, c_gt_loc_12=X, c_gt_loc_13=X, c_gt_loc_14=X, c_gt_loc_15=X, c_gt_loc_16=X, c_gt_loc_17=X, c_gt_loc_18=X, c_gt_loc_19=X, c_gt_loc_2=X, c_gt_loc_20=X, c_gt_loc_21=X, c_gt_loc_22=X, c_gt_loc_23=X, c_gt_loc_24=X, c_gt_loc_25=X, c_gt_loc_26=X, c_gt_loc_27=X, c_gt_loc_28=X, c_gt_loc_29=X, c_gt_loc_3=X, c_gt_loc_30=X, c_gt_loc_31=X, c_gt_loc_32=X, c_gt_loc_33=X, c_gt_loc_34=X, c_gt_loc_35=X, c_gt_loc_36=X, c_gt_loc_37=X, c_gt_loc_38=X, c_gt_loc_39=X, c_gt_loc_4=X, c_gt_loc_40=X, c_gt_loc_41=X, c_gt_loc_42=X, c_gt_loc_43=X, c_gt_loc_44=X, c_gt_loc_45=X, c_gt_loc_46=X, c_gt_loc_47=X, c_gt_loc_48=X, c_gt_loc_5=1, c_gt_loc_6=X, c_gt_loc_7=X, c_gt_loc_8=X, c_gt_loc_9=X, c_lane_width=2, c_line_rate=2.5443, c_nfc=false, c_nfc_mode=IMM, c_refclk_frequency=127.215, c_simplex=false, c_simplex_mode=TX, c_stream=false, c_ufc=false, flow_mode=None, interface_mode=Framing, dataflow_config=Duplex}";
131 -- Component Declarations -- 134 -- synthesis translate_off 137 -- synthesis translate_on 147 RX_DATA :
in (
15 downto 0);
-- 2-byte data bus from the GTP. 148 RX_NOT_IN_TABLE :
in (
1 downto 0);
-- Invalid 10-bit code was recieved. 149 RX_DISP_ERR :
in (
1 downto 0);
-- Disparity error detected on RX interface. 150 RX_CHAR_IS_K :
in (
1 downto 0);
-- Indicates which bytes of RX_DATA are control. 151 RX_CHAR_IS_COMMA :
in (
1 downto 0);
-- Comma received on given byte. 152 -- RX_STATUS : in std_logic_vector(5 downto 0); -- Part of GTP status and error bus. 153 RX_BUF_ERR :
in ;
-- Overflow/Underflow of RX buffer detected. 154 TX_BUF_ERR :
in ;
-- Overflow/Underflow of TX buffer detected. 155 RX_REALIGN :
in ;
-- SERDES was realigned because of a new comma. 156 RX_POLARITY :
out ;
-- Controls interpreted polarity of serial data inputs. 157 RX_RESET :
out ;
-- Reset RX side of GTP logic. 158 TX_CHAR_IS_K :
out (
1 downto 0);
-- TX_DATA byte is a control character. 159 TX_DATA :
out (
15 downto 0);
-- 2-byte data bus to the GTP. 160 TX_RESET :
out ;
-- Reset TX side of GTP logic. 161 -- Comma Detect Phase Align Interface 162 ENA_COMMA_ALIGN :
out ;
-- Request comma alignment. 164 GEN_SCP :
in ;
-- SCP generation request from TX_LL. 165 GEN_ECP :
in ;
-- ECP generation request from TX_LL. 166 GEN_PAD :
in ;
-- PAD generation request from TX_LL. 167 TX_PE_DATA :
in (
0 to 15);
-- Data from TX_LL to send over lane. 168 TX_PE_DATA_V :
in ;
-- Indicates TX_PE_DATA is Valid. 169 GEN_CC :
in ;
-- CC generation request from TX_LL. 171 RX_PAD :
out ;
-- Indicates lane received PAD. 172 RX_PE_DATA :
out (
0 to 15);
-- RX data from lane to RX_LL. 173 RX_PE_DATA_V :
out ;
-- RX_PE_DATA is data, not control symbol. 174 RX_SCP :
out ;
-- Indicates lane received SCP. 175 RX_ECP :
out ;
-- Indicates lane received ECP. 176 -- Global Logic Interface 177 GEN_A :
in ;
-- 'A character' generation request from Global Logic. 178 GEN_K :
in (
0 to 1);
-- 'K character' generation request from Global Logic. 179 GEN_R :
in (
0 to 1);
-- 'R character' generation request from Global Logic. 180 GEN_V :
in (
0 to 1);
-- Verification data generation request. 181 LANE_UP :
out ;
-- Lane is ready for bonding and verification. 182 SOFT_ERR :
out ;
-- Soft error detected. 183 HARD_ERR :
out ;
-- Hard error detected. 184 CHANNEL_BOND_LOAD :
out ;
-- Channel Bonding done code received. 185 GOT_A :
out (
0 to 1);
-- Indicates lane recieved 'A character' bytes. 186 GOT_V :
out ;
-- Verification symbols received. 188 USER_CLK :
in ;
-- System clock for all non-GTP Aurora Logic. 189 RESET_SYMGEN :
in ;
-- Reset the SYM_GEN module. 190 RESET :
in );
-- Reset the lane. 195 SIM_GTPRESET_SPEEDUP : :=
0;
--Set to 1 to speed up sim reset 196 CLK_CORRECT_USE : := TRUE);
--Set to true to use clock correction 198 ENMCOMMAALIGN_IN :
in ;
199 ENPCOMMAALIGN_IN :
in ;
200 LOOPBACK_IN :
in (
2 downto 0);
203 TXCHARISK_IN :
in (
1 downto 0);
204 TXDATA_IN :
in (
15 downto 0);
208 RXCHARISCOMMA_OUT :
out (
1 downto 0);
209 RXCHARISK_OUT :
out (
1 downto 0);
210 RXDATA_OUT :
out (
15 downto 0);
211 RXDISPERR_OUT :
out (
1 downto 0);
212 RXNOTINTABLE_OUT :
out (
1 downto 0);
213 RXREALIGN_OUT :
out ;
214 RXRECCLK1_OUT :
out ;
215 RXRECCLK2_OUT :
out ;
218 GTPCLKOUT_OUT :
out (
1 downto 0);
219 RXEQMIX_IN :
in (
1 downto 0);
220 DADDR_IN :
in (
7 downto 0);
223 DI_IN :
in (
15 downto 0);
225 DRPDO_OUT :
out (
15 downto 0);
235 REFSELDYPLL :
in (
2 downto 0);
239 RXCHARISCOMMA_OUT_unused :
out (
1 downto 0);
240 RXCHARISK_OUT_unused :
out (
1 downto 0);
241 RXDISPERR_OUT_unused :
out (
1 downto 0);
242 RXNOTINTABLE_OUT_unused :
out (
1 downto 0);
243 ------------------- Receive Ports - Channel Bonding Ports ----------------- 244 RXREALIGN_OUT_unused :
out ;
245 RXDATA_OUT_unused :
out (
15 downto 0);
246 RX1N_IN_unused :
in ;
247 RX1P_IN_unused :
in ;
248 RXBUFERR_OUT_unused :
out (
2 downto 0);
249 TXBUFERR_OUT_unused :
out (
1 downto 0);
250 CHBONDDONE_OUT_unused :
out ;
251 TX1N_OUT_unused :
out ;
252 TX1P_OUT_unused :
out ;
266 -- Aurora Lane Interface 272 GEN_K :
out (
0 to 1);
273 GEN_R :
out (
0 to 1);
274 GEN_V :
out (
0 to 1);
282 CHANNEL_SOFT_ERR :
out ;
283 CHANNEL_HARD_ERR :
out );
288 -- LocalLink PDU Interface 295 -- Clock Compensation Interface 298 -- Global Logic Interface 300 -- Aurora Lane Interface 305 TX_PE_DATA :
out (
0 to 15);
313 -- LocalLink PDU Interface 314 RX_D :
out (
0 to 15);
319 -- Global Logic Interface 321 -- Aurora Lane Interface 323 RX_PE_DATA :
in (
0 to 15);
333 -- Signal Declarations -- 334 signal TX1N_OUT_unused : ;
335 signal TX1P_OUT_unused : ;
336 signal RX1N_IN_unused : ;
337 signal RX1P_IN_unused : ;
338 signal rx_char_is_comma_i_unused : (1 downto 0);
339 signal rx_char_is_k_i_unused : (1 downto 0);
340 signal rx_data_i_unused : (15 downto 0);
341 signal rx_disp_err_i_unused : (1 downto 0);
342 signal rx_not_in_table_i_unused : (1 downto 0);
343 signal rx_realign_i_unused : ;
344 signal ch_bond_done_i_unused : ;
345 signal rx_buf_err_i_unused : (2 downto 0);
346 signal tx_buf_err_i_unused : (1 downto 0);
347 signal ch_bond_done_r1 : ;
348 signal ch_bond_done_r2 : ;
349 -- signal ch_bond_load_not_used_i : std_logic; 350 signal channel_bond_load_i : ;
351 signal channel_up_i : ;
352 signal chbondo_not_used_i : (4 downto 0);
353 signal en_chan_sync_i : ;
354 signal ena_comma_align_i : ;
358 signal gen_k_i : (0 to 1);
360 signal gen_r_i : (0 to 1);
362 signal gen_v_i : (0 to 1);
363 signal got_a_i : (0 to 1);
365 signal hard_err_i : ;
367 signal master_chbondo_i : ;
368 signal open_rx_char_is_comma_i : (5 downto 0);
369 signal open_rx_char_is_k_i : (5 downto 0);
370 signal open_rx_comma_det_i : ;
371 signal open_rx_data_i : (47 downto 0);
372 signal open_rx_disp_err_i : (5 downto 0);
373 signal open_rx_loss_of_sync_i : (1 downto 0);
374 signal open_rx_not_in_table_i : (5 downto 0);
375 signal open_rx_rec1_clk_i : ;
376 signal open_rx_rec2_clk_i : ;
377 signal open_rx_run_disp_i : (7 downto 0);
378 signal open_tx_k_err_i : (7 downto 0);
379 signal open_tx_run_disp_i : (7 downto 0);
380 signal raw_gtpclkout_i : (1 downto 0);
381 signal reset_lanes_i : ;
382 signal rx_buf_err_i : ;
383 signal rx_char_is_comma_i : (1 downto 0);
384 signal rx_char_is_comma_gtp_i : (7 downto 0);
385 signal rx_char_is_k_i : (1 downto 0);
386 signal rx_char_is_k_gtp_i : (7 downto 0);
387 signal rx_clk_cor_cnt_i : (2 downto 0);
388 signal rx_data_0_vec : (63 downto 0);
389 signal rx_data_i : (15 downto 0);
390 signal rx_data_gtp_i : (63 downto 0);
391 signal rx_disp_err_i : (1 downto 0);
392 signal rx_disp_err_gtp_i : (7 downto 0);
394 signal rx_not_in_table_i : (1 downto 0);
395 signal rx_not_in_table_gtp_i : (7 downto 0);
397 signal rx_pe_data_i : (0 to 15);
398 signal rx_pe_data_v_i : ;
399 signal rx_polarity_i : ;
400 signal rx_realign_i : ;
401 signal rx_reset_i : ;
403 signal rxchariscomma_0_vec : (7 downto 0);
404 signal rxcharisk_0_vec : (7 downto 0);
405 signal rxdisperr_0_vec : (7 downto 0);
406 signal rxmclk_out_not_used_i : ;
407 signal rxnotintable_0_vec : (7 downto 0);
408 signal rxpcshclkout_not_used_i : ;
409 signal soft_err_i : ;
410 signal start_rx_i : ;
411 signal tied_to_ground_i : ;
412 -- signal tied_to_ground_vec_i : std_logic_vector(47 downto 0); 413 signal tied_to_vcc_i : ;
414 signal tx_buf_err_i : ;
415 signal tx_char_is_k_i : (1 downto 0);
416 signal tx_char_is_k_gtp_i : (7 downto 0);
417 signal tx_data_i : (15 downto 0);
418 signal tx_data_gtp_i : (63 downto 0);
419 signal tx_int_data_width_i : (1 downto 0);
421 signal tx_pe_data_i : (0 to 15);
422 signal tx_pe_data_v_i : ;
423 signal tx_reset_i : ;
424 signal txcharisk_lane_0_i : (7 downto 0);
425 signal txdata_lane_0_i : (63 downto 0);
426 signal txoutclk2_out_not_used_i : ;
427 signal txpcshclkout_not_used_i : ;
428 signal tied_to_gnd_vec_i : (0 to 15);
431 -- Main Body of Code -- 432 -- Tie off top level constants 433 tied_to_gnd_vec_i <= (others => '0');
434 -- tied_to_ground_vec_i <= (others => '0'); 435 tied_to_ground_i <= '0';
436 tied_to_vcc_i <= '1';
437 -- Connect top level logic 438 CHANNEL_UP <= channel_up_i;
439 GTPCLKOUT <= raw_gtpclkout_i(0);
440 -- Connect TX_LOCK to tx_lock_i from lane 0 441 TX_LOCK <= tx_lock_i;
442 -- Instantiate Lane 0 -- 443 LANE_UP <= lane_up_i;
448 RX_DATA => rx_data_i
(15 downto 0),
449 RX_NOT_IN_TABLE => rx_not_in_table_i
(1 downto 0),
450 RX_DISP_ERR => rx_disp_err_i
(1 downto 0),
451 RX_CHAR_IS_K => rx_char_is_k_i
(1 downto 0),
452 RX_CHAR_IS_COMMA => rx_char_is_comma_i
(1 downto 0),
453 -- RX_STATUS => tied_to_ground_vec_i(5 downto 0), 454 TX_BUF_ERR => tx_buf_err_i,
455 RX_BUF_ERR => rx_buf_err_i,
456 RX_REALIGN => rx_realign_i,
457 RX_POLARITY => rx_polarity_i,
458 RX_RESET => rx_reset_i,
459 TX_CHAR_IS_K => tx_char_is_k_i
(1 downto 0),
460 TX_DATA => tx_data_i
(15 downto 0),
461 TX_RESET => tx_reset_i,
462 -- Comma Detect Phase Align Interface 463 ENA_COMMA_ALIGN => ena_comma_align_i,
465 GEN_SCP => gen_scp_i,
466 GEN_ECP => gen_ecp_i,
467 GEN_PAD => gen_pad_i,
468 TX_PE_DATA => tx_pe_data_i
(0 to 15),
469 TX_PE_DATA_V => tx_pe_data_v_i,
473 RX_PE_DATA => rx_pe_data_i
(0 to 15),
474 RX_PE_DATA_V => rx_pe_data_v_i,
477 -- Global Logic Interface 479 GEN_K => gen_k_i
(0 to 1),
480 GEN_R => gen_r_i
(0 to 1),
481 GEN_V => gen_v_i
(0 to 1),
482 LANE_UP => lane_up_i,
483 SOFT_ERR => soft_err_i,
484 HARD_ERR => hard_err_i,
485 -- CHANNEL_BOND_LOAD => ch_bond_load_not_used_i, 486 GOT_A => got_a_i
(0 to 1),
489 USER_CLK => USER_CLK,
490 RESET_SYMGEN => RESET,
491 RESET => reset_lanes_i
);
493 -- Instantiate GTP Wrapper -- 497 SIM_GTPRESET_SPEEDUP => SIM_GTPRESET_SPEEDUP,
498 CLK_CORRECT_USE => TRUE
)--CLK_CORRECT_USE)--! Don't mess with transceiver. Clocking issue if no clock correction without phase alignment. 500 ENMCOMMAALIGN_IN => ena_comma_align_i,
501 ENPCOMMAALIGN_IN => ena_comma_align_i,
502 LOOPBACK_IN => LOOPBACK,
503 -- Aurora Lane Interface 504 RXPOLARITY_IN => rx_polarity_i,
505 RXRESET_IN => rx_reset_i,
506 TXCHARISK_IN => tx_char_is_k_i
(1 downto 0),
507 TXDATA_IN => tx_data_i
(15 downto 0),
508 GTPRESET_IN => GT_RESET,
509 TXRESET_IN => tx_reset_i,
510 RXBUFERR_OUT => rx_buf_err_i,
511 RXCHARISCOMMA_OUT => rx_char_is_comma_i
(1 downto 0),
512 RXCHARISK_OUT => rx_char_is_k_i
(1 downto 0),
513 RXDATA_OUT => rx_data_i
(15 downto 0),
514 RXDISPERR_OUT => rx_disp_err_i
(1 downto 0),
515 RXNOTINTABLE_OUT => rx_not_in_table_i
(1 downto 0),
516 RXREALIGN_OUT => rx_realign_i,
517 RXRECCLK1_OUT => open_rx_rec1_clk_i,
518 RXRECCLK2_OUT => open_rx_rec2_clk_i,
519 TXBUFERR_OUT => tx_buf_err_i,
521 RXEQMIX_IN => RXEQMIX_IN,
522 DADDR_IN => DADDR_IN,
526 DRDY_OUT => DRDY_OUT,
527 DRPDO_OUT => DRPDO_OUT,
533 PLLLKDET_OUT => tx_lock_i,
534 GTPCLKOUT_OUT => raw_gtpclkout_i,
535 -- Reference Clocks and User Clock 536 RXUSRCLK_IN => SYNC_CLK,
537 RXUSRCLK2_IN => USER_CLK,
538 TXUSRCLK_IN => SYNC_CLK,
539 TXUSRCLK2_IN => USER_CLK,
540 REFSELDYPLL => REFSELDYPLL,
544 RXCHARISCOMMA_OUT_unused => rx_char_is_comma_i_unused
(1 downto 0),
545 RXCHARISK_OUT_unused => rx_char_is_k_i_unused
(1 downto 0),
546 RXDISPERR_OUT_unused => rx_disp_err_i_unused
(1 downto 0),
547 RXNOTINTABLE_OUT_unused => rx_not_in_table_i_unused
(1 downto 0),
548 ----------------- Receive Ports - Channel Bonding Ports ----------------- 549 RXREALIGN_OUT_unused => rx_realign_i_unused,
550 RXDATA_OUT_unused => rx_data_i_unused
(15 downto 0),
551 RX1N_IN_unused => RX1N_IN_unused,
552 RX1P_IN_unused => RX1P_IN_unused,
553 RXBUFERR_OUT_unused => rx_buf_err_i_unused,
554 TXBUFERR_OUT_unused => tx_buf_err_i_unused,
555 CHBONDDONE_OUT_unused => ch_bond_done_i_unused,
556 TX1N_OUT_unused => TX1N_OUT_unused,
557 TX1P_OUT_unused => TX1P_OUT_unused,
558 POWERDOWN_IN => POWER_DOWN
561 -- Instantiate Global Logic to combine Lanes into a Channel -- 565 EN_CHAN_SYNC => en_chan_sync_i,
566 -- Aurora Lane Interface 567 LANE_UP => lane_up_i,
568 SOFT_ERR => soft_err_i,
569 HARD_ERR => hard_err_i,
575 RESET_LANES => reset_lanes_i,
577 USER_CLK => USER_CLK,
579 POWER_DOWN => POWER_DOWN,
580 CHANNEL_UP => channel_up_i,
581 START_RX => start_rx_i,
582 CHANNEL_SOFT_ERR => SOFT_ERR,
583 CHANNEL_HARD_ERR => HARD_ERR
586 -- Instantiate TX_LL -- 589 -- LocalLink PDU Interface 592 TX_SRC_RDY_N => TX_SRC_RDY_N,
593 TX_SOF_N => TX_SOF_N,
594 TX_EOF_N => TX_EOF_N,
595 TX_DST_RDY_N => TX_DST_RDY_N,
596 -- Clock Compenstaion Interface 599 -- Global Logic Interface 600 CHANNEL_UP => channel_up_i,
601 -- Aurora Lane Interface 602 GEN_SCP => gen_scp_i,
603 GEN_ECP => gen_ecp_i,
604 TX_PE_DATA_V => tx_pe_data_v_i,
605 GEN_PAD => gen_pad_i,
606 TX_PE_DATA => tx_pe_data_i,
613 -- Instantiate RX_LL -- 616 -- LocalLink PDU Interface 619 RX_SRC_RDY_N => RX_SRC_RDY_N,
620 RX_SOF_N => RX_SOF_N,
621 RX_EOF_N => RX_EOF_N,
622 -- Global Logic Interface 623 START_RX => start_rx_i,
624 -- Aurora Lane Interface 626 RX_PE_DATA => rx_pe_data_i,
627 RX_PE_DATA_V => rx_pe_data_v_i,
631 FRAME_ERR => FRAME_ERR,