]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Wed, 6 Jun 2012 13:00:47 +0000 (13:00 +0000)
committerhadeshyp <hadeshyp>
Wed, 6 Jun 2012 13:00:47 +0000 (13:00 +0000)
12 files changed:
media_interfaces/ecp3_sfp/serdes_full_ctc.ipx [new file with mode: 0644]
media_interfaces/ecp3_sfp/serdes_full_ctc.lpc [new file with mode: 0644]
media_interfaces/ecp3_sfp/serdes_full_ctc.txt [new file with mode: 0644]
media_interfaces/ecp3_sfp/serdes_full_ctc.vhd [new file with mode: 0644]
media_interfaces/ecp3_sfp/serdes_onboard_full.ipx
media_interfaces/ecp3_sfp/sfp_0_200_ctc.ipx [new file with mode: 0644]
media_interfaces/ecp3_sfp/sfp_0_200_ctc.lpc [new file with mode: 0644]
media_interfaces/ecp3_sfp/sfp_0_200_ctc.txt [new file with mode: 0644]
media_interfaces/ecp3_sfp/sfp_0_200_ctc.vhd [new file with mode: 0644]
media_interfaces/trb_net16_med_ecp3_sfp.vhd
media_interfaces/trb_net16_med_ecp3_sfp_4.vhd [new file with mode: 0644]
trb_net_components.vhd

diff --git a/media_interfaces/ecp3_sfp/serdes_full_ctc.ipx b/media_interfaces/ecp3_sfp/serdes_full_ctc.ipx
new file mode 100644 (file)
index 0000000..5f95aca
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DiamondModule name="serdes_full_ctc" module="PCS" VendorName="Lattice Semiconductor Corporation" generator="IPexpress" date="2012 06 01 16:01:09.714" version="8.1" type="Module" synthesis="" source_format="VHDL">
+  <Package>
+               <File name="serdes_full_ctc.lpc" type="lpc" modified="2012 06 01 15:59:58.000"/>
+               <File name="serdes_full_ctc.pp" type="pp" modified="2012 06 01 15:59:58.000"/>
+               <File name="serdes_full_ctc.sym" type="sym" modified="2012 06 01 15:59:58.000"/>
+               <File name="serdes_full_ctc.tft" type="tft" modified="2012 06 01 15:55:19.000"/>
+               <File name="serdes_full_ctc.txt" type="pcs_module" modified="2012 06 01 15:59:58.000"/>
+               <File name="serdes_full_ctc.vhd" type="top_level_vhdl" modified="2012 06 01 15:55:19.000"/>
+  </Package>
+</DiamondModule>
diff --git a/media_interfaces/ecp3_sfp/serdes_full_ctc.lpc b/media_interfaces/ecp3_sfp/serdes_full_ctc.lpc
new file mode 100644 (file)
index 0000000..8a1c4e0
--- /dev/null
@@ -0,0 +1,258 @@
+[Device]
+Family=latticeecp3
+PartType=LFE3-150EA
+PartName=LFE3-150EA-8FN672C
+SpeedGrade=8
+Package=FPBGA672
+OperatingCondition=COM
+Status=P
+
+[IP]
+VendorName=Lattice Semiconductor Corporation
+CoreType=LPM
+CoreStatus=Demo
+CoreName=PCS
+CoreRevision=8.1
+ModuleName=serdes_full_ctc
+SourceFormat=VHDL
+ParameterFileVersion=1.0
+Date=06/01/2012
+Time=15:59:58
+
+[Parameters]
+Verilog=0
+VHDL=1
+EDIF=1
+Destination=Synplicity
+Expression=BusA(0 to 7)
+Order=Big Endian [MSB:LSB]
+IO=0
+_mode0=RXTX
+_mode1=RXTX
+_mode2=RXTX
+_mode3=RXTX
+_protocol0=G8B10B
+_protocol1=G8B10B
+_protocol2=G8B10B
+_protocol3=G8B10B
+_ldr0=DISABLED
+_ldr1=DISABLED
+_ldr2=DISABLED
+_ldr3=DISABLED
+_datarange=2.0
+_pll_txsrc=INTERNAL
+_refclk_mult=10X
+_refclk_rate=200.0
+_tx_protocol0=G8B10B
+_tx_protocol1=G8B10B
+_tx_protocol2=G8B10B
+_tx_protocol3=G8B10B
+_tx_data_rate0=FULL
+_tx_data_rate1=FULL
+_tx_data_rate2=FULL
+_tx_data_rate3=FULL
+_tx_data_width0=16
+_tx_data_width1=16
+_tx_data_width2=16
+_tx_data_width3=16
+_tx_fifo0=ENABLED
+_tx_fifo1=ENABLED
+_tx_fifo2=ENABLED
+_tx_fifo3=ENABLED
+_tx_ficlk_rate0=100.0
+_tx_ficlk_rate1=100.0
+_tx_ficlk_rate2=100.0
+_tx_ficlk_rate3=100.0
+_pll_rxsrc0=INTERNAL
+_pll_rxsrc1=INTERNAL
+_pll_rxsrc2=INTERNAL
+_pll_rxsrc3=INTERNAL
+Multiplier0=
+Multiplier1=
+Multiplier2=
+Multiplier3=
+_rx_datarange0=2.0
+_rx_datarange1=2.0
+_rx_datarange2=2.0
+_rx_datarange3=2.0
+_rx_protocol0=G8B10B
+_rx_protocol1=G8B10B
+_rx_protocol2=G8B10B
+_rx_protocol3=G8B10B
+_rx_data_rate0=FULL
+_rx_data_rate1=FULL
+_rx_data_rate2=FULL
+_rx_data_rate3=FULL
+_rxrefclk_rate0=200.0
+_rxrefclk_rate1=200.0
+_rxrefclk_rate2=200.0
+_rxrefclk_rate3=200.0
+_rx_data_width0=16
+_rx_data_width1=16
+_rx_data_width2=16
+_rx_data_width3=16
+_rx_fifo0=ENABLED
+_rx_fifo1=ENABLED
+_rx_fifo2=ENABLED
+_rx_fifo3=ENABLED
+_rx_ficlk_rate0=100.0
+_rx_ficlk_rate1=100.0
+_rx_ficlk_rate2=100.0
+_rx_ficlk_rate3=100.0
+_tdrv_ch0=0
+_tdrv_ch1=0
+_tdrv_ch2=0
+_tdrv_ch3=0
+_tx_pre0=DISABLED
+_tx_pre1=DISABLED
+_tx_pre2=DISABLED
+_tx_pre3=DISABLED
+_rterm_tx0=50
+_rterm_tx1=50
+_rterm_tx2=50
+_rterm_tx3=50
+_rx_eq0=DISABLED
+_rx_eq1=DISABLED
+_rx_eq2=DISABLED
+_rx_eq3=DISABLED
+_rterm_rx0=50
+_rterm_rx1=50
+_rterm_rx2=50
+_rterm_rx3=50
+_rx_dcc0=DC
+_rx_dcc1=DC
+_rx_dcc2=DC
+_rx_dcc3=DC
+_los_threshold_mode0=LOS_E
+_los_threshold_mode1=LOS_E
+_los_threshold_mode2=LOS_E
+_los_threshold_mode3=LOS_E
+_los_threshold_lo0=2
+_los_threshold_lo1=2
+_los_threshold_lo2=2
+_los_threshold_lo3=2
+_los_threshold_hi0=7
+_los_threshold_hi1=7
+_los_threshold_hi2=7
+_los_threshold_hi3=7
+_pll_term=50
+_pll_dcc=AC
+_pll_lol_set=0
+_tx_sb0=DISABLED
+_tx_sb1=DISABLED
+_tx_sb2=DISABLED
+_tx_sb3=DISABLED
+_tx_8b10b0=ENABLED
+_tx_8b10b1=ENABLED
+_tx_8b10b2=ENABLED
+_tx_8b10b3=ENABLED
+_rx_sb0=DISABLED
+_rx_sb1=DISABLED
+_rx_sb2=DISABLED
+_rx_sb3=DISABLED
+_ird0=DISABLED
+_ird1=DISABLED
+_ird2=DISABLED
+_ird3=DISABLED
+_rx_8b10b0=ENABLED
+_rx_8b10b1=ENABLED
+_rx_8b10b2=ENABLED
+_rx_8b10b3=ENABLED
+_rxwa0=ENABLED
+_rxwa1=ENABLED
+_rxwa2=ENABLED
+_rxwa3=ENABLED
+_ilsm0=ENABLED
+_ilsm1=ENABLED
+_ilsm2=ENABLED
+_ilsm3=ENABLED
+_scomma0=K28P157
+_scomma1=K28P157
+_scomma2=K28P157
+_scomma3=K28P157
+_comma_a0=1100000101
+_comma_a1=1100000101
+_comma_a2=1100000101
+_comma_a3=1100000101
+_comma_b0=0011111010
+_comma_b1=0011111010
+_comma_b2=0011111010
+_comma_b3=0011111010
+_comma_m0=1111111100
+_comma_m1=1111111100
+_comma_m2=1111111100
+_comma_m3=1111111100
+_ctc0=ENABLED
+_ctc1=ENABLED
+_ctc2=ENABLED
+_ctc3=ENABLED
+_cc_match_mode0=2
+_cc_match_mode1=2
+_cc_match_mode2=2
+_cc_match_mode3=2
+_k00=01
+_k01=01
+_k02=01
+_k03=01
+_k10=00
+_k11=00
+_k12=00
+_k13=00
+_k20=01
+_k21=01
+_k22=01
+_k23=01
+_k30=01
+_k31=01
+_k32=01
+_k33=01
+_byten00=10111100
+_byten01=10111100
+_byten02=10111100
+_byten03=10111100
+_byten10=01010000
+_byten11=01010000
+_byten12=01010000
+_byten13=01010000
+_byten20=00011100
+_byten21=00011100
+_byten22=00011100
+_byten23=00011100
+_byten30=00011100
+_byten31=00011100
+_byten32=00011100
+_byten33=00011100
+_cc_min_ipg0=3
+_cc_min_ipg1=3
+_cc_min_ipg2=3
+_cc_min_ipg3=3
+_cchmark=9
+_cclmark=7
+_loopback=DISABLED
+_lbtype0=DISABLED
+_lbtype1=DISABLED
+_lbtype2=DISABLED
+_lbtype3=DISABLED
+_teidle_ch0=DISABLED
+_teidle_ch1=DISABLED
+_teidle_ch2=DISABLED
+_teidle_ch3=DISABLED
+_rst_gen=ENABLED
+_rx_los_port0=Internal
+_rx_los_port1=Internal
+_rx_los_port2=Internal
+_rx_los_port3=Internal
+_sci_ports=ENABLED
+_sci_int_port=DISABLED
+_refck2core=ENABLED
+Regen=auto
+PAR1=0
+PARTrace1=0
+PAR3=0
+PARTrace3=0
+
+[FilesGenerated]
+serdes_full_ctc.pp=pp
+serdes_full_ctc.tft=tft
+serdes_full_ctc.txt=pcs_module
+serdes_full_ctc.sym=sym
diff --git a/media_interfaces/ecp3_sfp/serdes_full_ctc.txt b/media_interfaces/ecp3_sfp/serdes_full_ctc.txt
new file mode 100644 (file)
index 0000000..1dcbae2
--- /dev/null
@@ -0,0 +1,167 @@
+# This file is used by the simulation model as well as the ispLEVER bitstream
+# generation process to automatically initialize the PCSD quad to the mode
+# selected in the IPexpress. This file is expected to be modified by the
+# end user to adjust the PCSD quad to the final design requirements.
+
+DEVICE_NAME "LFE3-150EA"
+CH0_PROTOCOL            "G8B10B"
+CH1_PROTOCOL            "G8B10B"
+CH2_PROTOCOL            "G8B10B"
+CH3_PROTOCOL            "G8B10B"
+CH0_MODE                "RXTX"
+CH1_MODE                "RXTX"
+CH2_MODE                "RXTX"
+CH3_MODE                "RXTX"
+CH0_CDR_SRC       "REFCLK_CORE"
+CH1_CDR_SRC       "REFCLK_CORE"
+CH2_CDR_SRC       "REFCLK_CORE"
+CH3_CDR_SRC       "REFCLK_CORE"
+PLL_SRC                 "REFCLK_CORE"
+TX_DATARATE_RANGE       "MEDHIGH"
+CH0_RX_DATARATE_RANGE   "MEDHIGH"
+CH1_RX_DATARATE_RANGE   "MEDHIGH"
+CH2_RX_DATARATE_RANGE   "MEDHIGH"
+CH3_RX_DATARATE_RANGE   "MEDHIGH"
+REFCK_MULT              "10X"
+#REFCLK_RATE            200.0
+CH0_RX_DATA_RATE        "FULL"
+CH1_RX_DATA_RATE        "FULL"
+CH2_RX_DATA_RATE        "FULL"
+CH3_RX_DATA_RATE        "FULL"
+CH0_TX_DATA_RATE        "FULL"
+CH1_TX_DATA_RATE        "FULL"
+CH2_TX_DATA_RATE        "FULL"
+CH3_TX_DATA_RATE        "FULL"
+CH0_TX_DATA_WIDTH       "16"
+CH1_TX_DATA_WIDTH       "16"
+CH2_TX_DATA_WIDTH       "16"
+CH3_TX_DATA_WIDTH       "16"
+CH0_RX_DATA_WIDTH        "16"
+CH1_RX_DATA_WIDTH        "16"
+CH2_RX_DATA_WIDTH        "16"
+CH3_RX_DATA_WIDTH        "16"
+CH0_TX_FIFO       "ENABLED"
+CH1_TX_FIFO       "ENABLED"
+CH2_TX_FIFO       "ENABLED"
+CH3_TX_FIFO       "ENABLED"
+CH0_RX_FIFO        "ENABLED"
+CH1_RX_FIFO        "ENABLED"
+CH2_RX_FIFO        "ENABLED"
+CH3_RX_FIFO        "ENABLED"
+CH0_TDRV      "0"
+CH1_TDRV      "0"
+CH2_TDRV      "0"
+CH3_TDRV      "0"
+#CH0_TX_FICLK_RATE      100.0
+#CH1_TX_FICLK_RATE      100.0
+#CH2_TX_FICLK_RATE      100.0
+#CH3_TX_FICLK_RATE      100.0
+#CH0_RXREFCLK_RATE        "200.0"
+#CH1_RXREFCLK_RATE        "200.0"
+#CH2_RXREFCLK_RATE        "200.0"
+#CH3_RXREFCLK_RATE        "200.0"
+#CH0_RX_FICLK_RATE      100.0
+#CH1_RX_FICLK_RATE      100.0
+#CH2_RX_FICLK_RATE      100.0
+#CH3_RX_FICLK_RATE      100.0
+CH0_TX_PRE              "DISABLED"
+CH1_TX_PRE              "DISABLED"
+CH2_TX_PRE              "DISABLED"
+CH3_TX_PRE              "DISABLED"
+CH0_RTERM_TX            "50"
+CH1_RTERM_TX            "50"
+CH2_RTERM_TX            "50"
+CH3_RTERM_TX            "50"
+CH0_RX_EQ               "DISABLED"
+CH1_RX_EQ               "DISABLED"
+CH2_RX_EQ               "DISABLED"
+CH3_RX_EQ               "DISABLED"
+CH0_RTERM_RX            "50"
+CH1_RTERM_RX            "50"
+CH2_RTERM_RX            "50"
+CH3_RTERM_RX            "50"
+CH0_RX_DCC              "DC"
+CH1_RX_DCC              "DC"
+CH2_RX_DCC              "DC"
+CH3_RX_DCC              "DC"
+CH0_LOS_THRESHOLD_LO       "2"
+CH1_LOS_THRESHOLD_LO       "2"
+CH2_LOS_THRESHOLD_LO       "2"
+CH3_LOS_THRESHOLD_LO       "2"
+PLL_TERM                "50"
+PLL_DCC                 "AC"
+PLL_LOL_SET             "0"
+CH0_TX_SB               "DISABLED"
+CH1_TX_SB               "DISABLED"
+CH2_TX_SB               "DISABLED"
+CH3_TX_SB               "DISABLED"
+CH0_RX_SB               "DISABLED"
+CH1_RX_SB               "DISABLED"
+CH2_RX_SB               "DISABLED"
+CH3_RX_SB               "DISABLED"
+CH0_TX_8B10B            "ENABLED"
+CH1_TX_8B10B            "ENABLED"
+CH2_TX_8B10B            "ENABLED"
+CH3_TX_8B10B            "ENABLED"
+CH0_RX_8B10B            "ENABLED"
+CH1_RX_8B10B            "ENABLED"
+CH2_RX_8B10B            "ENABLED"
+CH3_RX_8B10B            "ENABLED"
+CH0_COMMA_A             "1100000101"
+CH1_COMMA_A             "1100000101"
+CH2_COMMA_A             "1100000101"
+CH3_COMMA_A             "1100000101"
+CH0_COMMA_B             "0011111010"
+CH1_COMMA_B             "0011111010"
+CH2_COMMA_B             "0011111010"
+CH3_COMMA_B             "0011111010"
+CH0_COMMA_M             "1111111100"
+CH1_COMMA_M             "1111111100"
+CH2_COMMA_M             "1111111100"
+CH3_COMMA_M             "1111111100"
+CH0_RXWA                "ENABLED"
+CH1_RXWA                "ENABLED"
+CH2_RXWA                "ENABLED"
+CH3_RXWA                "ENABLED"
+CH0_ILSM                "ENABLED"
+CH1_ILSM                "ENABLED"
+CH2_ILSM                "ENABLED"
+CH3_ILSM                "ENABLED"
+CH0_CTC                 "ENABLED"
+CH1_CTC                 "ENABLED"
+CH2_CTC                 "ENABLED"
+CH3_CTC                 "ENABLED"
+CH0_CC_MATCH3           "0110111100"
+CH0_CC_MATCH4           "0001010000"
+CH1_CC_MATCH3           "0110111100"
+CH1_CC_MATCH4           "0001010000"
+CH2_CC_MATCH3           "0110111100"
+CH2_CC_MATCH4           "0001010000"
+CH3_CC_MATCH3           "0110111100"
+CH3_CC_MATCH4           "0001010000"
+CH0_CC_MATCH_MODE       "2"
+CH1_CC_MATCH_MODE       "2"
+CH2_CC_MATCH_MODE       "2"
+CH3_CC_MATCH_MODE       "2"
+CH0_CC_MIN_IPG          "3"
+CH1_CC_MIN_IPG          "3"
+CH2_CC_MIN_IPG          "3"
+CH3_CC_MIN_IPG          "3"
+CCHMARK                 "9"
+CCLMARK                 "7"
+CH0_SSLB                "DISABLED"
+CH1_SSLB                "DISABLED"
+CH2_SSLB                "DISABLED"
+CH3_SSLB                "DISABLED"
+CH0_SPLBPORTS           "DISABLED"
+CH1_SPLBPORTS           "DISABLED"
+CH2_SPLBPORTS           "DISABLED"
+CH3_SPLBPORTS           "DISABLED"
+CH0_PCSLBPORTS          "DISABLED"
+CH1_PCSLBPORTS          "DISABLED"
+CH2_PCSLBPORTS          "DISABLED"
+CH3_PCSLBPORTS          "DISABLED"
+INT_ALL                 "DISABLED"
+QD_REFCK2CORE           "ENABLED"
+
+
diff --git a/media_interfaces/ecp3_sfp/serdes_full_ctc.vhd b/media_interfaces/ecp3_sfp/serdes_full_ctc.vhd
new file mode 100644 (file)
index 0000000..3e484cb
--- /dev/null
@@ -0,0 +1,3317 @@
+
+                                                                                                         
+
+--synopsys translate_off
+
+library pcsd_work;
+use pcsd_work.all;
+library IEEE;
+use IEEE.std_logic_1164.all;
+
+entity PCSD is
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String := "REFCLK_EXT";
+  CH1_CDR_SRC   : String := "REFCLK_EXT";
+  CH2_CDR_SRC   : String := "REFCLK_EXT";
+  CH3_CDR_SRC   : String := "REFCLK_EXT";
+  PLL_SRC   : String
+--  CONFIG_FILE : String  := "serdes_full_ctc.txt";
+--  QUAD_MODE : String := "SINGLE";
+--  CH0_CDR_SRC   : String := "REFCLK_CORE";
+--  CH1_CDR_SRC   : String := "REFCLK_CORE";
+--  CH2_CDR_SRC   : String := "REFCLK_CORE";
+--  CH3_CDR_SRC   : String := "REFCLK_CORE";
+--  PLL_SRC   : String := "REFCLK_CORE"
+  );
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+
+end PCSD;
+
+architecture PCSD_arch of PCSD is
+
+
+component PCSD_sim
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String;
+  CH1_CDR_SRC   : String;
+  CH2_CDR_SRC   : String;
+  CH3_CDR_SRC   : String;
+  PLL_SRC   : String
+  );
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+end component;
+
+begin
+
+PCSD_sim_inst : PCSD_sim
+generic map (
+  CONFIG_FILE => CONFIG_FILE,
+  QUAD_MODE => QUAD_MODE,
+  CH0_CDR_SRC => CH0_CDR_SRC,
+  CH1_CDR_SRC => CH1_CDR_SRC,
+  CH2_CDR_SRC => CH2_CDR_SRC,
+  CH3_CDR_SRC => CH3_CDR_SRC,
+  PLL_SRC => PLL_SRC
+  )
+port map (
+   HDINN0 => HDINN0,
+   HDINN1 => HDINN1,
+   HDINN2 => HDINN2,
+   HDINN3 => HDINN3,
+   HDINP0 => HDINP0,
+   HDINP1 => HDINP1,
+   HDINP2 => HDINP2,
+   HDINP3 => HDINP3,
+   REFCLKN => REFCLKN,
+   REFCLKP => REFCLKP,
+   CIN11 => CIN11,
+   CIN10 => CIN10,
+   CIN9 => CIN9,
+   CIN8 => CIN8,
+   CIN7 => CIN7,
+   CIN6 => CIN6,
+   CIN5 => CIN5,
+   CIN4 => CIN4,
+   CIN3 => CIN3,
+   CIN2 => CIN2,
+   CIN1 => CIN1,
+   CIN0 => CIN0,
+   CYAWSTN => CYAWSTN,
+   FF_EBRD_CLK_3 => FF_EBRD_CLK_3,
+   FF_EBRD_CLK_2 => FF_EBRD_CLK_2,
+   FF_EBRD_CLK_1 => FF_EBRD_CLK_1,
+   FF_EBRD_CLK_0 => FF_EBRD_CLK_0,
+   FF_RXI_CLK_3 => FF_RXI_CLK_3,
+   FF_RXI_CLK_2 => FF_RXI_CLK_2,
+   FF_RXI_CLK_1 => FF_RXI_CLK_1,
+   FF_RXI_CLK_0 => FF_RXI_CLK_0,
+   FF_TX_D_0_0 => FF_TX_D_0_0,
+   FF_TX_D_0_1 => FF_TX_D_0_1,
+   FF_TX_D_0_2 => FF_TX_D_0_2,
+   FF_TX_D_0_3 => FF_TX_D_0_3,
+   FF_TX_D_0_4 => FF_TX_D_0_4,
+   FF_TX_D_0_5 => FF_TX_D_0_5,
+   FF_TX_D_0_6 => FF_TX_D_0_6,
+   FF_TX_D_0_7 => FF_TX_D_0_7,
+   FF_TX_D_0_8 => FF_TX_D_0_8,
+   FF_TX_D_0_9 => FF_TX_D_0_9,
+   FF_TX_D_0_10 => FF_TX_D_0_10,
+   FF_TX_D_0_11 => FF_TX_D_0_11,
+   FF_TX_D_0_12 => FF_TX_D_0_12,
+   FF_TX_D_0_13 => FF_TX_D_0_13,
+   FF_TX_D_0_14 => FF_TX_D_0_14,
+   FF_TX_D_0_15 => FF_TX_D_0_15,
+   FF_TX_D_0_16 => FF_TX_D_0_16,
+   FF_TX_D_0_17 => FF_TX_D_0_17,
+   FF_TX_D_0_18 => FF_TX_D_0_18,
+   FF_TX_D_0_19 => FF_TX_D_0_19,
+   FF_TX_D_0_20 => FF_TX_D_0_20,
+   FF_TX_D_0_21 => FF_TX_D_0_21,
+   FF_TX_D_0_22 => FF_TX_D_0_22,
+   FF_TX_D_0_23 => FF_TX_D_0_23,
+   FF_TX_D_1_0 => FF_TX_D_1_0,
+   FF_TX_D_1_1 => FF_TX_D_1_1,
+   FF_TX_D_1_2 => FF_TX_D_1_2,
+   FF_TX_D_1_3 => FF_TX_D_1_3,
+   FF_TX_D_1_4 => FF_TX_D_1_4,
+   FF_TX_D_1_5 => FF_TX_D_1_5,
+   FF_TX_D_1_6 => FF_TX_D_1_6,
+   FF_TX_D_1_7 => FF_TX_D_1_7,
+   FF_TX_D_1_8 => FF_TX_D_1_8,
+   FF_TX_D_1_9 => FF_TX_D_1_9,
+   FF_TX_D_1_10 => FF_TX_D_1_10,
+   FF_TX_D_1_11 => FF_TX_D_1_11,
+   FF_TX_D_1_12 => FF_TX_D_1_12,
+   FF_TX_D_1_13 => FF_TX_D_1_13,
+   FF_TX_D_1_14 => FF_TX_D_1_14,
+   FF_TX_D_1_15 => FF_TX_D_1_15,
+   FF_TX_D_1_16 => FF_TX_D_1_16,
+   FF_TX_D_1_17 => FF_TX_D_1_17,
+   FF_TX_D_1_18 => FF_TX_D_1_18,
+   FF_TX_D_1_19 => FF_TX_D_1_19,
+   FF_TX_D_1_20 => FF_TX_D_1_20,
+   FF_TX_D_1_21 => FF_TX_D_1_21,
+   FF_TX_D_1_22 => FF_TX_D_1_22,
+   FF_TX_D_1_23 => FF_TX_D_1_23,
+   FF_TX_D_2_0 => FF_TX_D_2_0,
+   FF_TX_D_2_1 => FF_TX_D_2_1,
+   FF_TX_D_2_2 => FF_TX_D_2_2,
+   FF_TX_D_2_3 => FF_TX_D_2_3,
+   FF_TX_D_2_4 => FF_TX_D_2_4,
+   FF_TX_D_2_5 => FF_TX_D_2_5,
+   FF_TX_D_2_6 => FF_TX_D_2_6,
+   FF_TX_D_2_7 => FF_TX_D_2_7,
+   FF_TX_D_2_8 => FF_TX_D_2_8,
+   FF_TX_D_2_9 => FF_TX_D_2_9,
+   FF_TX_D_2_10 => FF_TX_D_2_10,
+   FF_TX_D_2_11 => FF_TX_D_2_11,
+   FF_TX_D_2_12 => FF_TX_D_2_12,
+   FF_TX_D_2_13 => FF_TX_D_2_13,
+   FF_TX_D_2_14 => FF_TX_D_2_14,
+   FF_TX_D_2_15 => FF_TX_D_2_15,
+   FF_TX_D_2_16 => FF_TX_D_2_16,
+   FF_TX_D_2_17 => FF_TX_D_2_17,
+   FF_TX_D_2_18 => FF_TX_D_2_18,
+   FF_TX_D_2_19 => FF_TX_D_2_19,
+   FF_TX_D_2_20 => FF_TX_D_2_20,
+   FF_TX_D_2_21 => FF_TX_D_2_21,
+   FF_TX_D_2_22 => FF_TX_D_2_22,
+   FF_TX_D_2_23 => FF_TX_D_2_23,
+   FF_TX_D_3_0 => FF_TX_D_3_0,
+   FF_TX_D_3_1 => FF_TX_D_3_1,
+   FF_TX_D_3_2 => FF_TX_D_3_2,
+   FF_TX_D_3_3 => FF_TX_D_3_3,
+   FF_TX_D_3_4 => FF_TX_D_3_4,
+   FF_TX_D_3_5 => FF_TX_D_3_5,
+   FF_TX_D_3_6 => FF_TX_D_3_6,
+   FF_TX_D_3_7 => FF_TX_D_3_7,
+   FF_TX_D_3_8 => FF_TX_D_3_8,
+   FF_TX_D_3_9 => FF_TX_D_3_9,
+   FF_TX_D_3_10 => FF_TX_D_3_10,
+   FF_TX_D_3_11 => FF_TX_D_3_11,
+   FF_TX_D_3_12 => FF_TX_D_3_12,
+   FF_TX_D_3_13 => FF_TX_D_3_13,
+   FF_TX_D_3_14 => FF_TX_D_3_14,
+   FF_TX_D_3_15 => FF_TX_D_3_15,
+   FF_TX_D_3_16 => FF_TX_D_3_16,
+   FF_TX_D_3_17 => FF_TX_D_3_17,
+   FF_TX_D_3_18 => FF_TX_D_3_18,
+   FF_TX_D_3_19 => FF_TX_D_3_19,
+   FF_TX_D_3_20 => FF_TX_D_3_20,
+   FF_TX_D_3_21 => FF_TX_D_3_21,
+   FF_TX_D_3_22 => FF_TX_D_3_22,
+   FF_TX_D_3_23 => FF_TX_D_3_23,
+   FF_TXI_CLK_0 => FF_TXI_CLK_0,
+   FF_TXI_CLK_1 => FF_TXI_CLK_1,
+   FF_TXI_CLK_2 => FF_TXI_CLK_2,
+   FF_TXI_CLK_3 => FF_TXI_CLK_3,
+   FFC_CK_CORE_RX_0 => FFC_CK_CORE_RX_0,
+   FFC_CK_CORE_RX_1 => FFC_CK_CORE_RX_1,
+   FFC_CK_CORE_RX_2 => FFC_CK_CORE_RX_2,
+   FFC_CK_CORE_RX_3 => FFC_CK_CORE_RX_3,
+   FFC_CK_CORE_TX => FFC_CK_CORE_TX,
+   FFC_EI_EN_0 => FFC_EI_EN_0,
+   FFC_EI_EN_1 => FFC_EI_EN_1,
+   FFC_EI_EN_2 => FFC_EI_EN_2,
+   FFC_EI_EN_3 => FFC_EI_EN_3,
+   FFC_ENABLE_CGALIGN_0 => FFC_ENABLE_CGALIGN_0,
+   FFC_ENABLE_CGALIGN_1 => FFC_ENABLE_CGALIGN_1,
+   FFC_ENABLE_CGALIGN_2 => FFC_ENABLE_CGALIGN_2,
+   FFC_ENABLE_CGALIGN_3 => FFC_ENABLE_CGALIGN_3,
+   FFC_FB_LOOPBACK_0 => FFC_FB_LOOPBACK_0,
+   FFC_FB_LOOPBACK_1 => FFC_FB_LOOPBACK_1,
+   FFC_FB_LOOPBACK_2 => FFC_FB_LOOPBACK_2,
+   FFC_FB_LOOPBACK_3 => FFC_FB_LOOPBACK_3,
+   FFC_LANE_RX_RST_0 => FFC_LANE_RX_RST_0,
+   FFC_LANE_RX_RST_1 => FFC_LANE_RX_RST_1,
+   FFC_LANE_RX_RST_2 => FFC_LANE_RX_RST_2,
+   FFC_LANE_RX_RST_3 => FFC_LANE_RX_RST_3,
+   FFC_LANE_TX_RST_0 => FFC_LANE_TX_RST_0,
+   FFC_LANE_TX_RST_1 => FFC_LANE_TX_RST_1,
+   FFC_LANE_TX_RST_2 => FFC_LANE_TX_RST_2,
+   FFC_LANE_TX_RST_3 => FFC_LANE_TX_RST_3,
+   FFC_MACRO_RST => FFC_MACRO_RST,
+   FFC_PCI_DET_EN_0 => FFC_PCI_DET_EN_0,
+   FFC_PCI_DET_EN_1 => FFC_PCI_DET_EN_1,
+   FFC_PCI_DET_EN_2 => FFC_PCI_DET_EN_2,
+   FFC_PCI_DET_EN_3 => FFC_PCI_DET_EN_3,
+   FFC_PCIE_CT_0 => FFC_PCIE_CT_0,
+   FFC_PCIE_CT_1 => FFC_PCIE_CT_1,
+   FFC_PCIE_CT_2 => FFC_PCIE_CT_2,
+   FFC_PCIE_CT_3 => FFC_PCIE_CT_3,
+   FFC_PFIFO_CLR_0 => FFC_PFIFO_CLR_0,
+   FFC_PFIFO_CLR_1 => FFC_PFIFO_CLR_1,
+   FFC_PFIFO_CLR_2 => FFC_PFIFO_CLR_2,
+   FFC_PFIFO_CLR_3 => FFC_PFIFO_CLR_3,
+   FFC_QUAD_RST => FFC_QUAD_RST,
+   FFC_RRST_0 => FFC_RRST_0,
+   FFC_RRST_1 => FFC_RRST_1,
+   FFC_RRST_2 => FFC_RRST_2,
+   FFC_RRST_3 => FFC_RRST_3,
+   FFC_RXPWDNB_0 => FFC_RXPWDNB_0,
+   FFC_RXPWDNB_1 => FFC_RXPWDNB_1,
+   FFC_RXPWDNB_2 => FFC_RXPWDNB_2,
+   FFC_RXPWDNB_3 => FFC_RXPWDNB_3,
+   FFC_SB_INV_RX_0 => FFC_SB_INV_RX_0,
+   FFC_SB_INV_RX_1 => FFC_SB_INV_RX_1,
+   FFC_SB_INV_RX_2 => FFC_SB_INV_RX_2,
+   FFC_SB_INV_RX_3 => FFC_SB_INV_RX_3,
+   FFC_SB_PFIFO_LP_0 => FFC_SB_PFIFO_LP_0,
+   FFC_SB_PFIFO_LP_1 => FFC_SB_PFIFO_LP_1,
+   FFC_SB_PFIFO_LP_2 => FFC_SB_PFIFO_LP_2,
+   FFC_SB_PFIFO_LP_3 => FFC_SB_PFIFO_LP_3,
+   FFC_SIGNAL_DETECT_0 => FFC_SIGNAL_DETECT_0,
+   FFC_SIGNAL_DETECT_1 => FFC_SIGNAL_DETECT_1,
+   FFC_SIGNAL_DETECT_2 => FFC_SIGNAL_DETECT_2,
+   FFC_SIGNAL_DETECT_3 => FFC_SIGNAL_DETECT_3,
+   FFC_SYNC_TOGGLE => FFC_SYNC_TOGGLE,
+   FFC_TRST => FFC_TRST,
+   FFC_TXPWDNB_0 => FFC_TXPWDNB_0,
+   FFC_TXPWDNB_1 => FFC_TXPWDNB_1,
+   FFC_TXPWDNB_2 => FFC_TXPWDNB_2,
+   FFC_TXPWDNB_3 => FFC_TXPWDNB_3,
+   FFC_RATE_MODE_RX_0 => FFC_RATE_MODE_RX_0,
+   FFC_RATE_MODE_RX_1 => FFC_RATE_MODE_RX_1,
+   FFC_RATE_MODE_RX_2 => FFC_RATE_MODE_RX_2,
+   FFC_RATE_MODE_RX_3 => FFC_RATE_MODE_RX_3,
+   FFC_RATE_MODE_TX_0 => FFC_RATE_MODE_TX_0,
+   FFC_RATE_MODE_TX_1 => FFC_RATE_MODE_TX_1,
+   FFC_RATE_MODE_TX_2 => FFC_RATE_MODE_TX_2,
+   FFC_RATE_MODE_TX_3 => FFC_RATE_MODE_TX_3,
+   FFC_DIV11_MODE_RX_0 => FFC_DIV11_MODE_RX_0,
+   FFC_DIV11_MODE_RX_1 => FFC_DIV11_MODE_RX_1,
+   FFC_DIV11_MODE_RX_2 => FFC_DIV11_MODE_RX_2,
+   FFC_DIV11_MODE_RX_3 => FFC_DIV11_MODE_RX_3,
+   FFC_DIV11_MODE_TX_0 => FFC_DIV11_MODE_TX_0,
+   FFC_DIV11_MODE_TX_1 => FFC_DIV11_MODE_TX_1,
+   FFC_DIV11_MODE_TX_2 => FFC_DIV11_MODE_TX_2,
+   FFC_DIV11_MODE_TX_3 => FFC_DIV11_MODE_TX_3,
+   LDR_CORE2TX_0 => LDR_CORE2TX_0,
+   LDR_CORE2TX_1 => LDR_CORE2TX_1,
+   LDR_CORE2TX_2 => LDR_CORE2TX_2,
+   LDR_CORE2TX_3 => LDR_CORE2TX_3,
+   FFC_LDR_CORE2TX_EN_0 => FFC_LDR_CORE2TX_EN_0,
+   FFC_LDR_CORE2TX_EN_1 => FFC_LDR_CORE2TX_EN_1,
+   FFC_LDR_CORE2TX_EN_2 => FFC_LDR_CORE2TX_EN_2,
+   FFC_LDR_CORE2TX_EN_3 => FFC_LDR_CORE2TX_EN_3,
+   PCIE_POWERDOWN_0_0 => PCIE_POWERDOWN_0_0,
+   PCIE_POWERDOWN_0_1 => PCIE_POWERDOWN_0_1,
+   PCIE_POWERDOWN_1_0 => PCIE_POWERDOWN_1_0,
+   PCIE_POWERDOWN_1_1 => PCIE_POWERDOWN_1_1,
+   PCIE_POWERDOWN_2_0 => PCIE_POWERDOWN_2_0,
+   PCIE_POWERDOWN_2_1 => PCIE_POWERDOWN_2_1,
+   PCIE_POWERDOWN_3_0 => PCIE_POWERDOWN_3_0,
+   PCIE_POWERDOWN_3_1 => PCIE_POWERDOWN_3_1,
+   PCIE_RXPOLARITY_0 => PCIE_RXPOLARITY_0,
+   PCIE_RXPOLARITY_1 => PCIE_RXPOLARITY_1,
+   PCIE_RXPOLARITY_2 => PCIE_RXPOLARITY_2,
+   PCIE_RXPOLARITY_3 => PCIE_RXPOLARITY_3,
+   PCIE_TXCOMPLIANCE_0 => PCIE_TXCOMPLIANCE_0,
+   PCIE_TXCOMPLIANCE_1 => PCIE_TXCOMPLIANCE_1,
+   PCIE_TXCOMPLIANCE_2 => PCIE_TXCOMPLIANCE_2,
+   PCIE_TXCOMPLIANCE_3 => PCIE_TXCOMPLIANCE_3,
+   PCIE_TXDETRX_PR2TLB_0 => PCIE_TXDETRX_PR2TLB_0,
+   PCIE_TXDETRX_PR2TLB_1 => PCIE_TXDETRX_PR2TLB_1,
+   PCIE_TXDETRX_PR2TLB_2 => PCIE_TXDETRX_PR2TLB_2,
+   PCIE_TXDETRX_PR2TLB_3 => PCIE_TXDETRX_PR2TLB_3,
+   SCIADDR0 => SCIADDR0,
+   SCIADDR1 => SCIADDR1,
+   SCIADDR2 => SCIADDR2,
+   SCIADDR3 => SCIADDR3,
+   SCIADDR4 => SCIADDR4,
+   SCIADDR5 => SCIADDR5,
+   SCIENAUX => SCIENAUX,
+   SCIENCH0 => SCIENCH0,
+   SCIENCH1 => SCIENCH1,
+   SCIENCH2 => SCIENCH2,
+   SCIENCH3 => SCIENCH3,
+   SCIRD => SCIRD,
+   SCISELAUX => SCISELAUX,
+   SCISELCH0 => SCISELCH0,
+   SCISELCH1 => SCISELCH1,
+   SCISELCH2 => SCISELCH2,
+   SCISELCH3 => SCISELCH3,
+   SCIWDATA0 => SCIWDATA0,
+   SCIWDATA1 => SCIWDATA1,
+   SCIWDATA2 => SCIWDATA2,
+   SCIWDATA3 => SCIWDATA3,
+   SCIWDATA4 => SCIWDATA4,
+   SCIWDATA5 => SCIWDATA5,
+   SCIWDATA6 => SCIWDATA6,
+   SCIWDATA7 => SCIWDATA7,
+   SCIWSTN => SCIWSTN,
+   HDOUTN0 => HDOUTN0,
+   HDOUTN1 => HDOUTN1,
+   HDOUTN2 => HDOUTN2,
+   HDOUTN3 => HDOUTN3,
+   HDOUTP0 => HDOUTP0,
+   HDOUTP1 => HDOUTP1,
+   HDOUTP2 => HDOUTP2,
+   HDOUTP3 => HDOUTP3,
+   COUT19 => COUT19,
+   COUT18 => COUT18,
+   COUT17 => COUT17,
+   COUT16 => COUT16,
+   COUT15 => COUT15,
+   COUT14 => COUT14,
+   COUT13 => COUT13,
+   COUT12 => COUT12,
+   COUT11 => COUT11,
+   COUT10 => COUT10,
+   COUT9 => COUT9,
+   COUT8 => COUT8,
+   COUT7 => COUT7,
+   COUT6 => COUT6,
+   COUT5 => COUT5,
+   COUT4 => COUT4,
+   COUT3 => COUT3,
+   COUT2 => COUT2,
+   COUT1 => COUT1,
+   COUT0 => COUT0,
+   FF_RX_D_0_0 => FF_RX_D_0_0,
+   FF_RX_D_0_1 => FF_RX_D_0_1,
+   FF_RX_D_0_2 => FF_RX_D_0_2,
+   FF_RX_D_0_3 => FF_RX_D_0_3,
+   FF_RX_D_0_4 => FF_RX_D_0_4,
+   FF_RX_D_0_5 => FF_RX_D_0_5,
+   FF_RX_D_0_6 => FF_RX_D_0_6,
+   FF_RX_D_0_7 => FF_RX_D_0_7,
+   FF_RX_D_0_8 => FF_RX_D_0_8,
+   FF_RX_D_0_9 => FF_RX_D_0_9,
+   FF_RX_D_0_10 => FF_RX_D_0_10,
+   FF_RX_D_0_11 => FF_RX_D_0_11,
+   FF_RX_D_0_12 => FF_RX_D_0_12,
+   FF_RX_D_0_13 => FF_RX_D_0_13,
+   FF_RX_D_0_14 => FF_RX_D_0_14,
+   FF_RX_D_0_15 => FF_RX_D_0_15,
+   FF_RX_D_0_16 => FF_RX_D_0_16,
+   FF_RX_D_0_17 => FF_RX_D_0_17,
+   FF_RX_D_0_18 => FF_RX_D_0_18,
+   FF_RX_D_0_19 => FF_RX_D_0_19,
+   FF_RX_D_0_20 => FF_RX_D_0_20,
+   FF_RX_D_0_21 => FF_RX_D_0_21,
+   FF_RX_D_0_22 => FF_RX_D_0_22,
+   FF_RX_D_0_23 => FF_RX_D_0_23,
+   FF_RX_D_1_0 => FF_RX_D_1_0,
+   FF_RX_D_1_1 => FF_RX_D_1_1,
+   FF_RX_D_1_2 => FF_RX_D_1_2,
+   FF_RX_D_1_3 => FF_RX_D_1_3,
+   FF_RX_D_1_4 => FF_RX_D_1_4,
+   FF_RX_D_1_5 => FF_RX_D_1_5,
+   FF_RX_D_1_6 => FF_RX_D_1_6,
+   FF_RX_D_1_7 => FF_RX_D_1_7,
+   FF_RX_D_1_8 => FF_RX_D_1_8,
+   FF_RX_D_1_9 => FF_RX_D_1_9,
+   FF_RX_D_1_10 => FF_RX_D_1_10,
+   FF_RX_D_1_11 => FF_RX_D_1_11,
+   FF_RX_D_1_12 => FF_RX_D_1_12,
+   FF_RX_D_1_13 => FF_RX_D_1_13,
+   FF_RX_D_1_14 => FF_RX_D_1_14,
+   FF_RX_D_1_15 => FF_RX_D_1_15,
+   FF_RX_D_1_16 => FF_RX_D_1_16,
+   FF_RX_D_1_17 => FF_RX_D_1_17,
+   FF_RX_D_1_18 => FF_RX_D_1_18,
+   FF_RX_D_1_19 => FF_RX_D_1_19,
+   FF_RX_D_1_20 => FF_RX_D_1_20,
+   FF_RX_D_1_21 => FF_RX_D_1_21,
+   FF_RX_D_1_22 => FF_RX_D_1_22,
+   FF_RX_D_1_23 => FF_RX_D_1_23,
+   FF_RX_D_2_0 => FF_RX_D_2_0,
+   FF_RX_D_2_1 => FF_RX_D_2_1,
+   FF_RX_D_2_2 => FF_RX_D_2_2,
+   FF_RX_D_2_3 => FF_RX_D_2_3,
+   FF_RX_D_2_4 => FF_RX_D_2_4,
+   FF_RX_D_2_5 => FF_RX_D_2_5,
+   FF_RX_D_2_6 => FF_RX_D_2_6,
+   FF_RX_D_2_7 => FF_RX_D_2_7,
+   FF_RX_D_2_8 => FF_RX_D_2_8,
+   FF_RX_D_2_9 => FF_RX_D_2_9,
+   FF_RX_D_2_10 => FF_RX_D_2_10,
+   FF_RX_D_2_11 => FF_RX_D_2_11,
+   FF_RX_D_2_12 => FF_RX_D_2_12,
+   FF_RX_D_2_13 => FF_RX_D_2_13,
+   FF_RX_D_2_14 => FF_RX_D_2_14,
+   FF_RX_D_2_15 => FF_RX_D_2_15,
+   FF_RX_D_2_16 => FF_RX_D_2_16,
+   FF_RX_D_2_17 => FF_RX_D_2_17,
+   FF_RX_D_2_18 => FF_RX_D_2_18,
+   FF_RX_D_2_19 => FF_RX_D_2_19,
+   FF_RX_D_2_20 => FF_RX_D_2_20,
+   FF_RX_D_2_21 => FF_RX_D_2_21,
+   FF_RX_D_2_22 => FF_RX_D_2_22,
+   FF_RX_D_2_23 => FF_RX_D_2_23,
+   FF_RX_D_3_0 => FF_RX_D_3_0,
+   FF_RX_D_3_1 => FF_RX_D_3_1,
+   FF_RX_D_3_2 => FF_RX_D_3_2,
+   FF_RX_D_3_3 => FF_RX_D_3_3,
+   FF_RX_D_3_4 => FF_RX_D_3_4,
+   FF_RX_D_3_5 => FF_RX_D_3_5,
+   FF_RX_D_3_6 => FF_RX_D_3_6,
+   FF_RX_D_3_7 => FF_RX_D_3_7,
+   FF_RX_D_3_8 => FF_RX_D_3_8,
+   FF_RX_D_3_9 => FF_RX_D_3_9,
+   FF_RX_D_3_10 => FF_RX_D_3_10,
+   FF_RX_D_3_11 => FF_RX_D_3_11,
+   FF_RX_D_3_12 => FF_RX_D_3_12,
+   FF_RX_D_3_13 => FF_RX_D_3_13,
+   FF_RX_D_3_14 => FF_RX_D_3_14,
+   FF_RX_D_3_15 => FF_RX_D_3_15,
+   FF_RX_D_3_16 => FF_RX_D_3_16,
+   FF_RX_D_3_17 => FF_RX_D_3_17,
+   FF_RX_D_3_18 => FF_RX_D_3_18,
+   FF_RX_D_3_19 => FF_RX_D_3_19,
+   FF_RX_D_3_20 => FF_RX_D_3_20,
+   FF_RX_D_3_21 => FF_RX_D_3_21,
+   FF_RX_D_3_22 => FF_RX_D_3_22,
+   FF_RX_D_3_23 => FF_RX_D_3_23,
+   FF_RX_F_CLK_0 => FF_RX_F_CLK_0,
+   FF_RX_F_CLK_1 => FF_RX_F_CLK_1,
+   FF_RX_F_CLK_2 => FF_RX_F_CLK_2,
+   FF_RX_F_CLK_3 => FF_RX_F_CLK_3,
+   FF_RX_H_CLK_0 => FF_RX_H_CLK_0,
+   FF_RX_H_CLK_1 => FF_RX_H_CLK_1,
+   FF_RX_H_CLK_2 => FF_RX_H_CLK_2,
+   FF_RX_H_CLK_3 => FF_RX_H_CLK_3,
+   FF_TX_F_CLK_0 => FF_TX_F_CLK_0,
+   FF_TX_F_CLK_1 => FF_TX_F_CLK_1,
+   FF_TX_F_CLK_2 => FF_TX_F_CLK_2,
+   FF_TX_F_CLK_3 => FF_TX_F_CLK_3,
+   FF_TX_H_CLK_0 => FF_TX_H_CLK_0,
+   FF_TX_H_CLK_1 => FF_TX_H_CLK_1,
+   FF_TX_H_CLK_2 => FF_TX_H_CLK_2,
+   FF_TX_H_CLK_3 => FF_TX_H_CLK_3,
+   FFS_CC_OVERRUN_0 => FFS_CC_OVERRUN_0,
+   FFS_CC_OVERRUN_1 => FFS_CC_OVERRUN_1,
+   FFS_CC_OVERRUN_2 => FFS_CC_OVERRUN_2,
+   FFS_CC_OVERRUN_3 => FFS_CC_OVERRUN_3,
+   FFS_CC_UNDERRUN_0 => FFS_CC_UNDERRUN_0,
+   FFS_CC_UNDERRUN_1 => FFS_CC_UNDERRUN_1,
+   FFS_CC_UNDERRUN_2 => FFS_CC_UNDERRUN_2,
+   FFS_CC_UNDERRUN_3 => FFS_CC_UNDERRUN_3,
+   FFS_LS_SYNC_STATUS_0 => FFS_LS_SYNC_STATUS_0,
+   FFS_LS_SYNC_STATUS_1 => FFS_LS_SYNC_STATUS_1,
+   FFS_LS_SYNC_STATUS_2 => FFS_LS_SYNC_STATUS_2,
+   FFS_LS_SYNC_STATUS_3 => FFS_LS_SYNC_STATUS_3,
+   FFS_CDR_TRAIN_DONE_0 => FFS_CDR_TRAIN_DONE_0,
+   FFS_CDR_TRAIN_DONE_1 => FFS_CDR_TRAIN_DONE_1,
+   FFS_CDR_TRAIN_DONE_2 => FFS_CDR_TRAIN_DONE_2,
+   FFS_CDR_TRAIN_DONE_3 => FFS_CDR_TRAIN_DONE_3,
+   FFS_PCIE_CON_0 => FFS_PCIE_CON_0,
+   FFS_PCIE_CON_1 => FFS_PCIE_CON_1,
+   FFS_PCIE_CON_2 => FFS_PCIE_CON_2,
+   FFS_PCIE_CON_3 => FFS_PCIE_CON_3,
+   FFS_PCIE_DONE_0 => FFS_PCIE_DONE_0,
+   FFS_PCIE_DONE_1 => FFS_PCIE_DONE_1,
+   FFS_PCIE_DONE_2 => FFS_PCIE_DONE_2,
+   FFS_PCIE_DONE_3 => FFS_PCIE_DONE_3,
+   FFS_PLOL => FFS_PLOL,
+   FFS_RLOL_0 => FFS_RLOL_0,
+   FFS_RLOL_1 => FFS_RLOL_1,
+   FFS_RLOL_2 => FFS_RLOL_2,
+   FFS_RLOL_3 => FFS_RLOL_3,
+   FFS_RLOS_HI_0 => FFS_RLOS_HI_0,
+   FFS_RLOS_HI_1 => FFS_RLOS_HI_1,
+   FFS_RLOS_HI_2 => FFS_RLOS_HI_2,
+   FFS_RLOS_HI_3 => FFS_RLOS_HI_3,
+   FFS_RLOS_LO_0 => FFS_RLOS_LO_0,
+   FFS_RLOS_LO_1 => FFS_RLOS_LO_1,
+   FFS_RLOS_LO_2 => FFS_RLOS_LO_2,
+   FFS_RLOS_LO_3 => FFS_RLOS_LO_3,
+   FFS_RXFBFIFO_ERROR_0 => FFS_RXFBFIFO_ERROR_0,
+   FFS_RXFBFIFO_ERROR_1 => FFS_RXFBFIFO_ERROR_1,
+   FFS_RXFBFIFO_ERROR_2 => FFS_RXFBFIFO_ERROR_2,
+   FFS_RXFBFIFO_ERROR_3 => FFS_RXFBFIFO_ERROR_3,
+   FFS_TXFBFIFO_ERROR_0 => FFS_TXFBFIFO_ERROR_0,
+   FFS_TXFBFIFO_ERROR_1 => FFS_TXFBFIFO_ERROR_1,
+   FFS_TXFBFIFO_ERROR_2 => FFS_TXFBFIFO_ERROR_2,
+   FFS_TXFBFIFO_ERROR_3 => FFS_TXFBFIFO_ERROR_3,
+   PCIE_PHYSTATUS_0 => PCIE_PHYSTATUS_0,
+   PCIE_PHYSTATUS_1 => PCIE_PHYSTATUS_1,
+   PCIE_PHYSTATUS_2 => PCIE_PHYSTATUS_2,
+   PCIE_PHYSTATUS_3 => PCIE_PHYSTATUS_3,
+   PCIE_RXVALID_0 => PCIE_RXVALID_0,
+   PCIE_RXVALID_1 => PCIE_RXVALID_1,
+   PCIE_RXVALID_2 => PCIE_RXVALID_2,
+   PCIE_RXVALID_3 => PCIE_RXVALID_3,
+   FFS_SKP_ADDED_0 => FFS_SKP_ADDED_0,
+   FFS_SKP_ADDED_1 => FFS_SKP_ADDED_1,
+   FFS_SKP_ADDED_2 => FFS_SKP_ADDED_2,
+   FFS_SKP_ADDED_3 => FFS_SKP_ADDED_3,
+   FFS_SKP_DELETED_0 => FFS_SKP_DELETED_0,
+   FFS_SKP_DELETED_1 => FFS_SKP_DELETED_1,
+   FFS_SKP_DELETED_2 => FFS_SKP_DELETED_2,
+   FFS_SKP_DELETED_3 => FFS_SKP_DELETED_3,
+   LDR_RX2CORE_0 => LDR_RX2CORE_0,
+   LDR_RX2CORE_1 => LDR_RX2CORE_1,
+   LDR_RX2CORE_2 => LDR_RX2CORE_2,
+   LDR_RX2CORE_3 => LDR_RX2CORE_3,
+   REFCK2CORE => REFCK2CORE,
+   SCIINT => SCIINT,
+   SCIRDATA0 => SCIRDATA0,
+   SCIRDATA1 => SCIRDATA1,
+   SCIRDATA2 => SCIRDATA2,
+   SCIRDATA3 => SCIRDATA3,
+   SCIRDATA4 => SCIRDATA4,
+   SCIRDATA5 => SCIRDATA5,
+   SCIRDATA6 => SCIRDATA6,
+   SCIRDATA7 => SCIRDATA7,
+   REFCLK_FROM_NQ => REFCLK_FROM_NQ,
+   REFCLK_TO_NQ => REFCLK_TO_NQ
+   );
+
+end PCSD_arch;
+
+--synopsys translate_on
+
+--THIS MODULE IS INSTANTIATED PER RX CHANNEL
+--Reset Sequence Generator
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+                                                                                              
+entity serdes_full_ctcrx_reset_sm is
+generic (count_index: integer :=18);
+port (
+   rst_n       : in std_logic;
+   refclkdiv2        : in std_logic;
+   tx_pll_lol_qd_s   : in std_logic;
+   rx_serdes_rst_ch_c: out std_logic;
+   rx_cdr_lol_ch_s   : in std_logic;
+   rx_los_low_ch_s   : in std_logic;
+   rx_pcs_rst_ch_c   : out std_logic
+);
+end serdes_full_ctcrx_reset_sm ;
+                                                                                              
+architecture rx_reset_sm_arch of serdes_full_ctcrx_reset_sm is
+                                                                                              
+type statetype is (WAIT_FOR_PLOL, RX_SERDES_RESET, WAIT_FOR_TIMER1, CHECK_LOL_LOS, WAIT_FOR_TIMER2, NORMAL);
+                                                                                              
+signal   cs:      statetype;  -- current state of lsm
+signal   ns:      statetype;  -- next state of lsm
+                                                                                              
+signal   tx_pll_lol_qd_s_int: std_logic;
+signal   rx_los_low_int:         std_logic;
+signal   plol_los_int:        std_logic;
+signal   rx_lol_los  :  std_logic;
+signal   rx_lol_los_int:      std_logic;
+signal   rx_lol_los_del:      std_logic;
+signal   rx_pcs_rst_ch_c_int: std_logic;
+signal   rx_serdes_rst_ch_c_int: std_logic;
+                                                                                              
+signal   reset_timer1:  std_logic;
+signal   reset_timer2:  std_logic;
+                                                                                              
+signal   counter1:   std_logic_vector(1 downto 0);
+signal   TIMER1:  std_logic;
+                                                                                              
+signal   counter2: std_logic_vector(18 downto 0);
+signal   TIMER2   : std_logic;
+                                                                                              
+begin
+                                                                                              
+rx_lol_los <= rx_cdr_lol_ch_s or rx_los_low_ch_s ;
+                                                                                              
+process(refclkdiv2,rst_n)
+begin
+   if rising_edge(refclkdiv2) then
+      if rst_n = '0' then
+         cs <= WAIT_FOR_PLOL;
+         rx_lol_los_int <= '1';
+         rx_lol_los_del <= '1';
+         tx_pll_lol_qd_s_int <= '1';
+         rx_pcs_rst_ch_c <= '1';
+         rx_serdes_rst_ch_c <= '0';
+         rx_los_low_int <= '1';
+      else
+         cs <= ns;
+         rx_lol_los_del <= rx_lol_los;
+         rx_lol_los_int <= rx_lol_los_del;
+         tx_pll_lol_qd_s_int <= tx_pll_lol_qd_s;
+         rx_pcs_rst_ch_c <= rx_pcs_rst_ch_c_int;
+         rx_serdes_rst_ch_c <= rx_serdes_rst_ch_c_int;
+         rx_los_low_int <= rx_los_low_ch_s;
+      end if;
+   end if;
+end process;
+                                                                                              
+--TIMER1 = 3NS;
+--Fastest REFCLK = 312 MHz, or 3ns. We need 1 REFCLK cycles or 2 REFCLKDIV2 cycles
+--A 1 bit counter  counts 2 cycles, so a 2 bit ([1:0]) counter will do if we set TIMER1 = bit[1]
+                                                                                              
+process(refclkdiv2, reset_timer1)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer1 = '1' then
+         counter1 <= "00";
+         TIMER1 <= '0';
+      else
+         if counter1(1) = '1' then
+            TIMER1 <='1';
+         else
+            TIMER1 <='0';
+            counter1 <= counter1 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+--TIMER2 = 400,000 Refclk cycles or 200,000 REFCLKDIV2 cycles
+--An 18 bit counter ([17:0]) counts 262144 cycles, so a 19 bit ([18:0]) counter will do if we set TIMER2 = bit[18]
+                                                                                              
+process(refclkdiv2, reset_timer2)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer2 = '1' then
+         counter2 <= "0000000000000000000";
+         TIMER2 <= '0';
+      else
+         if counter2(count_index) = '1' then
+            TIMER2 <='1';
+         else
+            TIMER2 <='0';
+            counter2 <= counter2 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+                                                                                              
+process(cs, tx_pll_lol_qd_s_int, rx_los_low_int, TIMER1, rx_lol_los_int, TIMER2)
+begin
+      reset_timer1 <= '0';
+      reset_timer2 <= '0';
+                                                                                              
+   case cs is
+      when WAIT_FOR_PLOL =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         if (tx_pll_lol_qd_s_int = '1' or rx_los_low_int = '1') then  --Also make sure A Signal
+            ns <= WAIT_FOR_PLOL;             --is Present prior to moving to the next
+         else
+            ns <= RX_SERDES_RESET;
+            end if;
+                                                                                              
+       when RX_SERDES_RESET =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '1';
+         reset_timer1 <= '1';
+            ns <= WAIT_FOR_TIMER1;
+                                                                                              
+                                                                                              
+      when WAIT_FOR_TIMER1 =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '1';
+         if TIMER1 = '1' then
+            ns <= CHECK_LOL_LOS;
+         else
+            ns <= WAIT_FOR_TIMER1;
+            end if;
+                                                                                              
+      when CHECK_LOL_LOS =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         reset_timer2 <= '1';
+            ns <= WAIT_FOR_TIMER2;
+                                                                                              
+      when WAIT_FOR_TIMER2 =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         if rx_lol_los_int = rx_lol_los_del then   --NO RISING OR FALLING EDGES
+            if TIMER2 = '1' then
+               if rx_lol_los_int = '1' then
+                  ns <= WAIT_FOR_PLOL;
+               else
+                  ns <= NORMAL;
+               end if;
+            else
+               ns <= WAIT_FOR_TIMER2;
+            end if;
+         else
+               ns <= CHECK_LOL_LOS;    --RESET TIMER2
+         end if;
+                                                                                              
+      when NORMAL =>
+         rx_pcs_rst_ch_c_int <= '0';
+         rx_serdes_rst_ch_c_int <= '0';
+         if rx_lol_los_int = '1' then
+            ns <= WAIT_FOR_PLOL;
+         else
+            ns <= NORMAL;
+         end if;
+                                                                                              
+      when others =>
+         ns <= WAIT_FOR_PLOL;
+                                                                                              
+      end case;
+                                                                                              
+end process;
+                                                                                              
+                                                                                              
+end rx_reset_sm_arch;
+
+--THIS MODULE IS INSTANTIATED PER TX  QUAD
+--TX Reset Sequence state machine--
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+                                                                                              
+entity serdes_full_ctctx_reset_sm is
+generic (count_index: integer :=18);
+port (
+   rst_n          : in std_logic;
+   refclkdiv2      : in std_logic;
+   tx_pll_lol_qd_s : in std_logic;
+   rst_qd_c    : out std_logic;
+   tx_pcs_rst_ch_c : out std_logic
+   );
+end serdes_full_ctctx_reset_sm;
+                                                                                              
+architecture tx_reset_sm_arch of serdes_full_ctctx_reset_sm is
+                                                                                              
+type statetype is (QUAD_RESET, WAIT_FOR_TIMER1, CHECK_PLOL, WAIT_FOR_TIMER2, NORMAL);
+                                                                                              
+signal   cs:      statetype;  -- current state of lsm
+signal   ns:      statetype;  -- next state of lsm
+                                                                                              
+signal   tx_pll_lol_qd_s_int  : std_logic;
+signal   tx_pcs_rst_ch_c_int  : std_logic_vector(3 downto 0);
+signal   rst_qd_c_int      : std_logic;
+                                                                                              
+signal   reset_timer1:  std_logic;
+signal   reset_timer2:  std_logic;
+                                                                                              
+signal   counter1:      std_logic_vector(2 downto 0);
+signal   TIMER1:        std_logic;
+                                                                                              
+signal   counter2:      std_logic_vector(18 downto 0);
+signal   TIMER2:        std_logic;
+                                                                                              
+begin
+                                                                                              
+process (refclkdiv2, rst_n)
+begin
+   if rst_n = '0' then
+      cs <= QUAD_RESET;
+      tx_pll_lol_qd_s_int <= '1';
+      tx_pcs_rst_ch_c <= '1';
+      rst_qd_c <= '1';
+   else if rising_edge(refclkdiv2) then
+      cs <= ns;
+      tx_pll_lol_qd_s_int <= tx_pll_lol_qd_s;
+      tx_pcs_rst_ch_c <= tx_pcs_rst_ch_c_int(0);
+      rst_qd_c <= rst_qd_c_int;
+   end if;
+   end if;
+end process;
+--TIMER1 = 20ns;
+--Fastest REFLCK =312 MHZ, or 3 ns. We need 8 REFCLK cycles or 4 REFCLKDIV2 cycles
+-- A 2 bit counter ([1:0]) counts 4 cycles, so a 3 bit ([2:0]) counter will do if we set TIMER1 = bit[2]
+                                                                                              
+                                                                                              
+process (refclkdiv2, reset_timer1)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer1 = '1' then
+         counter1 <= "000";
+         TIMER1 <= '0';
+      else
+         if counter1(2) = '1' then
+            TIMER1 <= '1';
+         else
+            TIMER1 <='0';
+            counter1 <= counter1 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+                                                                                              
+--TIMER2 = 1,400,000 UI;
+--WORST CASE CYCLES is with smallest multipier factor.
+-- This would be with X8 clock multiplier in DIV2 mode
+-- IN this casse, 1 UI = 2/8 REFCLK  CYCLES = 1/8 REFCLKDIV2 CYCLES
+-- SO 1,400,000 UI =1,400,000/8 = 175,000 REFCLKDIV2 CYCLES
+-- An 18 bit counter ([17:0]) counts 262144 cycles, so a 19 bit ([18:0]) counter will do if we set TIMER2 = bit[18]
+                                                                                              
+                                                                                              
+process(refclkdiv2, reset_timer2)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer2 = '1' then
+         counter2 <= "0000000000000000000";
+         TIMER2 <= '0';
+      else
+         if counter2(count_index) = '1' then
+            TIMER2 <='1';
+         else
+            TIMER2 <='0';
+            counter2 <= counter2 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+process(cs, TIMER1, TIMER2, tx_pll_lol_qd_s_int)
+begin
+                                                                                              
+      reset_timer1 <= '0';
+      reset_timer2 <= '0';
+                                                                                              
+   case cs is
+                                                                                              
+      when QUAD_RESET   =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '1';
+      reset_timer1 <= '1';
+         ns <= WAIT_FOR_TIMER1;
+                                                                                              
+      when WAIT_FOR_TIMER1 =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '1';
+      if TIMER1 = '1' then
+         ns <= CHECK_PLOL;
+      else
+         ns <= WAIT_FOR_TIMER1;
+         end if;
+                                                                                              
+      when CHECK_PLOL   =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '0';
+      reset_timer2 <= '1';
+         ns <= WAIT_FOR_TIMER2;
+                                                                                              
+      when WAIT_FOR_TIMER2 =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '0';
+      if TIMER2 = '1' then
+         if tx_pll_lol_qd_s_int = '1' then
+            ns <= QUAD_RESET;
+         else
+            ns <= NORMAL;
+         end if;
+      else
+            ns <= WAIT_FOR_TIMER2;
+            end if;
+                                                                                              
+   when NORMAL =>
+      tx_pcs_rst_ch_c_int <= "0000";
+      rst_qd_c_int <= '0';
+      if tx_pll_lol_qd_s_int = '1' then
+         ns <= QUAD_RESET;
+      else
+         ns <= NORMAL;
+         end if;
+                                                                                              
+   when others =>
+      ns <=    QUAD_RESET;
+                                                                                              
+   end case;
+                                                                                              
+end process;
+                                                                                              
+end tx_reset_sm_arch;
+
+
+--synopsys translate_off
+library ECP3;
+use ECP3.components.all;
+--synopsys translate_on
+
+
+library IEEE, STD;
+use IEEE.std_logic_1164.all;
+use STD.TEXTIO.all;
+
+entity serdes_full_ctc is
+   GENERIC (USER_CONFIG_FILE    :  String := "serdes_full_ctc.txt");
+ port (
+------------------
+-- CH0 --
+    hdinp_ch0, hdinn_ch0    :   in std_logic;
+    hdoutp_ch0, hdoutn_ch0   :   out std_logic;
+    sci_sel_ch0    :   in std_logic;
+    rxiclk_ch0    :   in std_logic;
+    txiclk_ch0    :   in std_logic;
+    rx_full_clk_ch0   :   out std_logic;
+    rx_half_clk_ch0   :   out std_logic;
+    tx_full_clk_ch0   :   out std_logic;
+    tx_half_clk_ch0   :   out std_logic;
+    fpga_rxrefclk_ch0    :   in std_logic;
+    txdata_ch0    :   in std_logic_vector (15 downto 0);
+    tx_k_ch0    :   in std_logic_vector (1 downto 0);
+    tx_force_disp_ch0    :   in std_logic_vector (1 downto 0);
+    tx_disp_sel_ch0    :   in std_logic_vector (1 downto 0);
+    rxdata_ch0   :   out std_logic_vector (15 downto 0);
+    rx_k_ch0   :   out std_logic_vector (1 downto 0);
+    rx_disp_err_ch0   :   out std_logic_vector (1 downto 0);
+    rx_cv_err_ch0   :   out std_logic_vector (1 downto 0);
+    sb_felb_ch0_c    :   in std_logic;
+    sb_felb_rst_ch0_c    :   in std_logic;
+    tx_pwrup_ch0_c    :   in std_logic;
+    rx_pwrup_ch0_c    :   in std_logic;
+    rx_los_low_ch0_s   :   out std_logic;
+    lsm_status_ch0_s   :   out std_logic;
+    ctc_urun_ch0_s   :   out std_logic;
+    ctc_orun_ch0_s   :   out std_logic;
+    ctc_ins_ch0_s   :   out std_logic;
+    ctc_del_ch0_s   :   out std_logic;
+    rx_cdr_lol_ch0_s   :   out std_logic;
+    tx_div2_mode_ch0_c   : in std_logic;
+    rx_div2_mode_ch0_c   : in std_logic;
+-- CH1 --
+    hdinp_ch1, hdinn_ch1    :   in std_logic;
+    hdoutp_ch1, hdoutn_ch1   :   out std_logic;
+    sci_sel_ch1    :   in std_logic;
+    rxiclk_ch1    :   in std_logic;
+    txiclk_ch1    :   in std_logic;
+    rx_full_clk_ch1   :   out std_logic;
+    rx_half_clk_ch1   :   out std_logic;
+    tx_full_clk_ch1   :   out std_logic;
+    tx_half_clk_ch1   :   out std_logic;
+    fpga_rxrefclk_ch1    :   in std_logic;
+    txdata_ch1    :   in std_logic_vector (15 downto 0);
+    tx_k_ch1    :   in std_logic_vector (1 downto 0);
+    tx_force_disp_ch1    :   in std_logic_vector (1 downto 0);
+    tx_disp_sel_ch1    :   in std_logic_vector (1 downto 0);
+    rxdata_ch1   :   out std_logic_vector (15 downto 0);
+    rx_k_ch1   :   out std_logic_vector (1 downto 0);
+    rx_disp_err_ch1   :   out std_logic_vector (1 downto 0);
+    rx_cv_err_ch1   :   out std_logic_vector (1 downto 0);
+    sb_felb_ch1_c    :   in std_logic;
+    sb_felb_rst_ch1_c    :   in std_logic;
+    tx_pwrup_ch1_c    :   in std_logic;
+    rx_pwrup_ch1_c    :   in std_logic;
+    rx_los_low_ch1_s   :   out std_logic;
+    lsm_status_ch1_s   :   out std_logic;
+    ctc_urun_ch1_s   :   out std_logic;
+    ctc_orun_ch1_s   :   out std_logic;
+    ctc_ins_ch1_s   :   out std_logic;
+    ctc_del_ch1_s   :   out std_logic;
+    rx_cdr_lol_ch1_s   :   out std_logic;
+    tx_div2_mode_ch1_c   : in std_logic;
+    rx_div2_mode_ch1_c   : in std_logic;
+-- CH2 --
+    hdinp_ch2, hdinn_ch2    :   in std_logic;
+    hdoutp_ch2, hdoutn_ch2   :   out std_logic;
+    sci_sel_ch2    :   in std_logic;
+    rxiclk_ch2    :   in std_logic;
+    txiclk_ch2    :   in std_logic;
+    rx_full_clk_ch2   :   out std_logic;
+    rx_half_clk_ch2   :   out std_logic;
+    tx_full_clk_ch2   :   out std_logic;
+    tx_half_clk_ch2   :   out std_logic;
+    fpga_rxrefclk_ch2    :   in std_logic;
+    txdata_ch2    :   in std_logic_vector (15 downto 0);
+    tx_k_ch2    :   in std_logic_vector (1 downto 0);
+    tx_force_disp_ch2    :   in std_logic_vector (1 downto 0);
+    tx_disp_sel_ch2    :   in std_logic_vector (1 downto 0);
+    rxdata_ch2   :   out std_logic_vector (15 downto 0);
+    rx_k_ch2   :   out std_logic_vector (1 downto 0);
+    rx_disp_err_ch2   :   out std_logic_vector (1 downto 0);
+    rx_cv_err_ch2   :   out std_logic_vector (1 downto 0);
+    sb_felb_ch2_c    :   in std_logic;
+    sb_felb_rst_ch2_c    :   in std_logic;
+    tx_pwrup_ch2_c    :   in std_logic;
+    rx_pwrup_ch2_c    :   in std_logic;
+    rx_los_low_ch2_s   :   out std_logic;
+    lsm_status_ch2_s   :   out std_logic;
+    ctc_urun_ch2_s   :   out std_logic;
+    ctc_orun_ch2_s   :   out std_logic;
+    ctc_ins_ch2_s   :   out std_logic;
+    ctc_del_ch2_s   :   out std_logic;
+    rx_cdr_lol_ch2_s   :   out std_logic;
+    tx_div2_mode_ch2_c   : in std_logic;
+    rx_div2_mode_ch2_c   : in std_logic;
+-- CH3 --
+    hdinp_ch3, hdinn_ch3    :   in std_logic;
+    hdoutp_ch3, hdoutn_ch3   :   out std_logic;
+    sci_sel_ch3    :   in std_logic;
+    rxiclk_ch3    :   in std_logic;
+    txiclk_ch3    :   in std_logic;
+    rx_full_clk_ch3   :   out std_logic;
+    rx_half_clk_ch3   :   out std_logic;
+    tx_full_clk_ch3   :   out std_logic;
+    tx_half_clk_ch3   :   out std_logic;
+    fpga_rxrefclk_ch3    :   in std_logic;
+    txdata_ch3    :   in std_logic_vector (15 downto 0);
+    tx_k_ch3    :   in std_logic_vector (1 downto 0);
+    tx_force_disp_ch3    :   in std_logic_vector (1 downto 0);
+    tx_disp_sel_ch3    :   in std_logic_vector (1 downto 0);
+    rxdata_ch3   :   out std_logic_vector (15 downto 0);
+    rx_k_ch3   :   out std_logic_vector (1 downto 0);
+    rx_disp_err_ch3   :   out std_logic_vector (1 downto 0);
+    rx_cv_err_ch3   :   out std_logic_vector (1 downto 0);
+    sb_felb_ch3_c    :   in std_logic;
+    sb_felb_rst_ch3_c    :   in std_logic;
+    tx_pwrup_ch3_c    :   in std_logic;
+    rx_pwrup_ch3_c    :   in std_logic;
+    rx_los_low_ch3_s   :   out std_logic;
+    lsm_status_ch3_s   :   out std_logic;
+    ctc_urun_ch3_s   :   out std_logic;
+    ctc_orun_ch3_s   :   out std_logic;
+    ctc_ins_ch3_s   :   out std_logic;
+    ctc_del_ch3_s   :   out std_logic;
+    rx_cdr_lol_ch3_s   :   out std_logic;
+    tx_div2_mode_ch3_c   : in std_logic;
+    rx_div2_mode_ch3_c   : in std_logic;
+---- Miscillaneous ports
+    sci_wrdata    :   in std_logic_vector (7 downto 0);
+    sci_addr    :   in std_logic_vector (5 downto 0);
+    sci_rddata   :   out std_logic_vector (7 downto 0);
+    sci_sel_quad    :   in std_logic;
+    sci_rd    :   in std_logic;
+    sci_wrn    :   in std_logic;
+    fpga_txrefclk  :   in std_logic;
+    tx_serdes_rst_c    :   in std_logic;
+    tx_pll_lol_qd_s   :   out std_logic;
+    tx_sync_qd_c    :   in std_logic;
+    refclk2fpga   :   out std_logic;
+    rst_n      :   in std_logic;
+    serdes_rst_qd_c    :   in std_logic);
+
+end serdes_full_ctc;
+
+
+architecture serdes_full_ctc_arch of serdes_full_ctc is
+
+component VLO
+port (
+   Z : out std_logic);
+end component;
+
+component VHI
+port (
+   Z : out std_logic);
+end component;
+
+component serdes_full_ctcrx_reset_sm
+generic (count_index: integer :=18);
+port (
+   rst_n       : in std_logic;
+   refclkdiv2        : in std_logic;
+   tx_pll_lol_qd_s   : in std_logic;
+   rx_serdes_rst_ch_c: out std_logic;
+   rx_cdr_lol_ch_s   : in std_logic;
+   rx_los_low_ch_s   : in std_logic;
+   rx_pcs_rst_ch_c   : out std_logic
+);
+end component ;
+
+component serdes_full_ctctx_reset_sm
+generic (count_index: integer :=18);
+port (
+   rst_n          : in std_logic;
+   refclkdiv2      : in std_logic;
+   tx_pll_lol_qd_s : in std_logic;
+   rst_qd_c    : out std_logic;
+   tx_pcs_rst_ch_c : out std_logic
+   );
+end component;
+
+component PCSD
+--synopsys translate_off
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String := "REFCLK_EXT";
+  CH1_CDR_SRC   : String := "REFCLK_EXT";
+  CH2_CDR_SRC   : String := "REFCLK_EXT";
+  CH3_CDR_SRC   : String := "REFCLK_EXT";
+  PLL_SRC   : String
+  );
+--synopsys translate_on
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+end component;
+   attribute CONFIG_FILE: string;
+   attribute CONFIG_FILE of PCSD_INST : label is USER_CONFIG_FILE;
+   attribute QUAD_MODE: string;
+   attribute QUAD_MODE of PCSD_INST : label is "SINGLE";
+   attribute PLL_SRC: string;
+   attribute PLL_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute CH0_CDR_SRC: string;
+   attribute CH0_CDR_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute CH1_CDR_SRC: string;
+   attribute CH1_CDR_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute CH2_CDR_SRC: string;
+   attribute CH2_CDR_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute CH3_CDR_SRC: string;
+   attribute CH3_CDR_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_0 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_1 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_2 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_3 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_0 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_1 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_2 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_3 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_0 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_1 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_2 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_3 of PCSD_INST : label is "200.000";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_0 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_1 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_2 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_3 of PCSD_INST : label is "100.000";
+   attribute FREQUENCY_PIN_REFCK2CORE: string;
+   attribute FREQUENCY_PIN_REFCK2CORE of PCSD_INST : label is "200.0";
+   attribute black_box_pad_pin: string;
+   attribute black_box_pad_pin of PCSD : component is "HDINP0, HDINN0, HDINP1, HDINN1, HDINP2, HDINN2, HDINP3, HDINN3, HDOUTP0, HDOUTN0, HDOUTP1, HDOUTN1, HDOUTP2, HDOUTN2, HDOUTP3, HDOUTN3, REFCLKP, REFCLKN";
+
+signal refclk_from_nq : std_logic := '0';
+signal fpsc_vlo : std_logic := '0';
+signal fpsc_vhi : std_logic := '1';
+signal cin : std_logic_vector (11 downto 0) := "000000000000";
+signal cout : std_logic_vector (19 downto 0);
+signal    tx_full_clk_ch0_sig   :   std_logic;
+signal    tx_full_clk_ch1_sig   :   std_logic;
+signal    tx_full_clk_ch2_sig   :   std_logic;
+signal    tx_full_clk_ch3_sig   :   std_logic;
+
+signal    refclk2fpga_sig  :   std_logic;
+signal    tx_pll_lol_qd_sig  :   std_logic;
+signal    rx_los_low_ch0_sig  :   std_logic;
+signal    rx_los_low_ch1_sig  :   std_logic;
+signal    rx_los_low_ch2_sig  :   std_logic;
+signal    rx_los_low_ch3_sig  :   std_logic;
+signal    rx_cdr_lol_ch0_sig  :   std_logic;
+signal    rx_cdr_lol_ch1_sig  :   std_logic;
+signal    rx_cdr_lol_ch2_sig  :   std_logic;
+signal    rx_cdr_lol_ch3_sig  :   std_logic;
+
+signal    rx_serdes_rst_ch0_c  : std_logic;
+signal    rx_serdes_rst_ch1_c  : std_logic;
+signal    rx_serdes_rst_ch2_c  : std_logic;
+signal    rx_serdes_rst_ch3_c  : std_logic;
+signal    rx_pcs_rst_ch0_c  : std_logic;
+signal    rx_pcs_rst_ch1_c  : std_logic;
+signal    rx_pcs_rst_ch2_c  : std_logic;
+signal    rx_pcs_rst_ch3_c  : std_logic;
+
+-- reset sequence for rx
+signal    refclkdiv2_rx_ch0  :   std_logic;
+signal    refclkdiv2_rx_ch1  :   std_logic;
+signal    refclkdiv2_rx_ch2  :   std_logic;
+signal    refclkdiv2_rx_ch3  :   std_logic;
+
+signal    refclkdiv2_tx_ch  :   std_logic;
+signal    tx_pcs_rst_ch_c   :   std_logic;
+signal    rst_qd_c   :   std_logic;
+
+
+begin
+
+vlo_inst : VLO port map(Z => fpsc_vlo);
+vhi_inst : VHI port map(Z => fpsc_vhi);
+
+  refclk2fpga <= refclk2fpga_sig;
+    rx_los_low_ch0_s <= rx_los_low_ch0_sig;
+    rx_los_low_ch1_s <= rx_los_low_ch1_sig;
+    rx_los_low_ch2_s <= rx_los_low_ch2_sig;
+    rx_los_low_ch3_s <= rx_los_low_ch3_sig;
+    rx_cdr_lol_ch0_s <= rx_cdr_lol_ch0_sig;
+    rx_cdr_lol_ch1_s <= rx_cdr_lol_ch1_sig;
+    rx_cdr_lol_ch2_s <= rx_cdr_lol_ch2_sig;
+    rx_cdr_lol_ch3_s <= rx_cdr_lol_ch3_sig;
+  tx_pll_lol_qd_s <= tx_pll_lol_qd_sig;
+  tx_full_clk_ch0 <= tx_full_clk_ch0_sig;
+  tx_full_clk_ch1 <= tx_full_clk_ch1_sig;
+  tx_full_clk_ch2 <= tx_full_clk_ch2_sig;
+  tx_full_clk_ch3 <= tx_full_clk_ch3_sig;
+
+-- pcs_quad instance
+PCSD_INST : PCSD
+--synopsys translate_off
+  generic map (CONFIG_FILE => USER_CONFIG_FILE,
+               QUAD_MODE => "SINGLE",
+               CH0_CDR_SRC => "REFCLK_CORE",
+               CH1_CDR_SRC => "REFCLK_CORE",
+               CH2_CDR_SRC => "REFCLK_CORE",
+               CH3_CDR_SRC => "REFCLK_CORE",
+               PLL_SRC  => "REFCLK_CORE"
+  )
+--synopsys translate_on
+port map  (
+  REFCLKP => fpsc_vlo,
+  REFCLKN => fpsc_vlo,
+
+----- CH0 -----
+  HDOUTP0 => hdoutp_ch0,
+  HDOUTN0 => hdoutn_ch0,
+  HDINP0 => hdinp_ch0,
+  HDINN0 => hdinn_ch0,
+  PCIE_TXDETRX_PR2TLB_0 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_0 => fpsc_vlo,
+  PCIE_RXPOLARITY_0 => fpsc_vlo,
+  PCIE_POWERDOWN_0_0 => fpsc_vlo,
+  PCIE_POWERDOWN_0_1 => fpsc_vlo,
+  PCIE_RXVALID_0 => open,
+  PCIE_PHYSTATUS_0 => open,
+  SCISELCH0 => sci_sel_ch0,
+  SCIENCH0 => fpsc_vhi,
+  FF_RXI_CLK_0 => rxiclk_ch0,
+  FF_TXI_CLK_0 => txiclk_ch0,
+  FF_EBRD_CLK_0 => tx_full_clk_ch0_sig,
+  FF_RX_F_CLK_0 => rx_full_clk_ch0,
+  FF_RX_H_CLK_0 => rx_half_clk_ch0,
+  FF_TX_F_CLK_0 => tx_full_clk_ch0_sig,
+  FF_TX_H_CLK_0 => tx_half_clk_ch0,
+  FFC_CK_CORE_RX_0 => fpga_rxrefclk_ch0,
+  FF_TX_D_0_0 => txdata_ch0(0),
+  FF_TX_D_0_1 => txdata_ch0(1),
+  FF_TX_D_0_2 => txdata_ch0(2),
+  FF_TX_D_0_3 => txdata_ch0(3),
+  FF_TX_D_0_4 => txdata_ch0(4),
+  FF_TX_D_0_5 => txdata_ch0(5),
+  FF_TX_D_0_6 => txdata_ch0(6),
+  FF_TX_D_0_7 => txdata_ch0(7),
+  FF_TX_D_0_8 => tx_k_ch0(0),
+  FF_TX_D_0_9 => tx_force_disp_ch0(0),
+  FF_TX_D_0_10 => tx_disp_sel_ch0(0),
+  FF_TX_D_0_11 => fpsc_vlo,
+  FF_TX_D_0_12 => txdata_ch0(8),
+  FF_TX_D_0_13 => txdata_ch0(9),
+  FF_TX_D_0_14 => txdata_ch0(10),
+  FF_TX_D_0_15 => txdata_ch0(11),
+  FF_TX_D_0_16 => txdata_ch0(12),
+  FF_TX_D_0_17 => txdata_ch0(13),
+  FF_TX_D_0_18 => txdata_ch0(14),
+  FF_TX_D_0_19 => txdata_ch0(15),
+  FF_TX_D_0_20 => tx_k_ch0(1),
+  FF_TX_D_0_21 => tx_force_disp_ch0(1),
+  FF_TX_D_0_22 => tx_disp_sel_ch0(1),
+  FF_TX_D_0_23 => fpsc_vlo,
+  FF_RX_D_0_0 => rxdata_ch0(0),
+  FF_RX_D_0_1 => rxdata_ch0(1),
+  FF_RX_D_0_2 => rxdata_ch0(2),
+  FF_RX_D_0_3 => rxdata_ch0(3),
+  FF_RX_D_0_4 => rxdata_ch0(4),
+  FF_RX_D_0_5 => rxdata_ch0(5),
+  FF_RX_D_0_6 => rxdata_ch0(6),
+  FF_RX_D_0_7 => rxdata_ch0(7),
+  FF_RX_D_0_8 => rx_k_ch0(0),
+  FF_RX_D_0_9 => rx_disp_err_ch0(0),
+  FF_RX_D_0_10 => rx_cv_err_ch0(0),
+  FF_RX_D_0_11 => open,
+  FF_RX_D_0_12 => rxdata_ch0(8),
+  FF_RX_D_0_13 => rxdata_ch0(9),
+  FF_RX_D_0_14 => rxdata_ch0(10),
+  FF_RX_D_0_15 => rxdata_ch0(11),
+  FF_RX_D_0_16 => rxdata_ch0(12),
+  FF_RX_D_0_17 => rxdata_ch0(13),
+  FF_RX_D_0_18 => rxdata_ch0(14),
+  FF_RX_D_0_19 => rxdata_ch0(15),
+  FF_RX_D_0_20 => rx_k_ch0(1),
+  FF_RX_D_0_21 => rx_disp_err_ch0(1),
+  FF_RX_D_0_22 => rx_cv_err_ch0(1),
+  FF_RX_D_0_23 => open,
+
+  FFC_RRST_0 => rx_serdes_rst_ch0_c,
+  FFC_SIGNAL_DETECT_0 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_0 => sb_felb_ch0_c,
+  FFC_PFIFO_CLR_0 => sb_felb_rst_ch0_c,
+  FFC_SB_INV_RX_0 => fpsc_vlo,
+  FFC_PCIE_CT_0 => fpsc_vlo,
+  FFC_PCI_DET_EN_0 => fpsc_vlo,
+  FFC_FB_LOOPBACK_0 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_0 => fpsc_vlo,
+  FFC_EI_EN_0 => fpsc_vlo,
+  FFC_LANE_TX_RST_0 => tx_pcs_rst_ch_c,
+  FFC_TXPWDNB_0 => tx_pwrup_ch0_c,
+  FFC_LANE_RX_RST_0 => rx_pcs_rst_ch0_c,
+  FFC_RXPWDNB_0 => rx_pwrup_ch0_c,
+  FFS_RLOS_LO_0 => rx_los_low_ch0_sig,
+  FFS_RLOS_HI_0 => open,
+  FFS_PCIE_CON_0 => open,
+  FFS_PCIE_DONE_0 => open,
+  FFS_LS_SYNC_STATUS_0 => lsm_status_ch0_s,
+  FFS_CC_OVERRUN_0 => ctc_orun_ch0_s,
+  FFS_CC_UNDERRUN_0 => ctc_urun_ch0_s,
+  FFS_SKP_ADDED_0 => ctc_ins_ch0_s,
+  FFS_SKP_DELETED_0 => ctc_del_ch0_s,
+  FFS_RLOL_0 => rx_cdr_lol_ch0_sig,
+  FFS_RXFBFIFO_ERROR_0 => open,
+  FFS_TXFBFIFO_ERROR_0 => open,
+  LDR_CORE2TX_0 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_0 => fpsc_vlo,
+  LDR_RX2CORE_0 => open,
+  FFS_CDR_TRAIN_DONE_0 => open,
+  FFC_DIV11_MODE_TX_0 => fpsc_vlo,
+  FFC_RATE_MODE_TX_0 => tx_div2_mode_ch0_c,
+  FFC_DIV11_MODE_RX_0 => fpsc_vlo,
+  FFC_RATE_MODE_RX_0 => rx_div2_mode_ch0_c,
+
+----- CH1 -----
+  HDOUTP1 => hdoutp_ch1,
+  HDOUTN1 => hdoutn_ch1,
+  HDINP1 => hdinp_ch1,
+  HDINN1 => hdinn_ch1,
+  PCIE_TXDETRX_PR2TLB_1 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_1 => fpsc_vlo,
+  PCIE_RXPOLARITY_1 => fpsc_vlo,
+  PCIE_POWERDOWN_1_0 => fpsc_vlo,
+  PCIE_POWERDOWN_1_1 => fpsc_vlo,
+  PCIE_RXVALID_1 => open,
+  PCIE_PHYSTATUS_1 => open,
+  SCISELCH1 => sci_sel_ch1,
+  SCIENCH1 => fpsc_vhi,
+  FF_RXI_CLK_1 => rxiclk_ch1,
+  FF_TXI_CLK_1 => txiclk_ch1,
+  FF_EBRD_CLK_1 => tx_full_clk_ch1_sig,
+  FF_RX_F_CLK_1 => rx_full_clk_ch1,
+  FF_RX_H_CLK_1 => rx_half_clk_ch1,
+  FF_TX_F_CLK_1 => tx_full_clk_ch1_sig,
+  FF_TX_H_CLK_1 => tx_half_clk_ch1,
+  FFC_CK_CORE_RX_1 => fpga_rxrefclk_ch1,
+  FF_TX_D_1_0 => txdata_ch1(0),
+  FF_TX_D_1_1 => txdata_ch1(1),
+  FF_TX_D_1_2 => txdata_ch1(2),
+  FF_TX_D_1_3 => txdata_ch1(3),
+  FF_TX_D_1_4 => txdata_ch1(4),
+  FF_TX_D_1_5 => txdata_ch1(5),
+  FF_TX_D_1_6 => txdata_ch1(6),
+  FF_TX_D_1_7 => txdata_ch1(7),
+  FF_TX_D_1_8 => tx_k_ch1(0),
+  FF_TX_D_1_9 => tx_force_disp_ch1(0),
+  FF_TX_D_1_10 => tx_disp_sel_ch1(0),
+  FF_TX_D_1_11 => fpsc_vlo,
+  FF_TX_D_1_12 => txdata_ch1(8),
+  FF_TX_D_1_13 => txdata_ch1(9),
+  FF_TX_D_1_14 => txdata_ch1(10),
+  FF_TX_D_1_15 => txdata_ch1(11),
+  FF_TX_D_1_16 => txdata_ch1(12),
+  FF_TX_D_1_17 => txdata_ch1(13),
+  FF_TX_D_1_18 => txdata_ch1(14),
+  FF_TX_D_1_19 => txdata_ch1(15),
+  FF_TX_D_1_20 => tx_k_ch1(1),
+  FF_TX_D_1_21 => tx_force_disp_ch1(1),
+  FF_TX_D_1_22 => tx_disp_sel_ch1(1),
+  FF_TX_D_1_23 => fpsc_vlo,
+  FF_RX_D_1_0 => rxdata_ch1(0),
+  FF_RX_D_1_1 => rxdata_ch1(1),
+  FF_RX_D_1_2 => rxdata_ch1(2),
+  FF_RX_D_1_3 => rxdata_ch1(3),
+  FF_RX_D_1_4 => rxdata_ch1(4),
+  FF_RX_D_1_5 => rxdata_ch1(5),
+  FF_RX_D_1_6 => rxdata_ch1(6),
+  FF_RX_D_1_7 => rxdata_ch1(7),
+  FF_RX_D_1_8 => rx_k_ch1(0),
+  FF_RX_D_1_9 => rx_disp_err_ch1(0),
+  FF_RX_D_1_10 => rx_cv_err_ch1(0),
+  FF_RX_D_1_11 => open,
+  FF_RX_D_1_12 => rxdata_ch1(8),
+  FF_RX_D_1_13 => rxdata_ch1(9),
+  FF_RX_D_1_14 => rxdata_ch1(10),
+  FF_RX_D_1_15 => rxdata_ch1(11),
+  FF_RX_D_1_16 => rxdata_ch1(12),
+  FF_RX_D_1_17 => rxdata_ch1(13),
+  FF_RX_D_1_18 => rxdata_ch1(14),
+  FF_RX_D_1_19 => rxdata_ch1(15),
+  FF_RX_D_1_20 => rx_k_ch1(1),
+  FF_RX_D_1_21 => rx_disp_err_ch1(1),
+  FF_RX_D_1_22 => rx_cv_err_ch1(1),
+  FF_RX_D_1_23 => open,
+
+  FFC_RRST_1 => rx_serdes_rst_ch1_c,
+  FFC_SIGNAL_DETECT_1 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_1 => sb_felb_ch1_c,
+  FFC_PFIFO_CLR_1 => sb_felb_rst_ch1_c,
+  FFC_SB_INV_RX_1 => fpsc_vlo,
+  FFC_PCIE_CT_1 => fpsc_vlo,
+  FFC_PCI_DET_EN_1 => fpsc_vlo,
+  FFC_FB_LOOPBACK_1 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_1 => fpsc_vlo,
+  FFC_EI_EN_1 => fpsc_vlo,
+  FFC_LANE_TX_RST_1 => tx_pcs_rst_ch_c,
+  FFC_TXPWDNB_1 => tx_pwrup_ch1_c,
+  FFC_LANE_RX_RST_1 => rx_pcs_rst_ch1_c,
+  FFC_RXPWDNB_1 => rx_pwrup_ch1_c,
+  FFS_RLOS_LO_1 => rx_los_low_ch1_sig,
+  FFS_RLOS_HI_1 => open,
+  FFS_PCIE_CON_1 => open,
+  FFS_PCIE_DONE_1 => open,
+  FFS_LS_SYNC_STATUS_1 => lsm_status_ch1_s,
+  FFS_CC_OVERRUN_1 => ctc_orun_ch1_s,
+  FFS_CC_UNDERRUN_1 => ctc_urun_ch1_s,
+  FFS_SKP_ADDED_1 => ctc_ins_ch1_s,
+  FFS_SKP_DELETED_1 => ctc_del_ch1_s,
+  FFS_RLOL_1 => rx_cdr_lol_ch1_sig,
+  FFS_RXFBFIFO_ERROR_1 => open,
+  FFS_TXFBFIFO_ERROR_1 => open,
+  LDR_CORE2TX_1 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_1 => fpsc_vlo,
+  LDR_RX2CORE_1 => open,
+  FFS_CDR_TRAIN_DONE_1 => open,
+  FFC_DIV11_MODE_TX_1 => fpsc_vlo,
+  FFC_RATE_MODE_TX_1 => tx_div2_mode_ch1_c,
+  FFC_DIV11_MODE_RX_1 => fpsc_vlo,
+  FFC_RATE_MODE_RX_1 => rx_div2_mode_ch1_c,
+
+----- CH2 -----
+  HDOUTP2 => hdoutp_ch2,
+  HDOUTN2 => hdoutn_ch2,
+  HDINP2 => hdinp_ch2,
+  HDINN2 => hdinn_ch2,
+  PCIE_TXDETRX_PR2TLB_2 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_2 => fpsc_vlo,
+  PCIE_RXPOLARITY_2 => fpsc_vlo,
+  PCIE_POWERDOWN_2_0 => fpsc_vlo,
+  PCIE_POWERDOWN_2_1 => fpsc_vlo,
+  PCIE_RXVALID_2 => open,
+  PCIE_PHYSTATUS_2 => open,
+  SCISELCH2 => sci_sel_ch2,
+  SCIENCH2 => fpsc_vhi,
+  FF_RXI_CLK_2 => rxiclk_ch2,
+  FF_TXI_CLK_2 => txiclk_ch2,
+  FF_EBRD_CLK_2 => tx_full_clk_ch2_sig,
+  FF_RX_F_CLK_2 => rx_full_clk_ch2,
+  FF_RX_H_CLK_2 => rx_half_clk_ch2,
+  FF_TX_F_CLK_2 => tx_full_clk_ch2_sig,
+  FF_TX_H_CLK_2 => tx_half_clk_ch2,
+  FFC_CK_CORE_RX_2 => fpga_rxrefclk_ch2,
+  FF_TX_D_2_0 => txdata_ch2(0),
+  FF_TX_D_2_1 => txdata_ch2(1),
+  FF_TX_D_2_2 => txdata_ch2(2),
+  FF_TX_D_2_3 => txdata_ch2(3),
+  FF_TX_D_2_4 => txdata_ch2(4),
+  FF_TX_D_2_5 => txdata_ch2(5),
+  FF_TX_D_2_6 => txdata_ch2(6),
+  FF_TX_D_2_7 => txdata_ch2(7),
+  FF_TX_D_2_8 => tx_k_ch2(0),
+  FF_TX_D_2_9 => tx_force_disp_ch2(0),
+  FF_TX_D_2_10 => tx_disp_sel_ch2(0),
+  FF_TX_D_2_11 => fpsc_vlo,
+  FF_TX_D_2_12 => txdata_ch2(8),
+  FF_TX_D_2_13 => txdata_ch2(9),
+  FF_TX_D_2_14 => txdata_ch2(10),
+  FF_TX_D_2_15 => txdata_ch2(11),
+  FF_TX_D_2_16 => txdata_ch2(12),
+  FF_TX_D_2_17 => txdata_ch2(13),
+  FF_TX_D_2_18 => txdata_ch2(14),
+  FF_TX_D_2_19 => txdata_ch2(15),
+  FF_TX_D_2_20 => tx_k_ch2(1),
+  FF_TX_D_2_21 => tx_force_disp_ch2(1),
+  FF_TX_D_2_22 => tx_disp_sel_ch2(1),
+  FF_TX_D_2_23 => fpsc_vlo,
+  FF_RX_D_2_0 => rxdata_ch2(0),
+  FF_RX_D_2_1 => rxdata_ch2(1),
+  FF_RX_D_2_2 => rxdata_ch2(2),
+  FF_RX_D_2_3 => rxdata_ch2(3),
+  FF_RX_D_2_4 => rxdata_ch2(4),
+  FF_RX_D_2_5 => rxdata_ch2(5),
+  FF_RX_D_2_6 => rxdata_ch2(6),
+  FF_RX_D_2_7 => rxdata_ch2(7),
+  FF_RX_D_2_8 => rx_k_ch2(0),
+  FF_RX_D_2_9 => rx_disp_err_ch2(0),
+  FF_RX_D_2_10 => rx_cv_err_ch2(0),
+  FF_RX_D_2_11 => open,
+  FF_RX_D_2_12 => rxdata_ch2(8),
+  FF_RX_D_2_13 => rxdata_ch2(9),
+  FF_RX_D_2_14 => rxdata_ch2(10),
+  FF_RX_D_2_15 => rxdata_ch2(11),
+  FF_RX_D_2_16 => rxdata_ch2(12),
+  FF_RX_D_2_17 => rxdata_ch2(13),
+  FF_RX_D_2_18 => rxdata_ch2(14),
+  FF_RX_D_2_19 => rxdata_ch2(15),
+  FF_RX_D_2_20 => rx_k_ch2(1),
+  FF_RX_D_2_21 => rx_disp_err_ch2(1),
+  FF_RX_D_2_22 => rx_cv_err_ch2(1),
+  FF_RX_D_2_23 => open,
+
+  FFC_RRST_2 => rx_serdes_rst_ch2_c,
+  FFC_SIGNAL_DETECT_2 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_2 => sb_felb_ch2_c,
+  FFC_PFIFO_CLR_2 => sb_felb_rst_ch2_c,
+  FFC_SB_INV_RX_2 => fpsc_vlo,
+  FFC_PCIE_CT_2 => fpsc_vlo,
+  FFC_PCI_DET_EN_2 => fpsc_vlo,
+  FFC_FB_LOOPBACK_2 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_2 => fpsc_vlo,
+  FFC_EI_EN_2 => fpsc_vlo,
+  FFC_LANE_TX_RST_2 => tx_pcs_rst_ch_c,
+  FFC_TXPWDNB_2 => tx_pwrup_ch2_c,
+  FFC_LANE_RX_RST_2 => rx_pcs_rst_ch2_c,
+  FFC_RXPWDNB_2 => rx_pwrup_ch2_c,
+  FFS_RLOS_LO_2 => rx_los_low_ch2_sig,
+  FFS_RLOS_HI_2 => open,
+  FFS_PCIE_CON_2 => open,
+  FFS_PCIE_DONE_2 => open,
+  FFS_LS_SYNC_STATUS_2 => lsm_status_ch2_s,
+  FFS_CC_OVERRUN_2 => ctc_orun_ch2_s,
+  FFS_CC_UNDERRUN_2 => ctc_urun_ch2_s,
+  FFS_SKP_ADDED_2 => ctc_ins_ch2_s,
+  FFS_SKP_DELETED_2 => ctc_del_ch2_s,
+  FFS_RLOL_2 => rx_cdr_lol_ch2_sig,
+  FFS_RXFBFIFO_ERROR_2 => open,
+  FFS_TXFBFIFO_ERROR_2 => open,
+  LDR_CORE2TX_2 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_2 => fpsc_vlo,
+  LDR_RX2CORE_2 => open,
+  FFS_CDR_TRAIN_DONE_2 => open,
+  FFC_DIV11_MODE_TX_2 => fpsc_vlo,
+  FFC_RATE_MODE_TX_2 => tx_div2_mode_ch2_c,
+  FFC_DIV11_MODE_RX_2 => fpsc_vlo,
+  FFC_RATE_MODE_RX_2 => rx_div2_mode_ch2_c,
+
+----- CH3 -----
+  HDOUTP3 => hdoutp_ch3,
+  HDOUTN3 => hdoutn_ch3,
+  HDINP3 => hdinp_ch3,
+  HDINN3 => hdinn_ch3,
+  PCIE_TXDETRX_PR2TLB_3 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_3 => fpsc_vlo,
+  PCIE_RXPOLARITY_3 => fpsc_vlo,
+  PCIE_POWERDOWN_3_0 => fpsc_vlo,
+  PCIE_POWERDOWN_3_1 => fpsc_vlo,
+  PCIE_RXVALID_3 => open,
+  PCIE_PHYSTATUS_3 => open,
+  SCISELCH3 => sci_sel_ch3,
+  SCIENCH3 => fpsc_vhi,
+  FF_RXI_CLK_3 => rxiclk_ch3,
+  FF_TXI_CLK_3 => txiclk_ch3,
+  FF_EBRD_CLK_3 => tx_full_clk_ch3_sig,
+  FF_RX_F_CLK_3 => rx_full_clk_ch3,
+  FF_RX_H_CLK_3 => rx_half_clk_ch3,
+  FF_TX_F_CLK_3 => tx_full_clk_ch3_sig,
+  FF_TX_H_CLK_3 => tx_half_clk_ch3,
+  FFC_CK_CORE_RX_3 => fpga_rxrefclk_ch3,
+  FF_TX_D_3_0 => txdata_ch3(0),
+  FF_TX_D_3_1 => txdata_ch3(1),
+  FF_TX_D_3_2 => txdata_ch3(2),
+  FF_TX_D_3_3 => txdata_ch3(3),
+  FF_TX_D_3_4 => txdata_ch3(4),
+  FF_TX_D_3_5 => txdata_ch3(5),
+  FF_TX_D_3_6 => txdata_ch3(6),
+  FF_TX_D_3_7 => txdata_ch3(7),
+  FF_TX_D_3_8 => tx_k_ch3(0),
+  FF_TX_D_3_9 => tx_force_disp_ch3(0),
+  FF_TX_D_3_10 => tx_disp_sel_ch3(0),
+  FF_TX_D_3_11 => fpsc_vlo,
+  FF_TX_D_3_12 => txdata_ch3(8),
+  FF_TX_D_3_13 => txdata_ch3(9),
+  FF_TX_D_3_14 => txdata_ch3(10),
+  FF_TX_D_3_15 => txdata_ch3(11),
+  FF_TX_D_3_16 => txdata_ch3(12),
+  FF_TX_D_3_17 => txdata_ch3(13),
+  FF_TX_D_3_18 => txdata_ch3(14),
+  FF_TX_D_3_19 => txdata_ch3(15),
+  FF_TX_D_3_20 => tx_k_ch3(1),
+  FF_TX_D_3_21 => tx_force_disp_ch3(1),
+  FF_TX_D_3_22 => tx_disp_sel_ch3(1),
+  FF_TX_D_3_23 => fpsc_vlo,
+  FF_RX_D_3_0 => rxdata_ch3(0),
+  FF_RX_D_3_1 => rxdata_ch3(1),
+  FF_RX_D_3_2 => rxdata_ch3(2),
+  FF_RX_D_3_3 => rxdata_ch3(3),
+  FF_RX_D_3_4 => rxdata_ch3(4),
+  FF_RX_D_3_5 => rxdata_ch3(5),
+  FF_RX_D_3_6 => rxdata_ch3(6),
+  FF_RX_D_3_7 => rxdata_ch3(7),
+  FF_RX_D_3_8 => rx_k_ch3(0),
+  FF_RX_D_3_9 => rx_disp_err_ch3(0),
+  FF_RX_D_3_10 => rx_cv_err_ch3(0),
+  FF_RX_D_3_11 => open,
+  FF_RX_D_3_12 => rxdata_ch3(8),
+  FF_RX_D_3_13 => rxdata_ch3(9),
+  FF_RX_D_3_14 => rxdata_ch3(10),
+  FF_RX_D_3_15 => rxdata_ch3(11),
+  FF_RX_D_3_16 => rxdata_ch3(12),
+  FF_RX_D_3_17 => rxdata_ch3(13),
+  FF_RX_D_3_18 => rxdata_ch3(14),
+  FF_RX_D_3_19 => rxdata_ch3(15),
+  FF_RX_D_3_20 => rx_k_ch3(1),
+  FF_RX_D_3_21 => rx_disp_err_ch3(1),
+  FF_RX_D_3_22 => rx_cv_err_ch3(1),
+  FF_RX_D_3_23 => open,
+
+  FFC_RRST_3 => rx_serdes_rst_ch3_c,
+  FFC_SIGNAL_DETECT_3 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_3 => sb_felb_ch3_c,
+  FFC_PFIFO_CLR_3 => sb_felb_rst_ch3_c,
+  FFC_SB_INV_RX_3 => fpsc_vlo,
+  FFC_PCIE_CT_3 => fpsc_vlo,
+  FFC_PCI_DET_EN_3 => fpsc_vlo,
+  FFC_FB_LOOPBACK_3 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_3 => fpsc_vlo,
+  FFC_EI_EN_3 => fpsc_vlo,
+  FFC_LANE_TX_RST_3 => tx_pcs_rst_ch_c,
+  FFC_TXPWDNB_3 => tx_pwrup_ch3_c,
+  FFC_LANE_RX_RST_3 => rx_pcs_rst_ch3_c,
+  FFC_RXPWDNB_3 => rx_pwrup_ch3_c,
+  FFS_RLOS_LO_3 => rx_los_low_ch3_sig,
+  FFS_RLOS_HI_3 => open,
+  FFS_PCIE_CON_3 => open,
+  FFS_PCIE_DONE_3 => open,
+  FFS_LS_SYNC_STATUS_3 => lsm_status_ch3_s,
+  FFS_CC_OVERRUN_3 => ctc_orun_ch3_s,
+  FFS_CC_UNDERRUN_3 => ctc_urun_ch3_s,
+  FFS_SKP_ADDED_3 => ctc_ins_ch3_s,
+  FFS_SKP_DELETED_3 => ctc_del_ch3_s,
+  FFS_RLOL_3 => rx_cdr_lol_ch3_sig,
+  FFS_RXFBFIFO_ERROR_3 => open,
+  FFS_TXFBFIFO_ERROR_3 => open,
+  LDR_CORE2TX_3 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_3 => fpsc_vlo,
+  LDR_RX2CORE_3 => open,
+  FFS_CDR_TRAIN_DONE_3 => open,
+  FFC_DIV11_MODE_TX_3 => fpsc_vlo,
+  FFC_RATE_MODE_TX_3 => tx_div2_mode_ch3_c,
+  FFC_DIV11_MODE_RX_3 => fpsc_vlo,
+  FFC_RATE_MODE_RX_3 => rx_div2_mode_ch3_c,
+
+----- Auxilliary ----
+  SCIWDATA7 => sci_wrdata(7),
+  SCIWDATA6 => sci_wrdata(6),
+  SCIWDATA5 => sci_wrdata(5),
+  SCIWDATA4 => sci_wrdata(4),
+  SCIWDATA3 => sci_wrdata(3),
+  SCIWDATA2 => sci_wrdata(2),
+  SCIWDATA1 => sci_wrdata(1),
+  SCIWDATA0 => sci_wrdata(0),
+  SCIADDR5 => sci_addr(5),
+  SCIADDR4 => sci_addr(4),
+  SCIADDR3 => sci_addr(3),
+  SCIADDR2 => sci_addr(2),
+  SCIADDR1 => sci_addr(1),
+  SCIADDR0 => sci_addr(0),
+  SCIRDATA7 => sci_rddata(7),
+  SCIRDATA6 => sci_rddata(6),
+  SCIRDATA5 => sci_rddata(5),
+  SCIRDATA4 => sci_rddata(4),
+  SCIRDATA3 => sci_rddata(3),
+  SCIRDATA2 => sci_rddata(2),
+  SCIRDATA1 => sci_rddata(1),
+  SCIRDATA0 => sci_rddata(0),
+  SCIENAUX => fpsc_vhi,
+  SCISELAUX => sci_sel_quad,
+  SCIRD => sci_rd,
+  SCIWSTN => sci_wrn,
+  CYAWSTN => fpsc_vlo,
+  SCIINT => open,
+  FFC_CK_CORE_TX => fpga_txrefclk,
+  FFC_MACRO_RST => serdes_rst_qd_c,
+  FFC_QUAD_RST => rst_qd_c,
+  FFC_TRST => tx_serdes_rst_c,
+  FFS_PLOL => tx_pll_lol_qd_sig,
+  FFC_SYNC_TOGGLE => tx_sync_qd_c,
+  REFCK2CORE => refclk2fpga_sig,
+  CIN0 => fpsc_vlo,
+  CIN1 => fpsc_vlo,
+  CIN2 => fpsc_vlo,
+  CIN3 => fpsc_vlo,
+  CIN4 => fpsc_vlo,
+  CIN5 => fpsc_vlo,
+  CIN6 => fpsc_vlo,
+  CIN7 => fpsc_vlo,
+  CIN8 => fpsc_vlo,
+  CIN9 => fpsc_vlo,
+  CIN10 => fpsc_vlo,
+  CIN11 => fpsc_vlo,
+  COUT0 => open,
+  COUT1 => open,
+  COUT2 => open,
+  COUT3 => open,
+  COUT4 => open,
+  COUT5 => open,
+  COUT6 => open,
+  COUT7 => open,
+  COUT8 => open,
+  COUT9 => open,
+  COUT10 => open,
+  COUT11 => open,
+  COUT12 => open,
+  COUT13 => open,
+  COUT14 => open,
+  COUT15 => open,
+  COUT16 => open,
+  COUT17 => open,
+  COUT18 => open,
+  COUT19 => open,
+  REFCLK_FROM_NQ => refclk_from_nq,
+  REFCLK_TO_NQ => open);
+
+-- reset sequence for rx
+                                                                                              
+  P1 : PROCESS(fpga_rxrefclk_ch0, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_rx_ch0 <= '0';
+     ELSIF (fpga_rxrefclk_ch0'event and fpga_rxrefclk_ch0 = '1') THEN 
+         refclkdiv2_rx_ch0 <= not refclkdiv2_rx_ch0;
+     END IF;
+  END PROCESS;
+                                                                                              
+rx_reset_sm_ch0 : serdes_full_ctcrx_reset_sm 
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  refclkdiv2 => refclkdiv2_rx_ch0,
+  rst_n => rst_n,
+  rx_cdr_lol_ch_s => rx_cdr_lol_ch0_sig,
+  rx_los_low_ch_s => rx_los_low_ch0_sig,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rx_pcs_rst_ch_c => rx_pcs_rst_ch0_c,
+  rx_serdes_rst_ch_c => rx_serdes_rst_ch0_c);
+                                                                                              
+  P2 : PROCESS(fpga_rxrefclk_ch1, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_rx_ch1 <= '0';
+     ELSIF (fpga_rxrefclk_ch1'event and fpga_rxrefclk_ch1 = '1') THEN
+         refclkdiv2_rx_ch1 <= not refclkdiv2_rx_ch1;
+     END IF;
+  END PROCESS;
+                                                                                              
+rx_reset_sm_ch1 : serdes_full_ctcrx_reset_sm
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  refclkdiv2 => refclkdiv2_rx_ch1,
+  rst_n => rst_n,
+  rx_cdr_lol_ch_s => rx_cdr_lol_ch1_sig,
+  rx_los_low_ch_s => rx_los_low_ch1_sig,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rx_pcs_rst_ch_c => rx_pcs_rst_ch1_c,
+  rx_serdes_rst_ch_c => rx_serdes_rst_ch1_c);
+                                                                                              
+  P3 : PROCESS(fpga_rxrefclk_ch2, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_rx_ch2 <= '0';
+     ELSIF (fpga_rxrefclk_ch2'event and fpga_rxrefclk_ch2 = '1') THEN
+         refclkdiv2_rx_ch2 <= not refclkdiv2_rx_ch2;
+     END IF;
+  END PROCESS;
+
+rx_reset_sm_ch2 : serdes_full_ctcrx_reset_sm
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  refclkdiv2 => refclkdiv2_rx_ch2,
+  rst_n => rst_n,
+  rx_cdr_lol_ch_s => rx_cdr_lol_ch2_sig,
+  rx_los_low_ch_s => rx_los_low_ch2_sig,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rx_pcs_rst_ch_c => rx_pcs_rst_ch2_c,
+  rx_serdes_rst_ch_c => rx_serdes_rst_ch2_c);
+                                                                                              
+  P4 : PROCESS(fpga_rxrefclk_ch3, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_rx_ch3 <= '0';
+     ELSIF (fpga_rxrefclk_ch3'event and fpga_rxrefclk_ch3 = '1') THEN
+         refclkdiv2_rx_ch3 <= not refclkdiv2_rx_ch3;
+     END IF;
+  END PROCESS;
+                                                                                              
+rx_reset_sm_ch3 : serdes_full_ctcrx_reset_sm
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  refclkdiv2 => refclkdiv2_rx_ch3,
+  rst_n => rst_n,
+  rx_cdr_lol_ch_s => rx_cdr_lol_ch3_sig,
+  rx_los_low_ch_s => rx_los_low_ch3_sig,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rx_pcs_rst_ch_c => rx_pcs_rst_ch3_c,
+  rx_serdes_rst_ch_c => rx_serdes_rst_ch3_c);
+                                                                                              
+                                                                                              
+  P5 : PROCESS(fpga_txrefclk, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_tx_ch <= '0';
+     ELSIF (fpga_txrefclk'event and fpga_txrefclk = '1') THEN
+         refclkdiv2_tx_ch <= not refclkdiv2_tx_ch;
+     END IF;
+  END PROCESS;
+
+-- reset sequence for tx
+tx_reset_sm_ch : serdes_full_ctctx_reset_sm 
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  rst_n => rst_n,
+  refclkdiv2 => refclkdiv2_tx_ch,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rst_qd_c => rst_qd_c,
+  tx_pcs_rst_ch_c => tx_pcs_rst_ch_c
+  );
+                                                                                              
+                                                                                              
+--synopsys translate_off
+file_read : PROCESS
+VARIABLE open_status : file_open_status;
+FILE config : text;
+BEGIN
+   file_open (open_status, config, USER_CONFIG_FILE, read_mode);
+   IF (open_status = name_error) THEN
+      report "Auto configuration file for PCS module not found.  PCS internal configuration registers will not be initialized correctly during simulation!"
+      severity ERROR;
+   END IF;
+   wait;
+END PROCESS;
+--synopsys translate_on
+end serdes_full_ctc_arch ;
index 61a9b74ba03372805add2008b2b78de3179998de..afb1bb6ce679e1388fc946a33053826b0e10a9c3 100644 (file)
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<DiamondModule name="serdes_onboard_full" module="PCS" VendorName="Lattice Semiconductor Corporation" generator="IPexpress" date="2011 08 30 16:33:42.595" version="8.1" type="Module" synthesis="" source_format="VHDL">
+<DiamondModule name="serdes_onboard_full" module="PCS" VendorName="Lattice Semiconductor Corporation" generator="IPexpress" date="2012 06 06 12:34:05.629" version="8.1" type="Module" synthesis="" source_format="VHDL">
   <Package>
                <File name="serdes_onboard_full.lpc" type="lpc" modified="2011 08 30 16:32:03.000"/>
                <File name="serdes_onboard_full.pp" type="pp" modified="2011 08 30 16:32:03.000"/>
+               <File name="serdes_onboard_full.sym" type="sym" modified="2012 04 24 21:51:09.000"/>
                <File name="serdes_onboard_full.tft" type="tft" modified="2011 08 30 16:32:03.000"/>
                <File name="serdes_onboard_full.txt" type="pcs_module" modified="2011 08 30 16:32:03.000"/>
-               <File name="serdes_onboard_full.vhd" type="top_level_vhdl" modified="2011 08 30 16:32:03.000"/>
+               <File name="serdes_onboard_full.vhd" type="top_level_vhdl" modified="2011 09 14 11:22:43.000"/>
   </Package>
 </DiamondModule>
diff --git a/media_interfaces/ecp3_sfp/sfp_0_200_ctc.ipx b/media_interfaces/ecp3_sfp/sfp_0_200_ctc.ipx
new file mode 100644 (file)
index 0000000..9b77252
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DiamondModule name="sfp_0_200_ctc" module="PCS" VendorName="Lattice Semiconductor Corporation" generator="IPexpress" date="2012 06 05 18:05:25.422" version="8.1" type="Module" synthesis="" source_format="VHDL">
+  <Package>
+               <File name="sfp_0_200_ctc.lpc" type="lpc" modified="2012 06 05 18:05:19.000"/>
+               <File name="sfp_0_200_ctc.pp" type="pp" modified="2012 06 05 18:05:19.000"/>
+               <File name="sfp_0_200_ctc.tft" type="tft" modified="2012 06 05 18:05:19.000"/>
+               <File name="sfp_0_200_ctc.txt" type="pcs_module" modified="2012 06 05 18:05:19.000"/>
+               <File name="sfp_0_200_ctc.vhd" type="top_level_vhdl" modified="2012 06 05 18:05:19.000"/>
+  </Package>
+</DiamondModule>
diff --git a/media_interfaces/ecp3_sfp/sfp_0_200_ctc.lpc b/media_interfaces/ecp3_sfp/sfp_0_200_ctc.lpc
new file mode 100644 (file)
index 0000000..818f2af
--- /dev/null
@@ -0,0 +1,258 @@
+[Device]
+Family=latticeecp3
+PartType=LFE3-150EA
+PartName=LFE3-150EA-8LFN672C
+SpeedGrade=8L
+Package=FPBGA672
+OperatingCondition=COM
+Status=P
+
+[IP]
+VendorName=Lattice Semiconductor Corporation
+CoreType=LPM
+CoreStatus=Demo
+CoreName=PCS
+CoreRevision=8.1
+ModuleName=sfp_0_200_ctc
+SourceFormat=VHDL
+ParameterFileVersion=1.0
+Date=06/05/2012
+Time=18:05:19
+
+[Parameters]
+Verilog=0
+VHDL=1
+EDIF=1
+Destination=Synplicity
+Expression=BusA(0 to 7)
+Order=Big Endian [MSB:LSB]
+IO=0
+_mode0=RXTX
+_mode1=DISABLED
+_mode2=DISABLED
+_mode3=DISABLED
+_protocol0=G8B10B
+_protocol1=G8B10B
+_protocol2=G8B10B
+_protocol3=G8B10B
+_ldr0=DISABLED
+_ldr1=DISABLED
+_ldr2=DISABLED
+_ldr3=DISABLED
+_datarange=2
+_pll_txsrc=INTERNAL
+_refclk_mult=10X
+_refclk_rate=200
+_tx_protocol0=G8B10B
+_tx_protocol1=DISABLED
+_tx_protocol2=DISABLED
+_tx_protocol3=DISABLED
+_tx_data_rate0=FULL
+_tx_data_rate1=FULL
+_tx_data_rate2=FULL
+_tx_data_rate3=FULL
+_tx_data_width0=16
+_tx_data_width1=16
+_tx_data_width2=8
+_tx_data_width3=8
+_tx_fifo0=ENABLED
+_tx_fifo1=ENABLED
+_tx_fifo2=ENABLED
+_tx_fifo3=ENABLED
+_tx_ficlk_rate0=100
+_tx_ficlk_rate1=100
+_tx_ficlk_rate2=200
+_tx_ficlk_rate3=200
+_pll_rxsrc0=INTERNAL
+_pll_rxsrc1=INTERNAL
+_pll_rxsrc2=EXTERNAL
+_pll_rxsrc3=EXTERNAL
+Multiplier0=
+Multiplier1=
+Multiplier2=
+Multiplier3=
+_rx_datarange0=2
+_rx_datarange1=2
+_rx_datarange2=2
+_rx_datarange3=2
+_rx_protocol0=G8B10B
+_rx_protocol1=DISABLED
+_rx_protocol2=DISABLED
+_rx_protocol3=DISABLED
+_rx_data_rate0=FULL
+_rx_data_rate1=FULL
+_rx_data_rate2=FULL
+_rx_data_rate3=FULL
+_rxrefclk_rate0=200
+_rxrefclk_rate1=200
+_rxrefclk_rate2=200
+_rxrefclk_rate3=200
+_rx_data_width0=16
+_rx_data_width1=16
+_rx_data_width2=8
+_rx_data_width3=8
+_rx_fifo0=ENABLED
+_rx_fifo1=ENABLED
+_rx_fifo2=ENABLED
+_rx_fifo3=ENABLED
+_rx_ficlk_rate0=100
+_rx_ficlk_rate1=100
+_rx_ficlk_rate2=200
+_rx_ficlk_rate3=200
+_tdrv_ch0=0
+_tdrv_ch1=0
+_tdrv_ch2=0
+_tdrv_ch3=0
+_tx_pre0=DISABLED
+_tx_pre1=DISABLED
+_tx_pre2=DISABLED
+_tx_pre3=DISABLED
+_rterm_tx0=50
+_rterm_tx1=50
+_rterm_tx2=50
+_rterm_tx3=50
+_rx_eq0=DISABLED
+_rx_eq1=DISABLED
+_rx_eq2=DISABLED
+_rx_eq3=DISABLED
+_rterm_rx0=50
+_rterm_rx1=50
+_rterm_rx2=50
+_rterm_rx3=50
+_rx_dcc0=DC
+_rx_dcc1=DC
+_rx_dcc2=AC
+_rx_dcc3=AC
+_los_threshold_mode0=LOS_E
+_los_threshold_mode1=LOS_E
+_los_threshold_mode2=LOS_E
+_los_threshold_mode3=LOS_E
+_los_threshold_lo0=2
+_los_threshold_lo1=2
+_los_threshold_lo2=2
+_los_threshold_lo3=2
+_los_threshold_hi0=7
+_los_threshold_hi1=7
+_los_threshold_hi2=7
+_los_threshold_hi3=7
+_pll_term=50
+_pll_dcc=AC
+_pll_lol_set=0
+_tx_sb0=DISABLED
+_tx_sb1=DISABLED
+_tx_sb2=DISABLED
+_tx_sb3=DISABLED
+_tx_8b10b0=ENABLED
+_tx_8b10b1=ENABLED
+_tx_8b10b2=ENABLED
+_tx_8b10b3=ENABLED
+_rx_sb0=DISABLED
+_rx_sb1=DISABLED
+_rx_sb2=DISABLED
+_rx_sb3=DISABLED
+_ird0=DISABLED
+_ird1=DISABLED
+_ird2=DISABLED
+_ird3=DISABLED
+_rx_8b10b0=ENABLED
+_rx_8b10b1=ENABLED
+_rx_8b10b2=ENABLED
+_rx_8b10b3=ENABLED
+_rxwa0=ENABLED
+_rxwa1=ENABLED
+_rxwa2=ENABLED
+_rxwa3=ENABLED
+_ilsm0=ENABLED
+_ilsm1=ENABLED
+_ilsm2=ENABLED
+_ilsm3=ENABLED
+_scomma0=K28P157
+_scomma1=K28P157
+_scomma2=K28P157
+_scomma3=K28P157
+_comma_a0=1100000101
+_comma_a1=1100000101
+_comma_a2=1100000101
+_comma_a3=1100000101
+_comma_b0=0011111010
+_comma_b1=0011111010
+_comma_b2=0011111010
+_comma_b3=0011111010
+_comma_m0=1111111100
+_comma_m1=1111111100
+_comma_m2=1111111100
+_comma_m3=1111111100
+_ctc0=ENABLED
+_ctc1=DISABLED
+_ctc2=DISABLED
+_ctc3=DISABLED
+_cc_match_mode0=2
+_cc_match_mode1=1
+_cc_match_mode2=1
+_cc_match_mode3=1
+_k00=01
+_k01=01
+_k02=00
+_k03=00
+_k10=00
+_k11=00
+_k12=00
+_k13=00
+_k20=01
+_k21=01
+_k22=01
+_k23=01
+_k30=01
+_k31=01
+_k32=01
+_k33=01
+_byten00=10111100
+_byten01=00011100
+_byten02=00000000
+_byten03=00000000
+_byten10=01010000
+_byten11=00000000
+_byten12=00000000
+_byten13=00000000
+_byten20=00011100
+_byten21=00011100
+_byten22=00011100
+_byten23=00011100
+_byten30=00011100
+_byten31=00011100
+_byten32=00011100
+_byten33=00011100
+_cc_min_ipg0=1
+_cc_min_ipg1=3
+_cc_min_ipg2=3
+_cc_min_ipg3=3
+_cchmark=9
+_cclmark=7
+_loopback=DISABLED
+_lbtype0=DISABLED
+_lbtype1=DISABLED
+_lbtype2=DISABLED
+_lbtype3=DISABLED
+_teidle_ch0=DISABLED
+_teidle_ch1=DISABLED
+_teidle_ch2=DISABLED
+_teidle_ch3=DISABLED
+_rst_gen=ENABLED
+_rx_los_port0=Internal
+_rx_los_port1=Internal
+_rx_los_port2=Internal
+_rx_los_port3=Internal
+_sci_ports=ENABLED
+_sci_int_port=DISABLED
+_refck2core=DISABLED
+Regen=auto
+PAR1=0
+PARTrace1=0
+PAR3=0
+PARTrace3=0
+
+[FilesGenerated]
+sfp_0_200_ctc.pp=pp
+sfp_0_200_ctc.tft=tft
+sfp_0_200_ctc.txt=pcs_module
+sfp_0_200_ctc.sym=sym
diff --git a/media_interfaces/ecp3_sfp/sfp_0_200_ctc.txt b/media_interfaces/ecp3_sfp/sfp_0_200_ctc.txt
new file mode 100644 (file)
index 0000000..11fb740
--- /dev/null
@@ -0,0 +1,59 @@
+# This file is used by the simulation model as well as the ispLEVER bitstream
+# generation process to automatically initialize the PCSD quad to the mode
+# selected in the IPexpress. This file is expected to be modified by the
+# end user to adjust the PCSD quad to the final design requirements.
+
+DEVICE_NAME "LFE3-150EA"
+CH0_PROTOCOL            "G8B10B"
+CH0_MODE                "RXTX"
+CH1_MODE                "DISABLED"
+CH2_MODE                "DISABLED"
+CH3_MODE                "DISABLED"
+CH0_CDR_SRC       "REFCLK_CORE"
+PLL_SRC                 "REFCLK_CORE"
+TX_DATARATE_RANGE       "MEDHIGH"
+CH0_RX_DATARATE_RANGE   "MEDHIGH"
+REFCK_MULT              "10X"
+#REFCLK_RATE            200
+CH0_RX_DATA_RATE        "FULL"
+CH0_TX_DATA_RATE        "FULL"
+CH0_TX_DATA_WIDTH       "16"
+CH0_RX_DATA_WIDTH        "16"
+CH0_TX_FIFO       "ENABLED"
+CH0_RX_FIFO        "ENABLED"
+CH0_TDRV      "0"
+#CH0_TX_FICLK_RATE      100
+#CH0_RXREFCLK_RATE        "200"
+#CH0_RX_FICLK_RATE      100
+CH0_TX_PRE              "DISABLED"
+CH0_RTERM_TX            "50"
+CH0_RX_EQ               "DISABLED"
+CH0_RTERM_RX            "50"
+CH0_RX_DCC              "DC"
+CH0_LOS_THRESHOLD_LO       "2"
+PLL_TERM                "50"
+PLL_DCC                 "AC"
+PLL_LOL_SET             "0"
+CH0_TX_SB               "DISABLED"
+CH0_RX_SB               "DISABLED"
+CH0_TX_8B10B            "ENABLED"
+CH0_RX_8B10B            "ENABLED"
+CH0_COMMA_A             "1100000101"
+CH0_COMMA_B             "0011111010"
+CH0_COMMA_M             "1111111100"
+CH0_RXWA                "ENABLED"
+CH0_ILSM                "ENABLED"
+CH0_CTC                 "ENABLED"
+CH0_CC_MATCH3           "0110111100"
+CH0_CC_MATCH4           "0001010000"
+CH0_CC_MATCH_MODE       "2"
+CH0_CC_MIN_IPG          "1"
+CCHMARK                 "9"
+CCLMARK                 "7"
+CH0_SSLB                "DISABLED"
+CH0_SPLBPORTS           "DISABLED"
+CH0_PCSLBPORTS          "DISABLED"
+INT_ALL                 "DISABLED"
+QD_REFCK2CORE           "DISABLED"
+
+
diff --git a/media_interfaces/ecp3_sfp/sfp_0_200_ctc.vhd b/media_interfaces/ecp3_sfp/sfp_0_200_ctc.vhd
new file mode 100644 (file)
index 0000000..09b17ff
--- /dev/null
@@ -0,0 +1,3126 @@
+
+                                                                                                         
+
+--synopsys translate_off
+
+library pcsd_work;
+use pcsd_work.all;
+library IEEE;
+use IEEE.std_logic_1164.all;
+
+entity PCSD is
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String := "REFCLK_EXT";
+  CH1_CDR_SRC   : String := "REFCLK_EXT";
+  CH2_CDR_SRC   : String := "REFCLK_EXT";
+  CH3_CDR_SRC   : String := "REFCLK_EXT";
+  PLL_SRC   : String
+--  CONFIG_FILE : String  := "sfp_0_200_ctc.txt";
+--  QUAD_MODE : String := "SINGLE";
+--  CH0_CDR_SRC   : String := "REFCLK_CORE";
+--  CH1_CDR_SRC   : String := "REFCLK_CORE";
+--  CH2_CDR_SRC   : String := "REFCLK_EXT";
+--  CH3_CDR_SRC   : String := "REFCLK_EXT";
+--  PLL_SRC   : String := "REFCLK_CORE"
+  );
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+
+end PCSD;
+
+architecture PCSD_arch of PCSD is
+
+
+component PCSD_sim
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String;
+  CH1_CDR_SRC   : String;
+  CH2_CDR_SRC   : String;
+  CH3_CDR_SRC   : String;
+  PLL_SRC   : String
+  );
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+end component;
+
+begin
+
+PCSD_sim_inst : PCSD_sim
+generic map (
+  CONFIG_FILE => CONFIG_FILE,
+  QUAD_MODE => QUAD_MODE,
+  CH0_CDR_SRC => CH0_CDR_SRC,
+  CH1_CDR_SRC => CH1_CDR_SRC,
+  CH2_CDR_SRC => CH2_CDR_SRC,
+  CH3_CDR_SRC => CH3_CDR_SRC,
+  PLL_SRC => PLL_SRC
+  )
+port map (
+   HDINN0 => HDINN0,
+   HDINN1 => HDINN1,
+   HDINN2 => HDINN2,
+   HDINN3 => HDINN3,
+   HDINP0 => HDINP0,
+   HDINP1 => HDINP1,
+   HDINP2 => HDINP2,
+   HDINP3 => HDINP3,
+   REFCLKN => REFCLKN,
+   REFCLKP => REFCLKP,
+   CIN11 => CIN11,
+   CIN10 => CIN10,
+   CIN9 => CIN9,
+   CIN8 => CIN8,
+   CIN7 => CIN7,
+   CIN6 => CIN6,
+   CIN5 => CIN5,
+   CIN4 => CIN4,
+   CIN3 => CIN3,
+   CIN2 => CIN2,
+   CIN1 => CIN1,
+   CIN0 => CIN0,
+   CYAWSTN => CYAWSTN,
+   FF_EBRD_CLK_3 => FF_EBRD_CLK_3,
+   FF_EBRD_CLK_2 => FF_EBRD_CLK_2,
+   FF_EBRD_CLK_1 => FF_EBRD_CLK_1,
+   FF_EBRD_CLK_0 => FF_EBRD_CLK_0,
+   FF_RXI_CLK_3 => FF_RXI_CLK_3,
+   FF_RXI_CLK_2 => FF_RXI_CLK_2,
+   FF_RXI_CLK_1 => FF_RXI_CLK_1,
+   FF_RXI_CLK_0 => FF_RXI_CLK_0,
+   FF_TX_D_0_0 => FF_TX_D_0_0,
+   FF_TX_D_0_1 => FF_TX_D_0_1,
+   FF_TX_D_0_2 => FF_TX_D_0_2,
+   FF_TX_D_0_3 => FF_TX_D_0_3,
+   FF_TX_D_0_4 => FF_TX_D_0_4,
+   FF_TX_D_0_5 => FF_TX_D_0_5,
+   FF_TX_D_0_6 => FF_TX_D_0_6,
+   FF_TX_D_0_7 => FF_TX_D_0_7,
+   FF_TX_D_0_8 => FF_TX_D_0_8,
+   FF_TX_D_0_9 => FF_TX_D_0_9,
+   FF_TX_D_0_10 => FF_TX_D_0_10,
+   FF_TX_D_0_11 => FF_TX_D_0_11,
+   FF_TX_D_0_12 => FF_TX_D_0_12,
+   FF_TX_D_0_13 => FF_TX_D_0_13,
+   FF_TX_D_0_14 => FF_TX_D_0_14,
+   FF_TX_D_0_15 => FF_TX_D_0_15,
+   FF_TX_D_0_16 => FF_TX_D_0_16,
+   FF_TX_D_0_17 => FF_TX_D_0_17,
+   FF_TX_D_0_18 => FF_TX_D_0_18,
+   FF_TX_D_0_19 => FF_TX_D_0_19,
+   FF_TX_D_0_20 => FF_TX_D_0_20,
+   FF_TX_D_0_21 => FF_TX_D_0_21,
+   FF_TX_D_0_22 => FF_TX_D_0_22,
+   FF_TX_D_0_23 => FF_TX_D_0_23,
+   FF_TX_D_1_0 => FF_TX_D_1_0,
+   FF_TX_D_1_1 => FF_TX_D_1_1,
+   FF_TX_D_1_2 => FF_TX_D_1_2,
+   FF_TX_D_1_3 => FF_TX_D_1_3,
+   FF_TX_D_1_4 => FF_TX_D_1_4,
+   FF_TX_D_1_5 => FF_TX_D_1_5,
+   FF_TX_D_1_6 => FF_TX_D_1_6,
+   FF_TX_D_1_7 => FF_TX_D_1_7,
+   FF_TX_D_1_8 => FF_TX_D_1_8,
+   FF_TX_D_1_9 => FF_TX_D_1_9,
+   FF_TX_D_1_10 => FF_TX_D_1_10,
+   FF_TX_D_1_11 => FF_TX_D_1_11,
+   FF_TX_D_1_12 => FF_TX_D_1_12,
+   FF_TX_D_1_13 => FF_TX_D_1_13,
+   FF_TX_D_1_14 => FF_TX_D_1_14,
+   FF_TX_D_1_15 => FF_TX_D_1_15,
+   FF_TX_D_1_16 => FF_TX_D_1_16,
+   FF_TX_D_1_17 => FF_TX_D_1_17,
+   FF_TX_D_1_18 => FF_TX_D_1_18,
+   FF_TX_D_1_19 => FF_TX_D_1_19,
+   FF_TX_D_1_20 => FF_TX_D_1_20,
+   FF_TX_D_1_21 => FF_TX_D_1_21,
+   FF_TX_D_1_22 => FF_TX_D_1_22,
+   FF_TX_D_1_23 => FF_TX_D_1_23,
+   FF_TX_D_2_0 => FF_TX_D_2_0,
+   FF_TX_D_2_1 => FF_TX_D_2_1,
+   FF_TX_D_2_2 => FF_TX_D_2_2,
+   FF_TX_D_2_3 => FF_TX_D_2_3,
+   FF_TX_D_2_4 => FF_TX_D_2_4,
+   FF_TX_D_2_5 => FF_TX_D_2_5,
+   FF_TX_D_2_6 => FF_TX_D_2_6,
+   FF_TX_D_2_7 => FF_TX_D_2_7,
+   FF_TX_D_2_8 => FF_TX_D_2_8,
+   FF_TX_D_2_9 => FF_TX_D_2_9,
+   FF_TX_D_2_10 => FF_TX_D_2_10,
+   FF_TX_D_2_11 => FF_TX_D_2_11,
+   FF_TX_D_2_12 => FF_TX_D_2_12,
+   FF_TX_D_2_13 => FF_TX_D_2_13,
+   FF_TX_D_2_14 => FF_TX_D_2_14,
+   FF_TX_D_2_15 => FF_TX_D_2_15,
+   FF_TX_D_2_16 => FF_TX_D_2_16,
+   FF_TX_D_2_17 => FF_TX_D_2_17,
+   FF_TX_D_2_18 => FF_TX_D_2_18,
+   FF_TX_D_2_19 => FF_TX_D_2_19,
+   FF_TX_D_2_20 => FF_TX_D_2_20,
+   FF_TX_D_2_21 => FF_TX_D_2_21,
+   FF_TX_D_2_22 => FF_TX_D_2_22,
+   FF_TX_D_2_23 => FF_TX_D_2_23,
+   FF_TX_D_3_0 => FF_TX_D_3_0,
+   FF_TX_D_3_1 => FF_TX_D_3_1,
+   FF_TX_D_3_2 => FF_TX_D_3_2,
+   FF_TX_D_3_3 => FF_TX_D_3_3,
+   FF_TX_D_3_4 => FF_TX_D_3_4,
+   FF_TX_D_3_5 => FF_TX_D_3_5,
+   FF_TX_D_3_6 => FF_TX_D_3_6,
+   FF_TX_D_3_7 => FF_TX_D_3_7,
+   FF_TX_D_3_8 => FF_TX_D_3_8,
+   FF_TX_D_3_9 => FF_TX_D_3_9,
+   FF_TX_D_3_10 => FF_TX_D_3_10,
+   FF_TX_D_3_11 => FF_TX_D_3_11,
+   FF_TX_D_3_12 => FF_TX_D_3_12,
+   FF_TX_D_3_13 => FF_TX_D_3_13,
+   FF_TX_D_3_14 => FF_TX_D_3_14,
+   FF_TX_D_3_15 => FF_TX_D_3_15,
+   FF_TX_D_3_16 => FF_TX_D_3_16,
+   FF_TX_D_3_17 => FF_TX_D_3_17,
+   FF_TX_D_3_18 => FF_TX_D_3_18,
+   FF_TX_D_3_19 => FF_TX_D_3_19,
+   FF_TX_D_3_20 => FF_TX_D_3_20,
+   FF_TX_D_3_21 => FF_TX_D_3_21,
+   FF_TX_D_3_22 => FF_TX_D_3_22,
+   FF_TX_D_3_23 => FF_TX_D_3_23,
+   FF_TXI_CLK_0 => FF_TXI_CLK_0,
+   FF_TXI_CLK_1 => FF_TXI_CLK_1,
+   FF_TXI_CLK_2 => FF_TXI_CLK_2,
+   FF_TXI_CLK_3 => FF_TXI_CLK_3,
+   FFC_CK_CORE_RX_0 => FFC_CK_CORE_RX_0,
+   FFC_CK_CORE_RX_1 => FFC_CK_CORE_RX_1,
+   FFC_CK_CORE_RX_2 => FFC_CK_CORE_RX_2,
+   FFC_CK_CORE_RX_3 => FFC_CK_CORE_RX_3,
+   FFC_CK_CORE_TX => FFC_CK_CORE_TX,
+   FFC_EI_EN_0 => FFC_EI_EN_0,
+   FFC_EI_EN_1 => FFC_EI_EN_1,
+   FFC_EI_EN_2 => FFC_EI_EN_2,
+   FFC_EI_EN_3 => FFC_EI_EN_3,
+   FFC_ENABLE_CGALIGN_0 => FFC_ENABLE_CGALIGN_0,
+   FFC_ENABLE_CGALIGN_1 => FFC_ENABLE_CGALIGN_1,
+   FFC_ENABLE_CGALIGN_2 => FFC_ENABLE_CGALIGN_2,
+   FFC_ENABLE_CGALIGN_3 => FFC_ENABLE_CGALIGN_3,
+   FFC_FB_LOOPBACK_0 => FFC_FB_LOOPBACK_0,
+   FFC_FB_LOOPBACK_1 => FFC_FB_LOOPBACK_1,
+   FFC_FB_LOOPBACK_2 => FFC_FB_LOOPBACK_2,
+   FFC_FB_LOOPBACK_3 => FFC_FB_LOOPBACK_3,
+   FFC_LANE_RX_RST_0 => FFC_LANE_RX_RST_0,
+   FFC_LANE_RX_RST_1 => FFC_LANE_RX_RST_1,
+   FFC_LANE_RX_RST_2 => FFC_LANE_RX_RST_2,
+   FFC_LANE_RX_RST_3 => FFC_LANE_RX_RST_3,
+   FFC_LANE_TX_RST_0 => FFC_LANE_TX_RST_0,
+   FFC_LANE_TX_RST_1 => FFC_LANE_TX_RST_1,
+   FFC_LANE_TX_RST_2 => FFC_LANE_TX_RST_2,
+   FFC_LANE_TX_RST_3 => FFC_LANE_TX_RST_3,
+   FFC_MACRO_RST => FFC_MACRO_RST,
+   FFC_PCI_DET_EN_0 => FFC_PCI_DET_EN_0,
+   FFC_PCI_DET_EN_1 => FFC_PCI_DET_EN_1,
+   FFC_PCI_DET_EN_2 => FFC_PCI_DET_EN_2,
+   FFC_PCI_DET_EN_3 => FFC_PCI_DET_EN_3,
+   FFC_PCIE_CT_0 => FFC_PCIE_CT_0,
+   FFC_PCIE_CT_1 => FFC_PCIE_CT_1,
+   FFC_PCIE_CT_2 => FFC_PCIE_CT_2,
+   FFC_PCIE_CT_3 => FFC_PCIE_CT_3,
+   FFC_PFIFO_CLR_0 => FFC_PFIFO_CLR_0,
+   FFC_PFIFO_CLR_1 => FFC_PFIFO_CLR_1,
+   FFC_PFIFO_CLR_2 => FFC_PFIFO_CLR_2,
+   FFC_PFIFO_CLR_3 => FFC_PFIFO_CLR_3,
+   FFC_QUAD_RST => FFC_QUAD_RST,
+   FFC_RRST_0 => FFC_RRST_0,
+   FFC_RRST_1 => FFC_RRST_1,
+   FFC_RRST_2 => FFC_RRST_2,
+   FFC_RRST_3 => FFC_RRST_3,
+   FFC_RXPWDNB_0 => FFC_RXPWDNB_0,
+   FFC_RXPWDNB_1 => FFC_RXPWDNB_1,
+   FFC_RXPWDNB_2 => FFC_RXPWDNB_2,
+   FFC_RXPWDNB_3 => FFC_RXPWDNB_3,
+   FFC_SB_INV_RX_0 => FFC_SB_INV_RX_0,
+   FFC_SB_INV_RX_1 => FFC_SB_INV_RX_1,
+   FFC_SB_INV_RX_2 => FFC_SB_INV_RX_2,
+   FFC_SB_INV_RX_3 => FFC_SB_INV_RX_3,
+   FFC_SB_PFIFO_LP_0 => FFC_SB_PFIFO_LP_0,
+   FFC_SB_PFIFO_LP_1 => FFC_SB_PFIFO_LP_1,
+   FFC_SB_PFIFO_LP_2 => FFC_SB_PFIFO_LP_2,
+   FFC_SB_PFIFO_LP_3 => FFC_SB_PFIFO_LP_3,
+   FFC_SIGNAL_DETECT_0 => FFC_SIGNAL_DETECT_0,
+   FFC_SIGNAL_DETECT_1 => FFC_SIGNAL_DETECT_1,
+   FFC_SIGNAL_DETECT_2 => FFC_SIGNAL_DETECT_2,
+   FFC_SIGNAL_DETECT_3 => FFC_SIGNAL_DETECT_3,
+   FFC_SYNC_TOGGLE => FFC_SYNC_TOGGLE,
+   FFC_TRST => FFC_TRST,
+   FFC_TXPWDNB_0 => FFC_TXPWDNB_0,
+   FFC_TXPWDNB_1 => FFC_TXPWDNB_1,
+   FFC_TXPWDNB_2 => FFC_TXPWDNB_2,
+   FFC_TXPWDNB_3 => FFC_TXPWDNB_3,
+   FFC_RATE_MODE_RX_0 => FFC_RATE_MODE_RX_0,
+   FFC_RATE_MODE_RX_1 => FFC_RATE_MODE_RX_1,
+   FFC_RATE_MODE_RX_2 => FFC_RATE_MODE_RX_2,
+   FFC_RATE_MODE_RX_3 => FFC_RATE_MODE_RX_3,
+   FFC_RATE_MODE_TX_0 => FFC_RATE_MODE_TX_0,
+   FFC_RATE_MODE_TX_1 => FFC_RATE_MODE_TX_1,
+   FFC_RATE_MODE_TX_2 => FFC_RATE_MODE_TX_2,
+   FFC_RATE_MODE_TX_3 => FFC_RATE_MODE_TX_3,
+   FFC_DIV11_MODE_RX_0 => FFC_DIV11_MODE_RX_0,
+   FFC_DIV11_MODE_RX_1 => FFC_DIV11_MODE_RX_1,
+   FFC_DIV11_MODE_RX_2 => FFC_DIV11_MODE_RX_2,
+   FFC_DIV11_MODE_RX_3 => FFC_DIV11_MODE_RX_3,
+   FFC_DIV11_MODE_TX_0 => FFC_DIV11_MODE_TX_0,
+   FFC_DIV11_MODE_TX_1 => FFC_DIV11_MODE_TX_1,
+   FFC_DIV11_MODE_TX_2 => FFC_DIV11_MODE_TX_2,
+   FFC_DIV11_MODE_TX_3 => FFC_DIV11_MODE_TX_3,
+   LDR_CORE2TX_0 => LDR_CORE2TX_0,
+   LDR_CORE2TX_1 => LDR_CORE2TX_1,
+   LDR_CORE2TX_2 => LDR_CORE2TX_2,
+   LDR_CORE2TX_3 => LDR_CORE2TX_3,
+   FFC_LDR_CORE2TX_EN_0 => FFC_LDR_CORE2TX_EN_0,
+   FFC_LDR_CORE2TX_EN_1 => FFC_LDR_CORE2TX_EN_1,
+   FFC_LDR_CORE2TX_EN_2 => FFC_LDR_CORE2TX_EN_2,
+   FFC_LDR_CORE2TX_EN_3 => FFC_LDR_CORE2TX_EN_3,
+   PCIE_POWERDOWN_0_0 => PCIE_POWERDOWN_0_0,
+   PCIE_POWERDOWN_0_1 => PCIE_POWERDOWN_0_1,
+   PCIE_POWERDOWN_1_0 => PCIE_POWERDOWN_1_0,
+   PCIE_POWERDOWN_1_1 => PCIE_POWERDOWN_1_1,
+   PCIE_POWERDOWN_2_0 => PCIE_POWERDOWN_2_0,
+   PCIE_POWERDOWN_2_1 => PCIE_POWERDOWN_2_1,
+   PCIE_POWERDOWN_3_0 => PCIE_POWERDOWN_3_0,
+   PCIE_POWERDOWN_3_1 => PCIE_POWERDOWN_3_1,
+   PCIE_RXPOLARITY_0 => PCIE_RXPOLARITY_0,
+   PCIE_RXPOLARITY_1 => PCIE_RXPOLARITY_1,
+   PCIE_RXPOLARITY_2 => PCIE_RXPOLARITY_2,
+   PCIE_RXPOLARITY_3 => PCIE_RXPOLARITY_3,
+   PCIE_TXCOMPLIANCE_0 => PCIE_TXCOMPLIANCE_0,
+   PCIE_TXCOMPLIANCE_1 => PCIE_TXCOMPLIANCE_1,
+   PCIE_TXCOMPLIANCE_2 => PCIE_TXCOMPLIANCE_2,
+   PCIE_TXCOMPLIANCE_3 => PCIE_TXCOMPLIANCE_3,
+   PCIE_TXDETRX_PR2TLB_0 => PCIE_TXDETRX_PR2TLB_0,
+   PCIE_TXDETRX_PR2TLB_1 => PCIE_TXDETRX_PR2TLB_1,
+   PCIE_TXDETRX_PR2TLB_2 => PCIE_TXDETRX_PR2TLB_2,
+   PCIE_TXDETRX_PR2TLB_3 => PCIE_TXDETRX_PR2TLB_3,
+   SCIADDR0 => SCIADDR0,
+   SCIADDR1 => SCIADDR1,
+   SCIADDR2 => SCIADDR2,
+   SCIADDR3 => SCIADDR3,
+   SCIADDR4 => SCIADDR4,
+   SCIADDR5 => SCIADDR5,
+   SCIENAUX => SCIENAUX,
+   SCIENCH0 => SCIENCH0,
+   SCIENCH1 => SCIENCH1,
+   SCIENCH2 => SCIENCH2,
+   SCIENCH3 => SCIENCH3,
+   SCIRD => SCIRD,
+   SCISELAUX => SCISELAUX,
+   SCISELCH0 => SCISELCH0,
+   SCISELCH1 => SCISELCH1,
+   SCISELCH2 => SCISELCH2,
+   SCISELCH3 => SCISELCH3,
+   SCIWDATA0 => SCIWDATA0,
+   SCIWDATA1 => SCIWDATA1,
+   SCIWDATA2 => SCIWDATA2,
+   SCIWDATA3 => SCIWDATA3,
+   SCIWDATA4 => SCIWDATA4,
+   SCIWDATA5 => SCIWDATA5,
+   SCIWDATA6 => SCIWDATA6,
+   SCIWDATA7 => SCIWDATA7,
+   SCIWSTN => SCIWSTN,
+   HDOUTN0 => HDOUTN0,
+   HDOUTN1 => HDOUTN1,
+   HDOUTN2 => HDOUTN2,
+   HDOUTN3 => HDOUTN3,
+   HDOUTP0 => HDOUTP0,
+   HDOUTP1 => HDOUTP1,
+   HDOUTP2 => HDOUTP2,
+   HDOUTP3 => HDOUTP3,
+   COUT19 => COUT19,
+   COUT18 => COUT18,
+   COUT17 => COUT17,
+   COUT16 => COUT16,
+   COUT15 => COUT15,
+   COUT14 => COUT14,
+   COUT13 => COUT13,
+   COUT12 => COUT12,
+   COUT11 => COUT11,
+   COUT10 => COUT10,
+   COUT9 => COUT9,
+   COUT8 => COUT8,
+   COUT7 => COUT7,
+   COUT6 => COUT6,
+   COUT5 => COUT5,
+   COUT4 => COUT4,
+   COUT3 => COUT3,
+   COUT2 => COUT2,
+   COUT1 => COUT1,
+   COUT0 => COUT0,
+   FF_RX_D_0_0 => FF_RX_D_0_0,
+   FF_RX_D_0_1 => FF_RX_D_0_1,
+   FF_RX_D_0_2 => FF_RX_D_0_2,
+   FF_RX_D_0_3 => FF_RX_D_0_3,
+   FF_RX_D_0_4 => FF_RX_D_0_4,
+   FF_RX_D_0_5 => FF_RX_D_0_5,
+   FF_RX_D_0_6 => FF_RX_D_0_6,
+   FF_RX_D_0_7 => FF_RX_D_0_7,
+   FF_RX_D_0_8 => FF_RX_D_0_8,
+   FF_RX_D_0_9 => FF_RX_D_0_9,
+   FF_RX_D_0_10 => FF_RX_D_0_10,
+   FF_RX_D_0_11 => FF_RX_D_0_11,
+   FF_RX_D_0_12 => FF_RX_D_0_12,
+   FF_RX_D_0_13 => FF_RX_D_0_13,
+   FF_RX_D_0_14 => FF_RX_D_0_14,
+   FF_RX_D_0_15 => FF_RX_D_0_15,
+   FF_RX_D_0_16 => FF_RX_D_0_16,
+   FF_RX_D_0_17 => FF_RX_D_0_17,
+   FF_RX_D_0_18 => FF_RX_D_0_18,
+   FF_RX_D_0_19 => FF_RX_D_0_19,
+   FF_RX_D_0_20 => FF_RX_D_0_20,
+   FF_RX_D_0_21 => FF_RX_D_0_21,
+   FF_RX_D_0_22 => FF_RX_D_0_22,
+   FF_RX_D_0_23 => FF_RX_D_0_23,
+   FF_RX_D_1_0 => FF_RX_D_1_0,
+   FF_RX_D_1_1 => FF_RX_D_1_1,
+   FF_RX_D_1_2 => FF_RX_D_1_2,
+   FF_RX_D_1_3 => FF_RX_D_1_3,
+   FF_RX_D_1_4 => FF_RX_D_1_4,
+   FF_RX_D_1_5 => FF_RX_D_1_5,
+   FF_RX_D_1_6 => FF_RX_D_1_6,
+   FF_RX_D_1_7 => FF_RX_D_1_7,
+   FF_RX_D_1_8 => FF_RX_D_1_8,
+   FF_RX_D_1_9 => FF_RX_D_1_9,
+   FF_RX_D_1_10 => FF_RX_D_1_10,
+   FF_RX_D_1_11 => FF_RX_D_1_11,
+   FF_RX_D_1_12 => FF_RX_D_1_12,
+   FF_RX_D_1_13 => FF_RX_D_1_13,
+   FF_RX_D_1_14 => FF_RX_D_1_14,
+   FF_RX_D_1_15 => FF_RX_D_1_15,
+   FF_RX_D_1_16 => FF_RX_D_1_16,
+   FF_RX_D_1_17 => FF_RX_D_1_17,
+   FF_RX_D_1_18 => FF_RX_D_1_18,
+   FF_RX_D_1_19 => FF_RX_D_1_19,
+   FF_RX_D_1_20 => FF_RX_D_1_20,
+   FF_RX_D_1_21 => FF_RX_D_1_21,
+   FF_RX_D_1_22 => FF_RX_D_1_22,
+   FF_RX_D_1_23 => FF_RX_D_1_23,
+   FF_RX_D_2_0 => FF_RX_D_2_0,
+   FF_RX_D_2_1 => FF_RX_D_2_1,
+   FF_RX_D_2_2 => FF_RX_D_2_2,
+   FF_RX_D_2_3 => FF_RX_D_2_3,
+   FF_RX_D_2_4 => FF_RX_D_2_4,
+   FF_RX_D_2_5 => FF_RX_D_2_5,
+   FF_RX_D_2_6 => FF_RX_D_2_6,
+   FF_RX_D_2_7 => FF_RX_D_2_7,
+   FF_RX_D_2_8 => FF_RX_D_2_8,
+   FF_RX_D_2_9 => FF_RX_D_2_9,
+   FF_RX_D_2_10 => FF_RX_D_2_10,
+   FF_RX_D_2_11 => FF_RX_D_2_11,
+   FF_RX_D_2_12 => FF_RX_D_2_12,
+   FF_RX_D_2_13 => FF_RX_D_2_13,
+   FF_RX_D_2_14 => FF_RX_D_2_14,
+   FF_RX_D_2_15 => FF_RX_D_2_15,
+   FF_RX_D_2_16 => FF_RX_D_2_16,
+   FF_RX_D_2_17 => FF_RX_D_2_17,
+   FF_RX_D_2_18 => FF_RX_D_2_18,
+   FF_RX_D_2_19 => FF_RX_D_2_19,
+   FF_RX_D_2_20 => FF_RX_D_2_20,
+   FF_RX_D_2_21 => FF_RX_D_2_21,
+   FF_RX_D_2_22 => FF_RX_D_2_22,
+   FF_RX_D_2_23 => FF_RX_D_2_23,
+   FF_RX_D_3_0 => FF_RX_D_3_0,
+   FF_RX_D_3_1 => FF_RX_D_3_1,
+   FF_RX_D_3_2 => FF_RX_D_3_2,
+   FF_RX_D_3_3 => FF_RX_D_3_3,
+   FF_RX_D_3_4 => FF_RX_D_3_4,
+   FF_RX_D_3_5 => FF_RX_D_3_5,
+   FF_RX_D_3_6 => FF_RX_D_3_6,
+   FF_RX_D_3_7 => FF_RX_D_3_7,
+   FF_RX_D_3_8 => FF_RX_D_3_8,
+   FF_RX_D_3_9 => FF_RX_D_3_9,
+   FF_RX_D_3_10 => FF_RX_D_3_10,
+   FF_RX_D_3_11 => FF_RX_D_3_11,
+   FF_RX_D_3_12 => FF_RX_D_3_12,
+   FF_RX_D_3_13 => FF_RX_D_3_13,
+   FF_RX_D_3_14 => FF_RX_D_3_14,
+   FF_RX_D_3_15 => FF_RX_D_3_15,
+   FF_RX_D_3_16 => FF_RX_D_3_16,
+   FF_RX_D_3_17 => FF_RX_D_3_17,
+   FF_RX_D_3_18 => FF_RX_D_3_18,
+   FF_RX_D_3_19 => FF_RX_D_3_19,
+   FF_RX_D_3_20 => FF_RX_D_3_20,
+   FF_RX_D_3_21 => FF_RX_D_3_21,
+   FF_RX_D_3_22 => FF_RX_D_3_22,
+   FF_RX_D_3_23 => FF_RX_D_3_23,
+   FF_RX_F_CLK_0 => FF_RX_F_CLK_0,
+   FF_RX_F_CLK_1 => FF_RX_F_CLK_1,
+   FF_RX_F_CLK_2 => FF_RX_F_CLK_2,
+   FF_RX_F_CLK_3 => FF_RX_F_CLK_3,
+   FF_RX_H_CLK_0 => FF_RX_H_CLK_0,
+   FF_RX_H_CLK_1 => FF_RX_H_CLK_1,
+   FF_RX_H_CLK_2 => FF_RX_H_CLK_2,
+   FF_RX_H_CLK_3 => FF_RX_H_CLK_3,
+   FF_TX_F_CLK_0 => FF_TX_F_CLK_0,
+   FF_TX_F_CLK_1 => FF_TX_F_CLK_1,
+   FF_TX_F_CLK_2 => FF_TX_F_CLK_2,
+   FF_TX_F_CLK_3 => FF_TX_F_CLK_3,
+   FF_TX_H_CLK_0 => FF_TX_H_CLK_0,
+   FF_TX_H_CLK_1 => FF_TX_H_CLK_1,
+   FF_TX_H_CLK_2 => FF_TX_H_CLK_2,
+   FF_TX_H_CLK_3 => FF_TX_H_CLK_3,
+   FFS_CC_OVERRUN_0 => FFS_CC_OVERRUN_0,
+   FFS_CC_OVERRUN_1 => FFS_CC_OVERRUN_1,
+   FFS_CC_OVERRUN_2 => FFS_CC_OVERRUN_2,
+   FFS_CC_OVERRUN_3 => FFS_CC_OVERRUN_3,
+   FFS_CC_UNDERRUN_0 => FFS_CC_UNDERRUN_0,
+   FFS_CC_UNDERRUN_1 => FFS_CC_UNDERRUN_1,
+   FFS_CC_UNDERRUN_2 => FFS_CC_UNDERRUN_2,
+   FFS_CC_UNDERRUN_3 => FFS_CC_UNDERRUN_3,
+   FFS_LS_SYNC_STATUS_0 => FFS_LS_SYNC_STATUS_0,
+   FFS_LS_SYNC_STATUS_1 => FFS_LS_SYNC_STATUS_1,
+   FFS_LS_SYNC_STATUS_2 => FFS_LS_SYNC_STATUS_2,
+   FFS_LS_SYNC_STATUS_3 => FFS_LS_SYNC_STATUS_3,
+   FFS_CDR_TRAIN_DONE_0 => FFS_CDR_TRAIN_DONE_0,
+   FFS_CDR_TRAIN_DONE_1 => FFS_CDR_TRAIN_DONE_1,
+   FFS_CDR_TRAIN_DONE_2 => FFS_CDR_TRAIN_DONE_2,
+   FFS_CDR_TRAIN_DONE_3 => FFS_CDR_TRAIN_DONE_3,
+   FFS_PCIE_CON_0 => FFS_PCIE_CON_0,
+   FFS_PCIE_CON_1 => FFS_PCIE_CON_1,
+   FFS_PCIE_CON_2 => FFS_PCIE_CON_2,
+   FFS_PCIE_CON_3 => FFS_PCIE_CON_3,
+   FFS_PCIE_DONE_0 => FFS_PCIE_DONE_0,
+   FFS_PCIE_DONE_1 => FFS_PCIE_DONE_1,
+   FFS_PCIE_DONE_2 => FFS_PCIE_DONE_2,
+   FFS_PCIE_DONE_3 => FFS_PCIE_DONE_3,
+   FFS_PLOL => FFS_PLOL,
+   FFS_RLOL_0 => FFS_RLOL_0,
+   FFS_RLOL_1 => FFS_RLOL_1,
+   FFS_RLOL_2 => FFS_RLOL_2,
+   FFS_RLOL_3 => FFS_RLOL_3,
+   FFS_RLOS_HI_0 => FFS_RLOS_HI_0,
+   FFS_RLOS_HI_1 => FFS_RLOS_HI_1,
+   FFS_RLOS_HI_2 => FFS_RLOS_HI_2,
+   FFS_RLOS_HI_3 => FFS_RLOS_HI_3,
+   FFS_RLOS_LO_0 => FFS_RLOS_LO_0,
+   FFS_RLOS_LO_1 => FFS_RLOS_LO_1,
+   FFS_RLOS_LO_2 => FFS_RLOS_LO_2,
+   FFS_RLOS_LO_3 => FFS_RLOS_LO_3,
+   FFS_RXFBFIFO_ERROR_0 => FFS_RXFBFIFO_ERROR_0,
+   FFS_RXFBFIFO_ERROR_1 => FFS_RXFBFIFO_ERROR_1,
+   FFS_RXFBFIFO_ERROR_2 => FFS_RXFBFIFO_ERROR_2,
+   FFS_RXFBFIFO_ERROR_3 => FFS_RXFBFIFO_ERROR_3,
+   FFS_TXFBFIFO_ERROR_0 => FFS_TXFBFIFO_ERROR_0,
+   FFS_TXFBFIFO_ERROR_1 => FFS_TXFBFIFO_ERROR_1,
+   FFS_TXFBFIFO_ERROR_2 => FFS_TXFBFIFO_ERROR_2,
+   FFS_TXFBFIFO_ERROR_3 => FFS_TXFBFIFO_ERROR_3,
+   PCIE_PHYSTATUS_0 => PCIE_PHYSTATUS_0,
+   PCIE_PHYSTATUS_1 => PCIE_PHYSTATUS_1,
+   PCIE_PHYSTATUS_2 => PCIE_PHYSTATUS_2,
+   PCIE_PHYSTATUS_3 => PCIE_PHYSTATUS_3,
+   PCIE_RXVALID_0 => PCIE_RXVALID_0,
+   PCIE_RXVALID_1 => PCIE_RXVALID_1,
+   PCIE_RXVALID_2 => PCIE_RXVALID_2,
+   PCIE_RXVALID_3 => PCIE_RXVALID_3,
+   FFS_SKP_ADDED_0 => FFS_SKP_ADDED_0,
+   FFS_SKP_ADDED_1 => FFS_SKP_ADDED_1,
+   FFS_SKP_ADDED_2 => FFS_SKP_ADDED_2,
+   FFS_SKP_ADDED_3 => FFS_SKP_ADDED_3,
+   FFS_SKP_DELETED_0 => FFS_SKP_DELETED_0,
+   FFS_SKP_DELETED_1 => FFS_SKP_DELETED_1,
+   FFS_SKP_DELETED_2 => FFS_SKP_DELETED_2,
+   FFS_SKP_DELETED_3 => FFS_SKP_DELETED_3,
+   LDR_RX2CORE_0 => LDR_RX2CORE_0,
+   LDR_RX2CORE_1 => LDR_RX2CORE_1,
+   LDR_RX2CORE_2 => LDR_RX2CORE_2,
+   LDR_RX2CORE_3 => LDR_RX2CORE_3,
+   REFCK2CORE => REFCK2CORE,
+   SCIINT => SCIINT,
+   SCIRDATA0 => SCIRDATA0,
+   SCIRDATA1 => SCIRDATA1,
+   SCIRDATA2 => SCIRDATA2,
+   SCIRDATA3 => SCIRDATA3,
+   SCIRDATA4 => SCIRDATA4,
+   SCIRDATA5 => SCIRDATA5,
+   SCIRDATA6 => SCIRDATA6,
+   SCIRDATA7 => SCIRDATA7,
+   REFCLK_FROM_NQ => REFCLK_FROM_NQ,
+   REFCLK_TO_NQ => REFCLK_TO_NQ
+   );
+
+end PCSD_arch;
+
+--synopsys translate_on
+
+--THIS MODULE IS INSTANTIATED PER RX CHANNEL
+--Reset Sequence Generator
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+                                                                                              
+entity sfp_0_200_ctcrx_reset_sm is
+generic (count_index: integer :=18);
+port (
+   rst_n       : in std_logic;
+   refclkdiv2        : in std_logic;
+   tx_pll_lol_qd_s   : in std_logic;
+   rx_serdes_rst_ch_c: out std_logic;
+   rx_cdr_lol_ch_s   : in std_logic;
+   rx_los_low_ch_s   : in std_logic;
+   rx_pcs_rst_ch_c   : out std_logic
+);
+end sfp_0_200_ctcrx_reset_sm ;
+                                                                                              
+architecture rx_reset_sm_arch of sfp_0_200_ctcrx_reset_sm is
+                                                                                              
+type statetype is (WAIT_FOR_PLOL, RX_SERDES_RESET, WAIT_FOR_TIMER1, CHECK_LOL_LOS, WAIT_FOR_TIMER2, NORMAL);
+                                                                                              
+signal   cs:      statetype;  -- current state of lsm
+signal   ns:      statetype;  -- next state of lsm
+                                                                                              
+signal   tx_pll_lol_qd_s_int: std_logic;
+signal   rx_los_low_int:         std_logic;
+signal   plol_los_int:        std_logic;
+signal   rx_lol_los  :  std_logic;
+signal   rx_lol_los_int:      std_logic;
+signal   rx_lol_los_del:      std_logic;
+signal   rx_pcs_rst_ch_c_int: std_logic;
+signal   rx_serdes_rst_ch_c_int: std_logic;
+                                                                                              
+signal   reset_timer1:  std_logic;
+signal   reset_timer2:  std_logic;
+                                                                                              
+signal   counter1:   std_logic_vector(1 downto 0);
+signal   TIMER1:  std_logic;
+                                                                                              
+signal   counter2: std_logic_vector(18 downto 0);
+signal   TIMER2   : std_logic;
+                                                                                              
+begin
+                                                                                              
+rx_lol_los <= rx_cdr_lol_ch_s or rx_los_low_ch_s ;
+                                                                                              
+process(refclkdiv2,rst_n)
+begin
+   if rising_edge(refclkdiv2) then
+      if rst_n = '0' then
+         cs <= WAIT_FOR_PLOL;
+         rx_lol_los_int <= '1';
+         rx_lol_los_del <= '1';
+         tx_pll_lol_qd_s_int <= '1';
+         rx_pcs_rst_ch_c <= '1';
+         rx_serdes_rst_ch_c <= '0';
+         rx_los_low_int <= '1';
+      else
+         cs <= ns;
+         rx_lol_los_del <= rx_lol_los;
+         rx_lol_los_int <= rx_lol_los_del;
+         tx_pll_lol_qd_s_int <= tx_pll_lol_qd_s;
+         rx_pcs_rst_ch_c <= rx_pcs_rst_ch_c_int;
+         rx_serdes_rst_ch_c <= rx_serdes_rst_ch_c_int;
+         rx_los_low_int <= rx_los_low_ch_s;
+      end if;
+   end if;
+end process;
+                                                                                              
+--TIMER1 = 3NS;
+--Fastest REFCLK = 312 MHz, or 3ns. We need 1 REFCLK cycles or 2 REFCLKDIV2 cycles
+--A 1 bit counter  counts 2 cycles, so a 2 bit ([1:0]) counter will do if we set TIMER1 = bit[1]
+                                                                                              
+process(refclkdiv2, reset_timer1)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer1 = '1' then
+         counter1 <= "00";
+         TIMER1 <= '0';
+      else
+         if counter1(1) = '1' then
+            TIMER1 <='1';
+         else
+            TIMER1 <='0';
+            counter1 <= counter1 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+--TIMER2 = 400,000 Refclk cycles or 200,000 REFCLKDIV2 cycles
+--An 18 bit counter ([17:0]) counts 262144 cycles, so a 19 bit ([18:0]) counter will do if we set TIMER2 = bit[18]
+                                                                                              
+process(refclkdiv2, reset_timer2)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer2 = '1' then
+         counter2 <= "0000000000000000000";
+         TIMER2 <= '0';
+      else
+         if counter2(count_index) = '1' then
+            TIMER2 <='1';
+         else
+            TIMER2 <='0';
+            counter2 <= counter2 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+                                                                                              
+process(cs, tx_pll_lol_qd_s_int, rx_los_low_int, TIMER1, rx_lol_los_int, TIMER2)
+begin
+      reset_timer1 <= '0';
+      reset_timer2 <= '0';
+                                                                                              
+   case cs is
+      when WAIT_FOR_PLOL =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         if (tx_pll_lol_qd_s_int = '1' or rx_los_low_int = '1') then  --Also make sure A Signal
+            ns <= WAIT_FOR_PLOL;             --is Present prior to moving to the next
+         else
+            ns <= RX_SERDES_RESET;
+            end if;
+                                                                                              
+       when RX_SERDES_RESET =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '1';
+         reset_timer1 <= '1';
+            ns <= WAIT_FOR_TIMER1;
+                                                                                              
+                                                                                              
+      when WAIT_FOR_TIMER1 =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '1';
+         if TIMER1 = '1' then
+            ns <= CHECK_LOL_LOS;
+         else
+            ns <= WAIT_FOR_TIMER1;
+            end if;
+                                                                                              
+      when CHECK_LOL_LOS =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         reset_timer2 <= '1';
+            ns <= WAIT_FOR_TIMER2;
+                                                                                              
+      when WAIT_FOR_TIMER2 =>
+         rx_pcs_rst_ch_c_int <= '1';
+         rx_serdes_rst_ch_c_int <= '0';
+         if rx_lol_los_int = rx_lol_los_del then   --NO RISING OR FALLING EDGES
+            if TIMER2 = '1' then
+               if rx_lol_los_int = '1' then
+                  ns <= WAIT_FOR_PLOL;
+               else
+                  ns <= NORMAL;
+               end if;
+            else
+               ns <= WAIT_FOR_TIMER2;
+            end if;
+         else
+               ns <= CHECK_LOL_LOS;    --RESET TIMER2
+         end if;
+                                                                                              
+      when NORMAL =>
+         rx_pcs_rst_ch_c_int <= '0';
+         rx_serdes_rst_ch_c_int <= '0';
+         if rx_lol_los_int = '1' then
+            ns <= WAIT_FOR_PLOL;
+         else
+            ns <= NORMAL;
+         end if;
+                                                                                              
+      when others =>
+         ns <= WAIT_FOR_PLOL;
+                                                                                              
+      end case;
+                                                                                              
+end process;
+                                                                                              
+                                                                                              
+end rx_reset_sm_arch;
+
+--THIS MODULE IS INSTANTIATED PER TX  QUAD
+--TX Reset Sequence state machine--
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+                                                                                              
+entity sfp_0_200_ctctx_reset_sm is
+generic (count_index: integer :=18);
+port (
+   rst_n          : in std_logic;
+   refclkdiv2      : in std_logic;
+   tx_pll_lol_qd_s : in std_logic;
+   rst_qd_c    : out std_logic;
+   tx_pcs_rst_ch_c : out std_logic
+   );
+end sfp_0_200_ctctx_reset_sm;
+                                                                                              
+architecture tx_reset_sm_arch of sfp_0_200_ctctx_reset_sm is
+                                                                                              
+type statetype is (QUAD_RESET, WAIT_FOR_TIMER1, CHECK_PLOL, WAIT_FOR_TIMER2, NORMAL);
+                                                                                              
+signal   cs:      statetype;  -- current state of lsm
+signal   ns:      statetype;  -- next state of lsm
+                                                                                              
+signal   tx_pll_lol_qd_s_int  : std_logic;
+signal   tx_pcs_rst_ch_c_int  : std_logic_vector(3 downto 0);
+signal   rst_qd_c_int      : std_logic;
+                                                                                              
+signal   reset_timer1:  std_logic;
+signal   reset_timer2:  std_logic;
+                                                                                              
+signal   counter1:      std_logic_vector(2 downto 0);
+signal   TIMER1:        std_logic;
+                                                                                              
+signal   counter2:      std_logic_vector(18 downto 0);
+signal   TIMER2:        std_logic;
+                                                                                              
+begin
+                                                                                              
+process (refclkdiv2, rst_n)
+begin
+   if rst_n = '0' then
+      cs <= QUAD_RESET;
+      tx_pll_lol_qd_s_int <= '1';
+      tx_pcs_rst_ch_c <= '1';
+      rst_qd_c <= '1';
+   else if rising_edge(refclkdiv2) then
+      cs <= ns;
+      tx_pll_lol_qd_s_int <= tx_pll_lol_qd_s;
+      tx_pcs_rst_ch_c <= tx_pcs_rst_ch_c_int(0);
+      rst_qd_c <= rst_qd_c_int;
+   end if;
+   end if;
+end process;
+--TIMER1 = 20ns;
+--Fastest REFLCK =312 MHZ, or 3 ns. We need 8 REFCLK cycles or 4 REFCLKDIV2 cycles
+-- A 2 bit counter ([1:0]) counts 4 cycles, so a 3 bit ([2:0]) counter will do if we set TIMER1 = bit[2]
+                                                                                              
+                                                                                              
+process (refclkdiv2, reset_timer1)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer1 = '1' then
+         counter1 <= "000";
+         TIMER1 <= '0';
+      else
+         if counter1(2) = '1' then
+            TIMER1 <= '1';
+         else
+            TIMER1 <='0';
+            counter1 <= counter1 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+                                                                                              
+--TIMER2 = 1,400,000 UI;
+--WORST CASE CYCLES is with smallest multipier factor.
+-- This would be with X8 clock multiplier in DIV2 mode
+-- IN this casse, 1 UI = 2/8 REFCLK  CYCLES = 1/8 REFCLKDIV2 CYCLES
+-- SO 1,400,000 UI =1,400,000/8 = 175,000 REFCLKDIV2 CYCLES
+-- An 18 bit counter ([17:0]) counts 262144 cycles, so a 19 bit ([18:0]) counter will do if we set TIMER2 = bit[18]
+                                                                                              
+                                                                                              
+process(refclkdiv2, reset_timer2)
+begin
+   if rising_edge(refclkdiv2) then
+      if reset_timer2 = '1' then
+         counter2 <= "0000000000000000000";
+         TIMER2 <= '0';
+      else
+         if counter2(count_index) = '1' then
+            TIMER2 <='1';
+         else
+            TIMER2 <='0';
+            counter2 <= counter2 + 1 ;
+         end if;
+      end if;
+   end if;
+end process;
+                                                                                              
+process(cs, TIMER1, TIMER2, tx_pll_lol_qd_s_int)
+begin
+                                                                                              
+      reset_timer1 <= '0';
+      reset_timer2 <= '0';
+                                                                                              
+   case cs is
+                                                                                              
+      when QUAD_RESET   =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '1';
+      reset_timer1 <= '1';
+         ns <= WAIT_FOR_TIMER1;
+                                                                                              
+      when WAIT_FOR_TIMER1 =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '1';
+      if TIMER1 = '1' then
+         ns <= CHECK_PLOL;
+      else
+         ns <= WAIT_FOR_TIMER1;
+         end if;
+                                                                                              
+      when CHECK_PLOL   =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '0';
+      reset_timer2 <= '1';
+         ns <= WAIT_FOR_TIMER2;
+                                                                                              
+      when WAIT_FOR_TIMER2 =>
+      tx_pcs_rst_ch_c_int <= "1111";
+      rst_qd_c_int <= '0';
+      if TIMER2 = '1' then
+         if tx_pll_lol_qd_s_int = '1' then
+            ns <= QUAD_RESET;
+         else
+            ns <= NORMAL;
+         end if;
+      else
+            ns <= WAIT_FOR_TIMER2;
+            end if;
+                                                                                              
+   when NORMAL =>
+      tx_pcs_rst_ch_c_int <= "0000";
+      rst_qd_c_int <= '0';
+      if tx_pll_lol_qd_s_int = '1' then
+         ns <= QUAD_RESET;
+      else
+         ns <= NORMAL;
+         end if;
+                                                                                              
+   when others =>
+      ns <=    QUAD_RESET;
+                                                                                              
+   end case;
+                                                                                              
+end process;
+                                                                                              
+end tx_reset_sm_arch;
+
+
+--synopsys translate_off
+library ECP3;
+use ECP3.components.all;
+--synopsys translate_on
+
+
+library IEEE, STD;
+use IEEE.std_logic_1164.all;
+use STD.TEXTIO.all;
+
+entity sfp_0_200_ctc is
+   GENERIC (USER_CONFIG_FILE    :  String := "sfp_0_200_ctc.txt");
+ port (
+------------------
+-- CH0 --
+    hdinp_ch0, hdinn_ch0    :   in std_logic;
+    hdoutp_ch0, hdoutn_ch0   :   out std_logic;
+    sci_sel_ch0    :   in std_logic;
+    rxiclk_ch0    :   in std_logic;
+    txiclk_ch0    :   in std_logic;
+    rx_full_clk_ch0   :   out std_logic;
+    rx_half_clk_ch0   :   out std_logic;
+    tx_full_clk_ch0   :   out std_logic;
+    tx_half_clk_ch0   :   out std_logic;
+    fpga_rxrefclk_ch0    :   in std_logic;
+    txdata_ch0    :   in std_logic_vector (15 downto 0);
+    tx_k_ch0    :   in std_logic_vector (1 downto 0);
+    tx_force_disp_ch0    :   in std_logic_vector (1 downto 0);
+    tx_disp_sel_ch0    :   in std_logic_vector (1 downto 0);
+    rxdata_ch0   :   out std_logic_vector (15 downto 0);
+    rx_k_ch0   :   out std_logic_vector (1 downto 0);
+    rx_disp_err_ch0   :   out std_logic_vector (1 downto 0);
+    rx_cv_err_ch0   :   out std_logic_vector (1 downto 0);
+    sb_felb_ch0_c    :   in std_logic;
+    sb_felb_rst_ch0_c    :   in std_logic;
+    tx_pwrup_ch0_c    :   in std_logic;
+    rx_pwrup_ch0_c    :   in std_logic;
+    rx_los_low_ch0_s   :   out std_logic;
+    lsm_status_ch0_s   :   out std_logic;
+    ctc_urun_ch0_s   :   out std_logic;
+    ctc_orun_ch0_s   :   out std_logic;
+    ctc_ins_ch0_s   :   out std_logic;
+    ctc_del_ch0_s   :   out std_logic;
+    rx_cdr_lol_ch0_s   :   out std_logic;
+    tx_div2_mode_ch0_c   : in std_logic;
+    rx_div2_mode_ch0_c   : in std_logic;
+-- CH1 --
+-- CH2 --
+-- CH3 --
+---- Miscillaneous ports
+    sci_wrdata    :   in std_logic_vector (7 downto 0);
+    sci_addr    :   in std_logic_vector (5 downto 0);
+    sci_rddata   :   out std_logic_vector (7 downto 0);
+    sci_sel_quad    :   in std_logic;
+    sci_rd    :   in std_logic;
+    sci_wrn    :   in std_logic;
+    fpga_txrefclk  :   in std_logic;
+    tx_serdes_rst_c    :   in std_logic;
+    tx_pll_lol_qd_s   :   out std_logic;
+    rst_n      :   in std_logic;
+    serdes_rst_qd_c    :   in std_logic);
+
+end sfp_0_200_ctc;
+
+
+architecture sfp_0_200_ctc_arch of sfp_0_200_ctc is
+
+component VLO
+port (
+   Z : out std_logic);
+end component;
+
+component VHI
+port (
+   Z : out std_logic);
+end component;
+
+component sfp_0_200_ctcrx_reset_sm
+generic (count_index: integer :=18);
+port (
+   rst_n       : in std_logic;
+   refclkdiv2        : in std_logic;
+   tx_pll_lol_qd_s   : in std_logic;
+   rx_serdes_rst_ch_c: out std_logic;
+   rx_cdr_lol_ch_s   : in std_logic;
+   rx_los_low_ch_s   : in std_logic;
+   rx_pcs_rst_ch_c   : out std_logic
+);
+end component ;
+
+component sfp_0_200_ctctx_reset_sm
+generic (count_index: integer :=18);
+port (
+   rst_n          : in std_logic;
+   refclkdiv2      : in std_logic;
+   tx_pll_lol_qd_s : in std_logic;
+   rst_qd_c    : out std_logic;
+   tx_pcs_rst_ch_c : out std_logic
+   );
+end component;
+
+component PCSD
+--synopsys translate_off
+GENERIC(
+  CONFIG_FILE : String;
+  QUAD_MODE : String;
+  CH0_CDR_SRC   : String := "REFCLK_EXT";
+  CH1_CDR_SRC   : String := "REFCLK_EXT";
+  CH2_CDR_SRC   : String := "REFCLK_EXT";
+  CH3_CDR_SRC   : String := "REFCLK_EXT";
+  PLL_SRC   : String
+  );
+--synopsys translate_on
+port (
+  HDINN0             : in std_logic;
+  HDINN1             : in std_logic;
+  HDINN2             : in std_logic;
+  HDINN3             : in std_logic;
+  HDINP0             : in std_logic;
+  HDINP1             : in std_logic;
+  HDINP2             : in std_logic;
+  HDINP3             : in std_logic;
+  REFCLKN             : in std_logic;
+  REFCLKP             : in std_logic;
+  CIN0             : in std_logic;
+  CIN1             : in std_logic;
+  CIN2             : in std_logic;
+  CIN3             : in std_logic;
+  CIN4             : in std_logic;
+  CIN5             : in std_logic;
+  CIN6             : in std_logic;
+  CIN7             : in std_logic;
+  CIN8             : in std_logic;
+  CIN9             : in std_logic;
+  CIN10             : in std_logic;
+  CIN11             : in std_logic;
+  CYAWSTN             : in std_logic;
+  FF_EBRD_CLK_0             : in std_logic;
+  FF_EBRD_CLK_1             : in std_logic;
+  FF_EBRD_CLK_2             : in std_logic;
+  FF_EBRD_CLK_3             : in std_logic;
+  FF_RXI_CLK_0             : in std_logic;
+  FF_RXI_CLK_1             : in std_logic;
+  FF_RXI_CLK_2             : in std_logic;
+  FF_RXI_CLK_3             : in std_logic;
+  FF_TX_D_0_0             : in std_logic;
+  FF_TX_D_0_1             : in std_logic;
+  FF_TX_D_0_2             : in std_logic;
+  FF_TX_D_0_3             : in std_logic;
+  FF_TX_D_0_4             : in std_logic;
+  FF_TX_D_0_5             : in std_logic;
+  FF_TX_D_0_6             : in std_logic;
+  FF_TX_D_0_7             : in std_logic;
+  FF_TX_D_0_8             : in std_logic;
+  FF_TX_D_0_9             : in std_logic;
+  FF_TX_D_0_10             : in std_logic;
+  FF_TX_D_0_11             : in std_logic;
+  FF_TX_D_0_12             : in std_logic;
+  FF_TX_D_0_13             : in std_logic;
+  FF_TX_D_0_14             : in std_logic;
+  FF_TX_D_0_15             : in std_logic;
+  FF_TX_D_0_16             : in std_logic;
+  FF_TX_D_0_17             : in std_logic;
+  FF_TX_D_0_18             : in std_logic;
+  FF_TX_D_0_19             : in std_logic;
+  FF_TX_D_0_20             : in std_logic;
+  FF_TX_D_0_21             : in std_logic;
+  FF_TX_D_0_22             : in std_logic;
+  FF_TX_D_0_23             : in std_logic;
+  FF_TX_D_1_0             : in std_logic;
+  FF_TX_D_1_1             : in std_logic;
+  FF_TX_D_1_2             : in std_logic;
+  FF_TX_D_1_3             : in std_logic;
+  FF_TX_D_1_4             : in std_logic;
+  FF_TX_D_1_5             : in std_logic;
+  FF_TX_D_1_6             : in std_logic;
+  FF_TX_D_1_7             : in std_logic;
+  FF_TX_D_1_8             : in std_logic;
+  FF_TX_D_1_9             : in std_logic;
+  FF_TX_D_1_10             : in std_logic;
+  FF_TX_D_1_11             : in std_logic;
+  FF_TX_D_1_12             : in std_logic;
+  FF_TX_D_1_13             : in std_logic;
+  FF_TX_D_1_14             : in std_logic;
+  FF_TX_D_1_15             : in std_logic;
+  FF_TX_D_1_16             : in std_logic;
+  FF_TX_D_1_17             : in std_logic;
+  FF_TX_D_1_18             : in std_logic;
+  FF_TX_D_1_19             : in std_logic;
+  FF_TX_D_1_20             : in std_logic;
+  FF_TX_D_1_21             : in std_logic;
+  FF_TX_D_1_22             : in std_logic;
+  FF_TX_D_1_23             : in std_logic;
+  FF_TX_D_2_0             : in std_logic;
+  FF_TX_D_2_1             : in std_logic;
+  FF_TX_D_2_2             : in std_logic;
+  FF_TX_D_2_3             : in std_logic;
+  FF_TX_D_2_4             : in std_logic;
+  FF_TX_D_2_5             : in std_logic;
+  FF_TX_D_2_6             : in std_logic;
+  FF_TX_D_2_7             : in std_logic;
+  FF_TX_D_2_8             : in std_logic;
+  FF_TX_D_2_9             : in std_logic;
+  FF_TX_D_2_10             : in std_logic;
+  FF_TX_D_2_11             : in std_logic;
+  FF_TX_D_2_12             : in std_logic;
+  FF_TX_D_2_13             : in std_logic;
+  FF_TX_D_2_14             : in std_logic;
+  FF_TX_D_2_15             : in std_logic;
+  FF_TX_D_2_16             : in std_logic;
+  FF_TX_D_2_17             : in std_logic;
+  FF_TX_D_2_18             : in std_logic;
+  FF_TX_D_2_19             : in std_logic;
+  FF_TX_D_2_20             : in std_logic;
+  FF_TX_D_2_21             : in std_logic;
+  FF_TX_D_2_22             : in std_logic;
+  FF_TX_D_2_23             : in std_logic;
+  FF_TX_D_3_0             : in std_logic;
+  FF_TX_D_3_1             : in std_logic;
+  FF_TX_D_3_2             : in std_logic;
+  FF_TX_D_3_3             : in std_logic;
+  FF_TX_D_3_4             : in std_logic;
+  FF_TX_D_3_5             : in std_logic;
+  FF_TX_D_3_6             : in std_logic;
+  FF_TX_D_3_7             : in std_logic;
+  FF_TX_D_3_8             : in std_logic;
+  FF_TX_D_3_9             : in std_logic;
+  FF_TX_D_3_10             : in std_logic;
+  FF_TX_D_3_11             : in std_logic;
+  FF_TX_D_3_12             : in std_logic;
+  FF_TX_D_3_13             : in std_logic;
+  FF_TX_D_3_14             : in std_logic;
+  FF_TX_D_3_15             : in std_logic;
+  FF_TX_D_3_16             : in std_logic;
+  FF_TX_D_3_17             : in std_logic;
+  FF_TX_D_3_18             : in std_logic;
+  FF_TX_D_3_19             : in std_logic;
+  FF_TX_D_3_20             : in std_logic;
+  FF_TX_D_3_21             : in std_logic;
+  FF_TX_D_3_22             : in std_logic;
+  FF_TX_D_3_23             : in std_logic;
+  FF_TXI_CLK_0             : in std_logic;
+  FF_TXI_CLK_1             : in std_logic;
+  FF_TXI_CLK_2             : in std_logic;
+  FF_TXI_CLK_3             : in std_logic;
+  FFC_CK_CORE_RX_0         : in std_logic;
+  FFC_CK_CORE_RX_1         : in std_logic;
+  FFC_CK_CORE_RX_2         : in std_logic;
+  FFC_CK_CORE_RX_3         : in std_logic;
+  FFC_CK_CORE_TX           : in std_logic;
+  FFC_EI_EN_0             : in std_logic;
+  FFC_EI_EN_1             : in std_logic;
+  FFC_EI_EN_2             : in std_logic;
+  FFC_EI_EN_3             : in std_logic;
+  FFC_ENABLE_CGALIGN_0             : in std_logic;
+  FFC_ENABLE_CGALIGN_1             : in std_logic;
+  FFC_ENABLE_CGALIGN_2             : in std_logic;
+  FFC_ENABLE_CGALIGN_3             : in std_logic;
+  FFC_FB_LOOPBACK_0             : in std_logic;
+  FFC_FB_LOOPBACK_1             : in std_logic;
+  FFC_FB_LOOPBACK_2             : in std_logic;
+  FFC_FB_LOOPBACK_3             : in std_logic;
+  FFC_LANE_RX_RST_0             : in std_logic;
+  FFC_LANE_RX_RST_1             : in std_logic;
+  FFC_LANE_RX_RST_2             : in std_logic;
+  FFC_LANE_RX_RST_3             : in std_logic;
+  FFC_LANE_TX_RST_0             : in std_logic;
+  FFC_LANE_TX_RST_1             : in std_logic;
+  FFC_LANE_TX_RST_2             : in std_logic;
+  FFC_LANE_TX_RST_3             : in std_logic;
+  FFC_MACRO_RST             : in std_logic;
+  FFC_PCI_DET_EN_0             : in std_logic;
+  FFC_PCI_DET_EN_1             : in std_logic;
+  FFC_PCI_DET_EN_2             : in std_logic;
+  FFC_PCI_DET_EN_3             : in std_logic;
+  FFC_PCIE_CT_0             : in std_logic;
+  FFC_PCIE_CT_1             : in std_logic;
+  FFC_PCIE_CT_2             : in std_logic;
+  FFC_PCIE_CT_3             : in std_logic;
+  FFC_PFIFO_CLR_0             : in std_logic;
+  FFC_PFIFO_CLR_1             : in std_logic;
+  FFC_PFIFO_CLR_2             : in std_logic;
+  FFC_PFIFO_CLR_3             : in std_logic;
+  FFC_QUAD_RST             : in std_logic;
+  FFC_RRST_0             : in std_logic;
+  FFC_RRST_1             : in std_logic;
+  FFC_RRST_2             : in std_logic;
+  FFC_RRST_3             : in std_logic;
+  FFC_RXPWDNB_0             : in std_logic;
+  FFC_RXPWDNB_1             : in std_logic;
+  FFC_RXPWDNB_2             : in std_logic;
+  FFC_RXPWDNB_3             : in std_logic;
+  FFC_SB_INV_RX_0             : in std_logic;
+  FFC_SB_INV_RX_1             : in std_logic;
+  FFC_SB_INV_RX_2             : in std_logic;
+  FFC_SB_INV_RX_3             : in std_logic;
+  FFC_SB_PFIFO_LP_0             : in std_logic;
+  FFC_SB_PFIFO_LP_1             : in std_logic;
+  FFC_SB_PFIFO_LP_2             : in std_logic;
+  FFC_SB_PFIFO_LP_3             : in std_logic;
+  FFC_SIGNAL_DETECT_0             : in std_logic;
+  FFC_SIGNAL_DETECT_1             : in std_logic;
+  FFC_SIGNAL_DETECT_2             : in std_logic;
+  FFC_SIGNAL_DETECT_3             : in std_logic;
+  FFC_SYNC_TOGGLE             : in std_logic;
+  FFC_TRST             : in std_logic;
+  FFC_TXPWDNB_0             : in std_logic;
+  FFC_TXPWDNB_1             : in std_logic;
+  FFC_TXPWDNB_2             : in std_logic;
+  FFC_TXPWDNB_3             : in std_logic;
+  FFC_RATE_MODE_RX_0        : in std_logic;
+  FFC_RATE_MODE_RX_1        : in std_logic;
+  FFC_RATE_MODE_RX_2        : in std_logic;
+  FFC_RATE_MODE_RX_3        : in std_logic;
+  FFC_RATE_MODE_TX_0        : in std_logic;
+  FFC_RATE_MODE_TX_1        : in std_logic;
+  FFC_RATE_MODE_TX_2        : in std_logic;
+  FFC_RATE_MODE_TX_3        : in std_logic;
+  FFC_DIV11_MODE_RX_0       : in std_logic;
+  FFC_DIV11_MODE_RX_1       : in std_logic;
+  FFC_DIV11_MODE_RX_2       : in std_logic;
+  FFC_DIV11_MODE_RX_3       : in std_logic;
+  FFC_DIV11_MODE_TX_0       : in std_logic;
+  FFC_DIV11_MODE_TX_1       : in std_logic;
+  FFC_DIV11_MODE_TX_2       : in std_logic;
+  FFC_DIV11_MODE_TX_3       : in std_logic;
+  LDR_CORE2TX_0             : in std_logic;
+  LDR_CORE2TX_1             : in std_logic;
+  LDR_CORE2TX_2             : in std_logic;
+  LDR_CORE2TX_3             : in std_logic;
+  FFC_LDR_CORE2TX_EN_0      : in std_logic;
+  FFC_LDR_CORE2TX_EN_1      : in std_logic;
+  FFC_LDR_CORE2TX_EN_2      : in std_logic;
+  FFC_LDR_CORE2TX_EN_3      : in std_logic;
+  PCIE_POWERDOWN_0_0      : in std_logic;
+  PCIE_POWERDOWN_0_1      : in std_logic;
+  PCIE_POWERDOWN_1_0      : in std_logic;
+  PCIE_POWERDOWN_1_1      : in std_logic;
+  PCIE_POWERDOWN_2_0      : in std_logic;
+  PCIE_POWERDOWN_2_1      : in std_logic;
+  PCIE_POWERDOWN_3_0      : in std_logic;
+  PCIE_POWERDOWN_3_1      : in std_logic;
+  PCIE_RXPOLARITY_0         : in std_logic;
+  PCIE_RXPOLARITY_1         : in std_logic;
+  PCIE_RXPOLARITY_2         : in std_logic;
+  PCIE_RXPOLARITY_3         : in std_logic;
+  PCIE_TXCOMPLIANCE_0       : in std_logic;
+  PCIE_TXCOMPLIANCE_1       : in std_logic;
+  PCIE_TXCOMPLIANCE_2       : in std_logic;
+  PCIE_TXCOMPLIANCE_3       : in std_logic;
+  PCIE_TXDETRX_PR2TLB_0     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_1     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_2     : in std_logic;
+  PCIE_TXDETRX_PR2TLB_3     : in std_logic;
+  SCIADDR0             : in std_logic;
+  SCIADDR1             : in std_logic;
+  SCIADDR2             : in std_logic;
+  SCIADDR3             : in std_logic;
+  SCIADDR4             : in std_logic;
+  SCIADDR5             : in std_logic;
+  SCIENAUX             : in std_logic;
+  SCIENCH0             : in std_logic;
+  SCIENCH1             : in std_logic;
+  SCIENCH2             : in std_logic;
+  SCIENCH3             : in std_logic;
+  SCIRD                : in std_logic;
+  SCISELAUX             : in std_logic;
+  SCISELCH0             : in std_logic;
+  SCISELCH1             : in std_logic;
+  SCISELCH2             : in std_logic;
+  SCISELCH3             : in std_logic;
+  SCIWDATA0             : in std_logic;
+  SCIWDATA1             : in std_logic;
+  SCIWDATA2             : in std_logic;
+  SCIWDATA3             : in std_logic;
+  SCIWDATA4             : in std_logic;
+  SCIWDATA5             : in std_logic;
+  SCIWDATA6             : in std_logic;
+  SCIWDATA7             : in std_logic;
+  SCIWSTN               : in std_logic;
+  REFCLK_FROM_NQ        : in std_logic;
+  HDOUTN0             : out std_logic;
+  HDOUTN1             : out std_logic;
+  HDOUTN2             : out std_logic;
+  HDOUTN3             : out std_logic;
+  HDOUTP0             : out std_logic;
+  HDOUTP1             : out std_logic;
+  HDOUTP2             : out std_logic;
+  HDOUTP3             : out std_logic;
+  COUT0             : out std_logic;
+  COUT1             : out std_logic;
+  COUT2             : out std_logic;
+  COUT3             : out std_logic;
+  COUT4             : out std_logic;
+  COUT5             : out std_logic;
+  COUT6             : out std_logic;
+  COUT7             : out std_logic;
+  COUT8             : out std_logic;
+  COUT9             : out std_logic;
+  COUT10             : out std_logic;
+  COUT11             : out std_logic;
+  COUT12             : out std_logic;
+  COUT13             : out std_logic;
+  COUT14             : out std_logic;
+  COUT15             : out std_logic;
+  COUT16             : out std_logic;
+  COUT17             : out std_logic;
+  COUT18             : out std_logic;
+  COUT19             : out std_logic;
+  FF_RX_D_0_0             : out std_logic;
+  FF_RX_D_0_1             : out std_logic;
+  FF_RX_D_0_2             : out std_logic;
+  FF_RX_D_0_3             : out std_logic;
+  FF_RX_D_0_4             : out std_logic;
+  FF_RX_D_0_5             : out std_logic;
+  FF_RX_D_0_6             : out std_logic;
+  FF_RX_D_0_7             : out std_logic;
+  FF_RX_D_0_8             : out std_logic;
+  FF_RX_D_0_9             : out std_logic;
+  FF_RX_D_0_10             : out std_logic;
+  FF_RX_D_0_11             : out std_logic;
+  FF_RX_D_0_12             : out std_logic;
+  FF_RX_D_0_13             : out std_logic;
+  FF_RX_D_0_14             : out std_logic;
+  FF_RX_D_0_15             : out std_logic;
+  FF_RX_D_0_16             : out std_logic;
+  FF_RX_D_0_17             : out std_logic;
+  FF_RX_D_0_18             : out std_logic;
+  FF_RX_D_0_19             : out std_logic;
+  FF_RX_D_0_20             : out std_logic;
+  FF_RX_D_0_21             : out std_logic;
+  FF_RX_D_0_22             : out std_logic;
+  FF_RX_D_0_23             : out std_logic;
+  FF_RX_D_1_0             : out std_logic;
+  FF_RX_D_1_1             : out std_logic;
+  FF_RX_D_1_2             : out std_logic;
+  FF_RX_D_1_3             : out std_logic;
+  FF_RX_D_1_4             : out std_logic;
+  FF_RX_D_1_5             : out std_logic;
+  FF_RX_D_1_6             : out std_logic;
+  FF_RX_D_1_7             : out std_logic;
+  FF_RX_D_1_8             : out std_logic;
+  FF_RX_D_1_9             : out std_logic;
+  FF_RX_D_1_10             : out std_logic;
+  FF_RX_D_1_11             : out std_logic;
+  FF_RX_D_1_12             : out std_logic;
+  FF_RX_D_1_13             : out std_logic;
+  FF_RX_D_1_14             : out std_logic;
+  FF_RX_D_1_15             : out std_logic;
+  FF_RX_D_1_16             : out std_logic;
+  FF_RX_D_1_17             : out std_logic;
+  FF_RX_D_1_18             : out std_logic;
+  FF_RX_D_1_19             : out std_logic;
+  FF_RX_D_1_20             : out std_logic;
+  FF_RX_D_1_21             : out std_logic;
+  FF_RX_D_1_22             : out std_logic;
+  FF_RX_D_1_23             : out std_logic;
+  FF_RX_D_2_0             : out std_logic;
+  FF_RX_D_2_1             : out std_logic;
+  FF_RX_D_2_2             : out std_logic;
+  FF_RX_D_2_3             : out std_logic;
+  FF_RX_D_2_4             : out std_logic;
+  FF_RX_D_2_5             : out std_logic;
+  FF_RX_D_2_6             : out std_logic;
+  FF_RX_D_2_7             : out std_logic;
+  FF_RX_D_2_8             : out std_logic;
+  FF_RX_D_2_9             : out std_logic;
+  FF_RX_D_2_10             : out std_logic;
+  FF_RX_D_2_11             : out std_logic;
+  FF_RX_D_2_12             : out std_logic;
+  FF_RX_D_2_13             : out std_logic;
+  FF_RX_D_2_14             : out std_logic;
+  FF_RX_D_2_15             : out std_logic;
+  FF_RX_D_2_16             : out std_logic;
+  FF_RX_D_2_17             : out std_logic;
+  FF_RX_D_2_18             : out std_logic;
+  FF_RX_D_2_19             : out std_logic;
+  FF_RX_D_2_20             : out std_logic;
+  FF_RX_D_2_21             : out std_logic;
+  FF_RX_D_2_22             : out std_logic;
+  FF_RX_D_2_23             : out std_logic;
+  FF_RX_D_3_0             : out std_logic;
+  FF_RX_D_3_1             : out std_logic;
+  FF_RX_D_3_2             : out std_logic;
+  FF_RX_D_3_3             : out std_logic;
+  FF_RX_D_3_4             : out std_logic;
+  FF_RX_D_3_5             : out std_logic;
+  FF_RX_D_3_6             : out std_logic;
+  FF_RX_D_3_7             : out std_logic;
+  FF_RX_D_3_8             : out std_logic;
+  FF_RX_D_3_9             : out std_logic;
+  FF_RX_D_3_10             : out std_logic;
+  FF_RX_D_3_11             : out std_logic;
+  FF_RX_D_3_12             : out std_logic;
+  FF_RX_D_3_13             : out std_logic;
+  FF_RX_D_3_14             : out std_logic;
+  FF_RX_D_3_15             : out std_logic;
+  FF_RX_D_3_16             : out std_logic;
+  FF_RX_D_3_17             : out std_logic;
+  FF_RX_D_3_18             : out std_logic;
+  FF_RX_D_3_19             : out std_logic;
+  FF_RX_D_3_20             : out std_logic;
+  FF_RX_D_3_21             : out std_logic;
+  FF_RX_D_3_22             : out std_logic;
+  FF_RX_D_3_23             : out std_logic;
+  FF_RX_F_CLK_0             : out std_logic;
+  FF_RX_F_CLK_1             : out std_logic;
+  FF_RX_F_CLK_2             : out std_logic;
+  FF_RX_F_CLK_3             : out std_logic;
+  FF_RX_H_CLK_0             : out std_logic;
+  FF_RX_H_CLK_1             : out std_logic;
+  FF_RX_H_CLK_2             : out std_logic;
+  FF_RX_H_CLK_3             : out std_logic;
+  FF_TX_F_CLK_0             : out std_logic;
+  FF_TX_F_CLK_1             : out std_logic;
+  FF_TX_F_CLK_2             : out std_logic;
+  FF_TX_F_CLK_3             : out std_logic;
+  FF_TX_H_CLK_0             : out std_logic;
+  FF_TX_H_CLK_1             : out std_logic;
+  FF_TX_H_CLK_2             : out std_logic;
+  FF_TX_H_CLK_3             : out std_logic;
+  FFS_CC_OVERRUN_0             : out std_logic;
+  FFS_CC_OVERRUN_1             : out std_logic;
+  FFS_CC_OVERRUN_2             : out std_logic;
+  FFS_CC_OVERRUN_3             : out std_logic;
+  FFS_CC_UNDERRUN_0             : out std_logic;
+  FFS_CC_UNDERRUN_1             : out std_logic;
+  FFS_CC_UNDERRUN_2             : out std_logic;
+  FFS_CC_UNDERRUN_3             : out std_logic;
+  FFS_LS_SYNC_STATUS_0             : out std_logic;
+  FFS_LS_SYNC_STATUS_1             : out std_logic;
+  FFS_LS_SYNC_STATUS_2             : out std_logic;
+  FFS_LS_SYNC_STATUS_3             : out std_logic;
+  FFS_CDR_TRAIN_DONE_0             : out std_logic;
+  FFS_CDR_TRAIN_DONE_1             : out std_logic;
+  FFS_CDR_TRAIN_DONE_2             : out std_logic;
+  FFS_CDR_TRAIN_DONE_3             : out std_logic;
+  FFS_PCIE_CON_0             : out std_logic;
+  FFS_PCIE_CON_1             : out std_logic;
+  FFS_PCIE_CON_2             : out std_logic;
+  FFS_PCIE_CON_3             : out std_logic;
+  FFS_PCIE_DONE_0             : out std_logic;
+  FFS_PCIE_DONE_1             : out std_logic;
+  FFS_PCIE_DONE_2             : out std_logic;
+  FFS_PCIE_DONE_3             : out std_logic;
+  FFS_PLOL             : out std_logic;
+  FFS_RLOL_0             : out std_logic;
+  FFS_RLOL_1             : out std_logic;
+  FFS_RLOL_2             : out std_logic;
+  FFS_RLOL_3             : out std_logic;
+  FFS_RLOS_HI_0             : out std_logic;
+  FFS_RLOS_HI_1             : out std_logic;
+  FFS_RLOS_HI_2             : out std_logic;
+  FFS_RLOS_HI_3             : out std_logic;
+  FFS_RLOS_LO_0             : out std_logic;
+  FFS_RLOS_LO_1             : out std_logic;
+  FFS_RLOS_LO_2             : out std_logic;
+  FFS_RLOS_LO_3             : out std_logic;
+  FFS_RXFBFIFO_ERROR_0             : out std_logic;
+  FFS_RXFBFIFO_ERROR_1             : out std_logic;
+  FFS_RXFBFIFO_ERROR_2             : out std_logic;
+  FFS_RXFBFIFO_ERROR_3             : out std_logic;
+  FFS_TXFBFIFO_ERROR_0             : out std_logic;
+  FFS_TXFBFIFO_ERROR_1             : out std_logic;
+  FFS_TXFBFIFO_ERROR_2             : out std_logic;
+  FFS_TXFBFIFO_ERROR_3             : out std_logic;
+  PCIE_PHYSTATUS_0             : out std_logic;
+  PCIE_PHYSTATUS_1             : out std_logic;
+  PCIE_PHYSTATUS_2             : out std_logic;
+  PCIE_PHYSTATUS_3             : out std_logic;
+  PCIE_RXVALID_0               : out std_logic;
+  PCIE_RXVALID_1               : out std_logic;
+  PCIE_RXVALID_2               : out std_logic;
+  PCIE_RXVALID_3               : out std_logic;
+  FFS_SKP_ADDED_0                  : out std_logic;
+  FFS_SKP_ADDED_1                  : out std_logic;
+  FFS_SKP_ADDED_2                  : out std_logic;
+  FFS_SKP_ADDED_3                  : out std_logic;
+  FFS_SKP_DELETED_0                : out std_logic;
+  FFS_SKP_DELETED_1                : out std_logic;
+  FFS_SKP_DELETED_2                : out std_logic;
+  FFS_SKP_DELETED_3                : out std_logic;
+  LDR_RX2CORE_0                    : out std_logic;
+  LDR_RX2CORE_1                    : out std_logic;
+  LDR_RX2CORE_2                    : out std_logic;
+  LDR_RX2CORE_3                    : out std_logic;
+  REFCK2CORE             : out std_logic;
+  SCIINT                : out std_logic;
+  SCIRDATA0             : out std_logic;
+  SCIRDATA1             : out std_logic;
+  SCIRDATA2             : out std_logic;
+  SCIRDATA3             : out std_logic;
+  SCIRDATA4             : out std_logic;
+  SCIRDATA5             : out std_logic;
+  SCIRDATA6             : out std_logic;
+  SCIRDATA7             : out std_logic;
+  REFCLK_TO_NQ          : out std_logic
+);
+end component;
+   attribute CONFIG_FILE: string;
+   attribute CONFIG_FILE of PCSD_INST : label is USER_CONFIG_FILE;
+   attribute QUAD_MODE: string;
+   attribute QUAD_MODE of PCSD_INST : label is "SINGLE";
+   attribute PLL_SRC: string;
+   attribute PLL_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute CH0_CDR_SRC: string;
+   attribute CH0_CDR_SRC of PCSD_INST : label is "REFCLK_CORE";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_0 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_1 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_2 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_RX_F_CLK_3 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_0 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_1 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_2 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_RX_H_CLK_3 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_0 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_1 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_2 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_TX_F_CLK_3 of PCSD_INST : label is "200";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_0: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_0 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_1: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_1 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_2: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_2 of PCSD_INST : label is "100";
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_3: string;
+   attribute FREQUENCY_PIN_FF_TX_H_CLK_3 of PCSD_INST : label is "100";
+   attribute black_box_pad_pin: string;
+   attribute black_box_pad_pin of PCSD : component is "HDINP0, HDINN0, HDINP1, HDINN1, HDINP2, HDINN2, HDINP3, HDINN3, HDOUTP0, HDOUTN0, HDOUTP1, HDOUTN1, HDOUTP2, HDOUTN2, HDOUTP3, HDOUTN3, REFCLKP, REFCLKN";
+
+signal refclk_from_nq : std_logic := '0';
+signal fpsc_vlo : std_logic := '0';
+signal fpsc_vhi : std_logic := '1';
+signal cin : std_logic_vector (11 downto 0) := "000000000000";
+signal cout : std_logic_vector (19 downto 0);
+signal    tx_full_clk_ch0_sig   :   std_logic;
+
+signal    refclk2fpga_sig  :   std_logic;
+signal    tx_pll_lol_qd_sig  :   std_logic;
+signal    rx_los_low_ch0_sig  :   std_logic;
+signal    rx_los_low_ch1_sig  :   std_logic;
+signal    rx_los_low_ch2_sig  :   std_logic;
+signal    rx_los_low_ch3_sig  :   std_logic;
+signal    rx_cdr_lol_ch0_sig  :   std_logic;
+signal    rx_cdr_lol_ch1_sig  :   std_logic;
+signal    rx_cdr_lol_ch2_sig  :   std_logic;
+signal    rx_cdr_lol_ch3_sig  :   std_logic;
+
+signal    rx_serdes_rst_ch0_c  : std_logic;
+signal    rx_pcs_rst_ch0_c  : std_logic;
+
+-- reset sequence for rx
+signal    refclkdiv2_rx_ch0  :   std_logic;
+
+signal    refclkdiv2_tx_ch  :   std_logic;
+signal    tx_pcs_rst_ch_c   :   std_logic;
+signal    rst_qd_c   :   std_logic;
+
+
+begin
+
+vlo_inst : VLO port map(Z => fpsc_vlo);
+vhi_inst : VHI port map(Z => fpsc_vhi);
+
+    rx_los_low_ch0_s <= rx_los_low_ch0_sig;
+    rx_cdr_lol_ch0_s <= rx_cdr_lol_ch0_sig;
+  tx_pll_lol_qd_s <= tx_pll_lol_qd_sig;
+  tx_full_clk_ch0 <= tx_full_clk_ch0_sig;
+
+-- pcs_quad instance
+PCSD_INST : PCSD
+--synopsys translate_off
+  generic map (CONFIG_FILE => USER_CONFIG_FILE,
+               QUAD_MODE => "SINGLE",
+               CH0_CDR_SRC => "REFCLK_CORE",
+               PLL_SRC  => "REFCLK_CORE"
+  )
+--synopsys translate_on
+port map  (
+  REFCLKP => fpsc_vlo,
+  REFCLKN => fpsc_vlo,
+
+----- CH0 -----
+  HDOUTP0 => hdoutp_ch0,
+  HDOUTN0 => hdoutn_ch0,
+  HDINP0 => hdinp_ch0,
+  HDINN0 => hdinn_ch0,
+  PCIE_TXDETRX_PR2TLB_0 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_0 => fpsc_vlo,
+  PCIE_RXPOLARITY_0 => fpsc_vlo,
+  PCIE_POWERDOWN_0_0 => fpsc_vlo,
+  PCIE_POWERDOWN_0_1 => fpsc_vlo,
+  PCIE_RXVALID_0 => open,
+  PCIE_PHYSTATUS_0 => open,
+  SCISELCH0 => sci_sel_ch0,
+  SCIENCH0 => fpsc_vhi,
+  FF_RXI_CLK_0 => rxiclk_ch0,
+  FF_TXI_CLK_0 => txiclk_ch0,
+  FF_EBRD_CLK_0 => tx_full_clk_ch0_sig,
+  FF_RX_F_CLK_0 => rx_full_clk_ch0,
+  FF_RX_H_CLK_0 => rx_half_clk_ch0,
+  FF_TX_F_CLK_0 => tx_full_clk_ch0_sig,
+  FF_TX_H_CLK_0 => tx_half_clk_ch0,
+  FFC_CK_CORE_RX_0 => fpga_rxrefclk_ch0,
+  FF_TX_D_0_0 => txdata_ch0(0),
+  FF_TX_D_0_1 => txdata_ch0(1),
+  FF_TX_D_0_2 => txdata_ch0(2),
+  FF_TX_D_0_3 => txdata_ch0(3),
+  FF_TX_D_0_4 => txdata_ch0(4),
+  FF_TX_D_0_5 => txdata_ch0(5),
+  FF_TX_D_0_6 => txdata_ch0(6),
+  FF_TX_D_0_7 => txdata_ch0(7),
+  FF_TX_D_0_8 => tx_k_ch0(0),
+  FF_TX_D_0_9 => tx_force_disp_ch0(0),
+  FF_TX_D_0_10 => tx_disp_sel_ch0(0),
+  FF_TX_D_0_11 => fpsc_vlo,
+  FF_TX_D_0_12 => txdata_ch0(8),
+  FF_TX_D_0_13 => txdata_ch0(9),
+  FF_TX_D_0_14 => txdata_ch0(10),
+  FF_TX_D_0_15 => txdata_ch0(11),
+  FF_TX_D_0_16 => txdata_ch0(12),
+  FF_TX_D_0_17 => txdata_ch0(13),
+  FF_TX_D_0_18 => txdata_ch0(14),
+  FF_TX_D_0_19 => txdata_ch0(15),
+  FF_TX_D_0_20 => tx_k_ch0(1),
+  FF_TX_D_0_21 => tx_force_disp_ch0(1),
+  FF_TX_D_0_22 => tx_disp_sel_ch0(1),
+  FF_TX_D_0_23 => fpsc_vlo,
+  FF_RX_D_0_0 => rxdata_ch0(0),
+  FF_RX_D_0_1 => rxdata_ch0(1),
+  FF_RX_D_0_2 => rxdata_ch0(2),
+  FF_RX_D_0_3 => rxdata_ch0(3),
+  FF_RX_D_0_4 => rxdata_ch0(4),
+  FF_RX_D_0_5 => rxdata_ch0(5),
+  FF_RX_D_0_6 => rxdata_ch0(6),
+  FF_RX_D_0_7 => rxdata_ch0(7),
+  FF_RX_D_0_8 => rx_k_ch0(0),
+  FF_RX_D_0_9 => rx_disp_err_ch0(0),
+  FF_RX_D_0_10 => rx_cv_err_ch0(0),
+  FF_RX_D_0_11 => open,
+  FF_RX_D_0_12 => rxdata_ch0(8),
+  FF_RX_D_0_13 => rxdata_ch0(9),
+  FF_RX_D_0_14 => rxdata_ch0(10),
+  FF_RX_D_0_15 => rxdata_ch0(11),
+  FF_RX_D_0_16 => rxdata_ch0(12),
+  FF_RX_D_0_17 => rxdata_ch0(13),
+  FF_RX_D_0_18 => rxdata_ch0(14),
+  FF_RX_D_0_19 => rxdata_ch0(15),
+  FF_RX_D_0_20 => rx_k_ch0(1),
+  FF_RX_D_0_21 => rx_disp_err_ch0(1),
+  FF_RX_D_0_22 => rx_cv_err_ch0(1),
+  FF_RX_D_0_23 => open,
+
+  FFC_RRST_0 => rx_serdes_rst_ch0_c,
+  FFC_SIGNAL_DETECT_0 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_0 => sb_felb_ch0_c,
+  FFC_PFIFO_CLR_0 => sb_felb_rst_ch0_c,
+  FFC_SB_INV_RX_0 => fpsc_vlo,
+  FFC_PCIE_CT_0 => fpsc_vlo,
+  FFC_PCI_DET_EN_0 => fpsc_vlo,
+  FFC_FB_LOOPBACK_0 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_0 => fpsc_vlo,
+  FFC_EI_EN_0 => fpsc_vlo,
+  FFC_LANE_TX_RST_0 => tx_pcs_rst_ch_c,
+  FFC_TXPWDNB_0 => tx_pwrup_ch0_c,
+  FFC_LANE_RX_RST_0 => rx_pcs_rst_ch0_c,
+  FFC_RXPWDNB_0 => rx_pwrup_ch0_c,
+  FFS_RLOS_LO_0 => rx_los_low_ch0_sig,
+  FFS_RLOS_HI_0 => open,
+  FFS_PCIE_CON_0 => open,
+  FFS_PCIE_DONE_0 => open,
+  FFS_LS_SYNC_STATUS_0 => lsm_status_ch0_s,
+  FFS_CC_OVERRUN_0 => ctc_orun_ch0_s,
+  FFS_CC_UNDERRUN_0 => ctc_urun_ch0_s,
+  FFS_SKP_ADDED_0 => ctc_ins_ch0_s,
+  FFS_SKP_DELETED_0 => ctc_del_ch0_s,
+  FFS_RLOL_0 => rx_cdr_lol_ch0_sig,
+  FFS_RXFBFIFO_ERROR_0 => open,
+  FFS_TXFBFIFO_ERROR_0 => open,
+  LDR_CORE2TX_0 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_0 => fpsc_vlo,
+  LDR_RX2CORE_0 => open,
+  FFS_CDR_TRAIN_DONE_0 => open,
+  FFC_DIV11_MODE_TX_0 => fpsc_vlo,
+  FFC_RATE_MODE_TX_0 => tx_div2_mode_ch0_c,
+  FFC_DIV11_MODE_RX_0 => fpsc_vlo,
+  FFC_RATE_MODE_RX_0 => rx_div2_mode_ch0_c,
+
+----- CH1 -----
+  HDOUTP1 => open,
+  HDOUTN1 => open,
+  HDINP1 => fpsc_vlo,
+  HDINN1 => fpsc_vlo,
+  PCIE_TXDETRX_PR2TLB_1 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_1 => fpsc_vlo,
+  PCIE_RXPOLARITY_1 => fpsc_vlo,
+  PCIE_POWERDOWN_1_0 => fpsc_vlo,
+  PCIE_POWERDOWN_1_1 => fpsc_vlo,
+  PCIE_RXVALID_1 => open,
+  PCIE_PHYSTATUS_1 => open,
+  SCISELCH1 => fpsc_vlo,
+  SCIENCH1 => fpsc_vlo,
+  FF_RXI_CLK_1 => fpsc_vlo,
+  FF_TXI_CLK_1 => fpsc_vlo,
+  FF_EBRD_CLK_1 => fpsc_vlo,
+  FF_RX_F_CLK_1 => open,
+  FF_RX_H_CLK_1 => open,
+  FF_TX_F_CLK_1 => open,
+  FF_TX_H_CLK_1 => open,
+  FFC_CK_CORE_RX_1 => fpsc_vlo,
+  FF_TX_D_1_0 => fpsc_vlo,
+  FF_TX_D_1_1 => fpsc_vlo,
+  FF_TX_D_1_2 => fpsc_vlo,
+  FF_TX_D_1_3 => fpsc_vlo,
+  FF_TX_D_1_4 => fpsc_vlo,
+  FF_TX_D_1_5 => fpsc_vlo,
+  FF_TX_D_1_6 => fpsc_vlo,
+  FF_TX_D_1_7 => fpsc_vlo,
+  FF_TX_D_1_8 => fpsc_vlo,
+  FF_TX_D_1_9 => fpsc_vlo,
+  FF_TX_D_1_10 => fpsc_vlo,
+  FF_TX_D_1_11 => fpsc_vlo,
+  FF_TX_D_1_12 => fpsc_vlo,
+  FF_TX_D_1_13 => fpsc_vlo,
+  FF_TX_D_1_14 => fpsc_vlo,
+  FF_TX_D_1_15 => fpsc_vlo,
+  FF_TX_D_1_16 => fpsc_vlo,
+  FF_TX_D_1_17 => fpsc_vlo,
+  FF_TX_D_1_18 => fpsc_vlo,
+  FF_TX_D_1_19 => fpsc_vlo,
+  FF_TX_D_1_20 => fpsc_vlo,
+  FF_TX_D_1_21 => fpsc_vlo,
+  FF_TX_D_1_22 => fpsc_vlo,
+  FF_TX_D_1_23 => fpsc_vlo,
+  FF_RX_D_1_0 => open,
+  FF_RX_D_1_1 => open,
+  FF_RX_D_1_2 => open,
+  FF_RX_D_1_3 => open,
+  FF_RX_D_1_4 => open,
+  FF_RX_D_1_5 => open,
+  FF_RX_D_1_6 => open,
+  FF_RX_D_1_7 => open,
+  FF_RX_D_1_8 => open,
+  FF_RX_D_1_9 => open,
+  FF_RX_D_1_10 => open,
+  FF_RX_D_1_11 => open,
+  FF_RX_D_1_12 => open,
+  FF_RX_D_1_13 => open,
+  FF_RX_D_1_14 => open,
+  FF_RX_D_1_15 => open,
+  FF_RX_D_1_16 => open,
+  FF_RX_D_1_17 => open,
+  FF_RX_D_1_18 => open,
+  FF_RX_D_1_19 => open,
+  FF_RX_D_1_20 => open,
+  FF_RX_D_1_21 => open,
+  FF_RX_D_1_22 => open,
+  FF_RX_D_1_23 => open,
+
+  FFC_RRST_1 => fpsc_vlo,
+  FFC_SIGNAL_DETECT_1 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_1 => fpsc_vlo,
+  FFC_PFIFO_CLR_1 => fpsc_vlo,
+  FFC_SB_INV_RX_1 => fpsc_vlo,
+  FFC_PCIE_CT_1 => fpsc_vlo,
+  FFC_PCI_DET_EN_1 => fpsc_vlo,
+  FFC_FB_LOOPBACK_1 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_1 => fpsc_vlo,
+  FFC_EI_EN_1 => fpsc_vlo,
+  FFC_LANE_TX_RST_1 => fpsc_vlo,
+  FFC_TXPWDNB_1 => fpsc_vlo,
+  FFC_LANE_RX_RST_1 => fpsc_vlo,
+  FFC_RXPWDNB_1 => fpsc_vlo,
+  FFS_RLOS_LO_1 => open,
+  FFS_RLOS_HI_1 => open,
+  FFS_PCIE_CON_1 => open,
+  FFS_PCIE_DONE_1 => open,
+  FFS_LS_SYNC_STATUS_1 => open,
+  FFS_CC_OVERRUN_1 => open,
+  FFS_CC_UNDERRUN_1 => open,
+  FFS_SKP_ADDED_1 => open,
+  FFS_SKP_DELETED_1 => open,
+  FFS_RLOL_1 => open,
+  FFS_RXFBFIFO_ERROR_1 => open,
+  FFS_TXFBFIFO_ERROR_1 => open,
+  LDR_CORE2TX_1 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_1 => fpsc_vlo,
+  LDR_RX2CORE_1 => open,
+  FFS_CDR_TRAIN_DONE_1 => open,
+  FFC_DIV11_MODE_TX_1 => fpsc_vlo,
+  FFC_RATE_MODE_TX_1 => fpsc_vlo,
+  FFC_DIV11_MODE_RX_1 => fpsc_vlo,
+  FFC_RATE_MODE_RX_1 => fpsc_vlo,
+
+----- CH2 -----
+  HDOUTP2 => open,
+  HDOUTN2 => open,
+  HDINP2 => fpsc_vlo,
+  HDINN2 => fpsc_vlo,
+  PCIE_TXDETRX_PR2TLB_2 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_2 => fpsc_vlo,
+  PCIE_RXPOLARITY_2 => fpsc_vlo,
+  PCIE_POWERDOWN_2_0 => fpsc_vlo,
+  PCIE_POWERDOWN_2_1 => fpsc_vlo,
+  PCIE_RXVALID_2 => open,
+  PCIE_PHYSTATUS_2 => open,
+  SCISELCH2 => fpsc_vlo,
+  SCIENCH2 => fpsc_vlo,
+  FF_RXI_CLK_2 => fpsc_vlo,
+  FF_TXI_CLK_2 => fpsc_vlo,
+  FF_EBRD_CLK_2 => fpsc_vlo,
+  FF_RX_F_CLK_2 => open,
+  FF_RX_H_CLK_2 => open,
+  FF_TX_F_CLK_2 => open,
+  FF_TX_H_CLK_2 => open,
+  FFC_CK_CORE_RX_2 => fpsc_vlo,
+  FF_TX_D_2_0 => fpsc_vlo,
+  FF_TX_D_2_1 => fpsc_vlo,
+  FF_TX_D_2_2 => fpsc_vlo,
+  FF_TX_D_2_3 => fpsc_vlo,
+  FF_TX_D_2_4 => fpsc_vlo,
+  FF_TX_D_2_5 => fpsc_vlo,
+  FF_TX_D_2_6 => fpsc_vlo,
+  FF_TX_D_2_7 => fpsc_vlo,
+  FF_TX_D_2_8 => fpsc_vlo,
+  FF_TX_D_2_9 => fpsc_vlo,
+  FF_TX_D_2_10 => fpsc_vlo,
+  FF_TX_D_2_11 => fpsc_vlo,
+  FF_TX_D_2_12 => fpsc_vlo,
+  FF_TX_D_2_13 => fpsc_vlo,
+  FF_TX_D_2_14 => fpsc_vlo,
+  FF_TX_D_2_15 => fpsc_vlo,
+  FF_TX_D_2_16 => fpsc_vlo,
+  FF_TX_D_2_17 => fpsc_vlo,
+  FF_TX_D_2_18 => fpsc_vlo,
+  FF_TX_D_2_19 => fpsc_vlo,
+  FF_TX_D_2_20 => fpsc_vlo,
+  FF_TX_D_2_21 => fpsc_vlo,
+  FF_TX_D_2_22 => fpsc_vlo,
+  FF_TX_D_2_23 => fpsc_vlo,
+  FF_RX_D_2_0 => open,
+  FF_RX_D_2_1 => open,
+  FF_RX_D_2_2 => open,
+  FF_RX_D_2_3 => open,
+  FF_RX_D_2_4 => open,
+  FF_RX_D_2_5 => open,
+  FF_RX_D_2_6 => open,
+  FF_RX_D_2_7 => open,
+  FF_RX_D_2_8 => open,
+  FF_RX_D_2_9 => open,
+  FF_RX_D_2_10 => open,
+  FF_RX_D_2_11 => open,
+  FF_RX_D_2_12 => open,
+  FF_RX_D_2_13 => open,
+  FF_RX_D_2_14 => open,
+  FF_RX_D_2_15 => open,
+  FF_RX_D_2_16 => open,
+  FF_RX_D_2_17 => open,
+  FF_RX_D_2_18 => open,
+  FF_RX_D_2_19 => open,
+  FF_RX_D_2_20 => open,
+  FF_RX_D_2_21 => open,
+  FF_RX_D_2_22 => open,
+  FF_RX_D_2_23 => open,
+
+  FFC_RRST_2 => fpsc_vlo,
+  FFC_SIGNAL_DETECT_2 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_2 => fpsc_vlo,
+  FFC_PFIFO_CLR_2 => fpsc_vlo,
+  FFC_SB_INV_RX_2 => fpsc_vlo,
+  FFC_PCIE_CT_2 => fpsc_vlo,
+  FFC_PCI_DET_EN_2 => fpsc_vlo,
+  FFC_FB_LOOPBACK_2 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_2 => fpsc_vlo,
+  FFC_EI_EN_2 => fpsc_vlo,
+  FFC_LANE_TX_RST_2 => fpsc_vlo,
+  FFC_TXPWDNB_2 => fpsc_vlo,
+  FFC_LANE_RX_RST_2 => fpsc_vlo,
+  FFC_RXPWDNB_2 => fpsc_vlo,
+  FFS_RLOS_LO_2 => open,
+  FFS_RLOS_HI_2 => open,
+  FFS_PCIE_CON_2 => open,
+  FFS_PCIE_DONE_2 => open,
+  FFS_LS_SYNC_STATUS_2 => open,
+  FFS_CC_OVERRUN_2 => open,
+  FFS_CC_UNDERRUN_2 => open,
+  FFS_SKP_ADDED_2 => open,
+  FFS_SKP_DELETED_2 => open,
+  FFS_RLOL_2 => open,
+  FFS_RXFBFIFO_ERROR_2 => open,
+  FFS_TXFBFIFO_ERROR_2 => open,
+  LDR_CORE2TX_2 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_2 => fpsc_vlo,
+  LDR_RX2CORE_2 => open,
+  FFS_CDR_TRAIN_DONE_2 => open,
+  FFC_DIV11_MODE_TX_2 => fpsc_vlo,
+  FFC_RATE_MODE_TX_2 => fpsc_vlo,
+  FFC_DIV11_MODE_RX_2 => fpsc_vlo,
+  FFC_RATE_MODE_RX_2 => fpsc_vlo,
+
+----- CH3 -----
+  HDOUTP3 => open,
+  HDOUTN3 => open,
+  HDINP3 => fpsc_vlo,
+  HDINN3 => fpsc_vlo,
+  PCIE_TXDETRX_PR2TLB_3 => fpsc_vlo,
+  PCIE_TXCOMPLIANCE_3 => fpsc_vlo,
+  PCIE_RXPOLARITY_3 => fpsc_vlo,
+  PCIE_POWERDOWN_3_0 => fpsc_vlo,
+  PCIE_POWERDOWN_3_1 => fpsc_vlo,
+  PCIE_RXVALID_3 => open,
+  PCIE_PHYSTATUS_3 => open,
+  SCISELCH3 => fpsc_vlo,
+  SCIENCH3 => fpsc_vlo,
+  FF_RXI_CLK_3 => fpsc_vlo,
+  FF_TXI_CLK_3 => fpsc_vlo,
+  FF_EBRD_CLK_3 => fpsc_vlo,
+  FF_RX_F_CLK_3 => open,
+  FF_RX_H_CLK_3 => open,
+  FF_TX_F_CLK_3 => open,
+  FF_TX_H_CLK_3 => open,
+  FFC_CK_CORE_RX_3 => fpsc_vlo,
+  FF_TX_D_3_0 => fpsc_vlo,
+  FF_TX_D_3_1 => fpsc_vlo,
+  FF_TX_D_3_2 => fpsc_vlo,
+  FF_TX_D_3_3 => fpsc_vlo,
+  FF_TX_D_3_4 => fpsc_vlo,
+  FF_TX_D_3_5 => fpsc_vlo,
+  FF_TX_D_3_6 => fpsc_vlo,
+  FF_TX_D_3_7 => fpsc_vlo,
+  FF_TX_D_3_8 => fpsc_vlo,
+  FF_TX_D_3_9 => fpsc_vlo,
+  FF_TX_D_3_10 => fpsc_vlo,
+  FF_TX_D_3_11 => fpsc_vlo,
+  FF_TX_D_3_12 => fpsc_vlo,
+  FF_TX_D_3_13 => fpsc_vlo,
+  FF_TX_D_3_14 => fpsc_vlo,
+  FF_TX_D_3_15 => fpsc_vlo,
+  FF_TX_D_3_16 => fpsc_vlo,
+  FF_TX_D_3_17 => fpsc_vlo,
+  FF_TX_D_3_18 => fpsc_vlo,
+  FF_TX_D_3_19 => fpsc_vlo,
+  FF_TX_D_3_20 => fpsc_vlo,
+  FF_TX_D_3_21 => fpsc_vlo,
+  FF_TX_D_3_22 => fpsc_vlo,
+  FF_TX_D_3_23 => fpsc_vlo,
+  FF_RX_D_3_0 => open,
+  FF_RX_D_3_1 => open,
+  FF_RX_D_3_2 => open,
+  FF_RX_D_3_3 => open,
+  FF_RX_D_3_4 => open,
+  FF_RX_D_3_5 => open,
+  FF_RX_D_3_6 => open,
+  FF_RX_D_3_7 => open,
+  FF_RX_D_3_8 => open,
+  FF_RX_D_3_9 => open,
+  FF_RX_D_3_10 => open,
+  FF_RX_D_3_11 => open,
+  FF_RX_D_3_12 => open,
+  FF_RX_D_3_13 => open,
+  FF_RX_D_3_14 => open,
+  FF_RX_D_3_15 => open,
+  FF_RX_D_3_16 => open,
+  FF_RX_D_3_17 => open,
+  FF_RX_D_3_18 => open,
+  FF_RX_D_3_19 => open,
+  FF_RX_D_3_20 => open,
+  FF_RX_D_3_21 => open,
+  FF_RX_D_3_22 => open,
+  FF_RX_D_3_23 => open,
+
+  FFC_RRST_3 => fpsc_vlo,
+  FFC_SIGNAL_DETECT_3 => fpsc_vlo,
+  FFC_SB_PFIFO_LP_3 => fpsc_vlo,
+  FFC_PFIFO_CLR_3 => fpsc_vlo,
+  FFC_SB_INV_RX_3 => fpsc_vlo,
+  FFC_PCIE_CT_3 => fpsc_vlo,
+  FFC_PCI_DET_EN_3 => fpsc_vlo,
+  FFC_FB_LOOPBACK_3 => fpsc_vlo,
+  FFC_ENABLE_CGALIGN_3 => fpsc_vlo,
+  FFC_EI_EN_3 => fpsc_vlo,
+  FFC_LANE_TX_RST_3 => fpsc_vlo,
+  FFC_TXPWDNB_3 => fpsc_vlo,
+  FFC_LANE_RX_RST_3 => fpsc_vlo,
+  FFC_RXPWDNB_3 => fpsc_vlo,
+  FFS_RLOS_LO_3 => open,
+  FFS_RLOS_HI_3 => open,
+  FFS_PCIE_CON_3 => open,
+  FFS_PCIE_DONE_3 => open,
+  FFS_LS_SYNC_STATUS_3 => open,
+  FFS_CC_OVERRUN_3 => open,
+  FFS_CC_UNDERRUN_3 => open,
+  FFS_SKP_ADDED_3 => open,
+  FFS_SKP_DELETED_3 => open,
+  FFS_RLOL_3 => open,
+  FFS_RXFBFIFO_ERROR_3 => open,
+  FFS_TXFBFIFO_ERROR_3 => open,
+  LDR_CORE2TX_3 => fpsc_vlo,
+  FFC_LDR_CORE2TX_EN_3 => fpsc_vlo,
+  LDR_RX2CORE_3 => open,
+  FFS_CDR_TRAIN_DONE_3 => open,
+  FFC_DIV11_MODE_TX_3 => fpsc_vlo,
+  FFC_RATE_MODE_TX_3 => fpsc_vlo,
+  FFC_DIV11_MODE_RX_3 => fpsc_vlo,
+  FFC_RATE_MODE_RX_3 => fpsc_vlo,
+
+----- Auxilliary ----
+  SCIWDATA7 => sci_wrdata(7),
+  SCIWDATA6 => sci_wrdata(6),
+  SCIWDATA5 => sci_wrdata(5),
+  SCIWDATA4 => sci_wrdata(4),
+  SCIWDATA3 => sci_wrdata(3),
+  SCIWDATA2 => sci_wrdata(2),
+  SCIWDATA1 => sci_wrdata(1),
+  SCIWDATA0 => sci_wrdata(0),
+  SCIADDR5 => sci_addr(5),
+  SCIADDR4 => sci_addr(4),
+  SCIADDR3 => sci_addr(3),
+  SCIADDR2 => sci_addr(2),
+  SCIADDR1 => sci_addr(1),
+  SCIADDR0 => sci_addr(0),
+  SCIRDATA7 => sci_rddata(7),
+  SCIRDATA6 => sci_rddata(6),
+  SCIRDATA5 => sci_rddata(5),
+  SCIRDATA4 => sci_rddata(4),
+  SCIRDATA3 => sci_rddata(3),
+  SCIRDATA2 => sci_rddata(2),
+  SCIRDATA1 => sci_rddata(1),
+  SCIRDATA0 => sci_rddata(0),
+  SCIENAUX => fpsc_vhi,
+  SCISELAUX => sci_sel_quad,
+  SCIRD => sci_rd,
+  SCIWSTN => sci_wrn,
+  CYAWSTN => fpsc_vlo,
+  SCIINT => open,
+  FFC_CK_CORE_TX => fpga_txrefclk,
+  FFC_MACRO_RST => serdes_rst_qd_c,
+  FFC_QUAD_RST => rst_qd_c,
+  FFC_TRST => tx_serdes_rst_c,
+  FFS_PLOL => tx_pll_lol_qd_sig,
+  FFC_SYNC_TOGGLE => fpsc_vlo,
+  REFCK2CORE => refclk2fpga_sig,
+  CIN0 => fpsc_vlo,
+  CIN1 => fpsc_vlo,
+  CIN2 => fpsc_vlo,
+  CIN3 => fpsc_vlo,
+  CIN4 => fpsc_vlo,
+  CIN5 => fpsc_vlo,
+  CIN6 => fpsc_vlo,
+  CIN7 => fpsc_vlo,
+  CIN8 => fpsc_vlo,
+  CIN9 => fpsc_vlo,
+  CIN10 => fpsc_vlo,
+  CIN11 => fpsc_vlo,
+  COUT0 => open,
+  COUT1 => open,
+  COUT2 => open,
+  COUT3 => open,
+  COUT4 => open,
+  COUT5 => open,
+  COUT6 => open,
+  COUT7 => open,
+  COUT8 => open,
+  COUT9 => open,
+  COUT10 => open,
+  COUT11 => open,
+  COUT12 => open,
+  COUT13 => open,
+  COUT14 => open,
+  COUT15 => open,
+  COUT16 => open,
+  COUT17 => open,
+  COUT18 => open,
+  COUT19 => open,
+  REFCLK_FROM_NQ => refclk_from_nq,
+  REFCLK_TO_NQ => open);
+
+-- reset sequence for rx
+                                                                                              
+  P1 : PROCESS(fpga_rxrefclk_ch0, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_rx_ch0 <= '0';
+     ELSIF (fpga_rxrefclk_ch0'event and fpga_rxrefclk_ch0 = '1') THEN 
+         refclkdiv2_rx_ch0 <= not refclkdiv2_rx_ch0;
+     END IF;
+  END PROCESS;
+                                                                                              
+rx_reset_sm_ch0 : sfp_0_200_ctcrx_reset_sm 
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  refclkdiv2 => refclkdiv2_rx_ch0,
+  rst_n => rst_n,
+  rx_cdr_lol_ch_s => rx_cdr_lol_ch0_sig,
+  rx_los_low_ch_s => rx_los_low_ch0_sig,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rx_pcs_rst_ch_c => rx_pcs_rst_ch0_c,
+  rx_serdes_rst_ch_c => rx_serdes_rst_ch0_c);
+                                                                                              
+                                                                                              
+                                                                                              
+                                                                                              
+                                                                                              
+  P5 : PROCESS(fpga_txrefclk, rst_n)
+  BEGIN
+     IF (rst_n = '0') THEN
+         refclkdiv2_tx_ch <= '0';
+     ELSIF (fpga_txrefclk'event and fpga_txrefclk = '1') THEN
+         refclkdiv2_tx_ch <= not refclkdiv2_tx_ch;
+     END IF;
+  END PROCESS;
+
+-- reset sequence for tx
+tx_reset_sm_ch : sfp_0_200_ctctx_reset_sm 
+--synopsys translate_off
+  generic map (count_index => 4)
+--synopsys translate_on
+port map  (
+  rst_n => rst_n,
+  refclkdiv2 => refclkdiv2_tx_ch,
+  tx_pll_lol_qd_s => tx_pll_lol_qd_sig,
+  rst_qd_c => rst_qd_c,
+  tx_pcs_rst_ch_c => tx_pcs_rst_ch_c
+  );
+                                                                                              
+                                                                                              
+--synopsys translate_off
+file_read : PROCESS
+VARIABLE open_status : file_open_status;
+FILE config : text;
+BEGIN
+   file_open (open_status, config, USER_CONFIG_FILE, read_mode);
+   IF (open_status = name_error) THEN
+      report "Auto configuration file for PCS module not found.  PCS internal configuration registers will not be initialized correctly during simulation!"
+      severity ERROR;
+   END IF;
+   wait;
+END PROCESS;
+--synopsys translate_on
+end sfp_0_200_ctc_arch ;
index 4e1121755fd7929d663e02f3591d4a7e10a6042f..faa05ce360aaad9dc2c7400e589223aaf88a95c5 100644 (file)
@@ -14,7 +14,8 @@ entity trb_net16_med_ecp3_sfp is
     SERDES_NUM : integer range 0 to 3 := 0;
     EXT_CLOCK  : integer range 0 to 1 := c_NO;
     USE_200_MHZ: integer range 0 to 1 := c_YES;
-    USE_125_MHZ: integer range 0 to 1 := c_NO
+    USE_125_MHZ: integer range 0 to 1 := c_NO;
+    USE_CTC    : integer range 0 to 1 := c_YES
     );
   port(
     CLK                : in  std_logic; -- SerDes clock
@@ -60,6 +61,59 @@ architecture trb_net16_med_ecp3_sfp_arch of trb_net16_med_ecp3_sfp is
   attribute syn_sharing : string;
   attribute syn_sharing of trb_net16_med_ecp3_sfp_arch : architecture is "off";
 
+  component sfp_0_200_ctc
+    port(
+      HDINP_CH0          : in std_logic;
+      HDINN_CH0          : in std_logic;
+      HDOUTP_CH0         : out std_logic;
+      HDOUTN_CH0         : out std_logic;
+      
+      RXICLK_CH0         : in std_logic;
+      TXICLK_CH0         : in std_logic;
+      FPGA_RXREFCLK_CH0  : in std_logic;
+      FPGA_TXREFCLK      : in std_logic;
+      RX_FULL_CLK_CH0    : out std_logic;
+      RX_HALF_CLK_CH0    : out std_logic;
+      TX_FULL_CLK_CH0    : out std_logic;
+      TX_HALF_CLK_CH0    : out std_logic;
+
+      TXDATA_CH0         : in std_logic_vector(15 downto 0);
+      TX_K_CH0           : in std_logic_vector(1 downto 0);
+      TX_FORCE_DISP_CH0  : in std_logic_vector(1 downto 0);
+      TX_DISP_SEL_CH0    : in std_logic_vector(1 downto 0);
+      
+      SB_FELB_CH0_C      : in std_logic;
+      SB_FELB_RST_CH0_C  : in std_logic;
+      
+      TX_PWRUP_CH0_C     : in std_logic;
+      RX_PWRUP_CH0_C     : in std_logic;
+      TX_DIV2_MODE_CH0_C : in std_logic;
+      RX_DIV2_MODE_CH0_C : in std_logic;
+      
+      SCI_WRDATA         : in std_logic_vector(7 downto 0);
+      SCI_RDDATA         : out std_logic_vector(7 downto 0);
+      SCI_ADDR           : in std_logic_vector(5 downto 0);
+      SCI_SEL_QUAD       : in std_logic;
+      SCI_RD             : in std_logic;
+      SCI_WRN            : in std_logic;
+      SCI_SEL_CH0        : in std_logic;
+
+      TX_SERDES_RST_C    : in std_logic;
+      RST_N              : in std_logic;
+      SERDES_RST_QD_C    : in std_logic;          
+      
+      RXDATA_CH0         : out std_logic_vector(15 downto 0);
+      RX_K_CH0           : out std_logic_vector(1 downto 0);
+      RX_DISP_ERR_CH0    : out std_logic_vector(1 downto 0);
+      RX_CV_ERR_CH0      : out std_logic_vector(1 downto 0);
+      
+      RX_LOS_LOW_CH0_S   : out std_logic;
+      LSM_STATUS_CH0_S   : out std_logic;
+      RX_CDR_LOL_CH0_S   : out std_logic;
+      TX_PLL_LOL_QD_S    : out std_logic
+      );
+  end component;  
+  
   component sfp_0_200_int
     port(
       HDINP_CH0          : in std_logic;
@@ -249,6 +303,10 @@ architecture trb_net16_med_ecp3_sfp_arch of trb_net16_med_ecp3_sfp is
   signal pwr_up                 : std_logic;
   signal clear_n   : std_logic;
 
+  signal clk_sys : std_logic;
+  signal clk_tx  : std_logic;
+  signal clk_rx  : std_logic;
+  signal clk_ref : std_logic;
 
   attribute syn_keep : boolean;
   attribute syn_preserve : boolean;
@@ -259,15 +317,26 @@ architecture trb_net16_med_ecp3_sfp_arch of trb_net16_med_ecp3_sfp is
 
 begin
 
+
+--------------------------------------------------------------------------
+-- Select proper clock configuration
+--------------------------------------------------------------------------
+gen_clocks_200 : if USE_200_MHZ = c_YES generate
+  clk_sys <= SYSCLK;
+  clk_tx  <= SYSCLK;
+  clk_rx  <= SYSCLK;
+  clk_ref <= CLK;
+end generate;
+
 --------------------------------------------------------------------------
 -- Internal Lane Resets
 --------------------------------------------------------------------------
   clear_n <= not clear;
 
 
-  PROC_RESET : process(SYSCLK)
+  PROC_RESET : process(clk_sys)
     begin
-      if rising_edge(SYSCLK) then
+      if rising_edge(clk_sys) then
         reset_i <= RESET;
         send_reset_in <= ctrl_op(15);
         pwr_up  <= '1'; --not CTRL_OP(i*16+14);
@@ -288,8 +357,8 @@ THE_SFP_STATUS_SYNC: signal_sync
     RESET    => '0',
     D_IN(0)  => sd_prsnt_n_in,
     D_IN(1)  => sd_los_in,
-    CLK0     => sysclk,
-    CLK1     => sysclk,
+    CLK0     => clk_sys,
+    CLK1     => clk_sys,
     D_OUT(0) => sfp_prsnt_n,
     D_OUT(1) => sfp_los
     );
@@ -305,8 +374,8 @@ THE_RX_K_SYNC: signal_sync
     D_IN(1 downto 0)  => comb_rx_k,
     D_IN(2)           => send_reset_words,
     D_IN(3)           => make_trbnet_reset,
-    CLK0              => ff_rxhalfclk, -- CHANGED
-    CLK1              => sysclk,
+    CLK0              => clk_rx, -- CHANGED
+    CLK1              => clk_sys,
     D_OUT(1 downto 0) => rx_k_q,
     D_OUT(2)          => send_reset_words_q,
     D_OUT(3)          => make_trbnet_reset_q
@@ -320,8 +389,8 @@ THE_RX_DATA_DELAY: signal_sync
   port map(
     RESET    => reset_i,
     D_IN     => comb_rx_data,
-    CLK0     => ff_rxhalfclk,
-    CLK1     => ff_rxhalfclk,
+    CLK0     => clk_rx,
+    CLK1     => clk_rx,
     D_OUT    => rx_data
     );
 
@@ -333,8 +402,8 @@ THE_RX_K_DELAY: signal_sync
   port map(
     RESET    => reset_i,
     D_IN     => comb_rx_k,
-    CLK0     => ff_rxhalfclk,
-    CLK1     => ff_rxhalfclk,
+    CLK0     => clk_rx,
+    CLK1     => clk_rx,
     D_OUT    => rx_k
     );
 
@@ -346,8 +415,8 @@ THE_RX_RESET: signal_sync
   port map(
     RESET    => '0',
     D_IN(0)  => reset_i,
-    CLK0     => ff_rxhalfclk,
-    CLK1     => ff_rxhalfclk,
+    CLK0     => clk_rx,
+    CLK1     => clk_rx,
     D_OUT(0) => reset_i_rx
     );
 
@@ -361,8 +430,8 @@ THE_RX_ALLOW_SYNC: signal_sync
     RESET    => reset_i,
     D_IN(0)  => rx_allow,
     D_IN(1)  => tx_allow,
-    CLK0     => sysclk,
-    CLK1     => sysclk,
+    CLK0     => clk_sys,
+    CLK1     => clk_sys,
     D_OUT(0) => rx_allow_q,
     D_OUT(1) => tx_allow_q
     );
@@ -376,8 +445,8 @@ THE_TX_SYNC: signal_sync
     RESET    => '0',
     D_IN(0)  => send_reset_in,
     D_IN(1)  => tx_allow,
-    CLK0     => ff_txhalfclk,
-    CLK1     => ff_txhalfclk,
+    CLK0     => clk_tx,
+    CLK1     => clk_tx,
     D_OUT(0) => send_reset_in_qtx,
     D_OUT(1) => tx_allow_qtx
     );
@@ -392,7 +461,7 @@ THE_SFP_LSM: trb_net16_lsm_sfp
       HIGHSPEED_STARTUP => c_NO
       )
     port map(
-      SYSCLK            => sysclk,
+      SYSCLK            => clk_sys,
       RESET             => reset_i,
       CLEAR             => clear,
       SFP_MISSING_IN    => sfp_prsnt_n,
@@ -428,7 +497,61 @@ refclk2core_out <= '0';
 
 -- Instantiation of serdes module
 
-  gen_serdes_0_200 : if SERDES_NUM = 0 and EXT_CLOCK = c_NO and USE_200_MHZ = c_YES generate
+  gen_serdes_0_200_ctc : if SERDES_NUM = 0 and EXT_CLOCK = c_NO and USE_200_MHZ = c_YES and USE_CTC = c_YES generate
+    THE_SERDES: sfp_0_200_ctc
+      port map(
+        HDINP_CH0           => sd_rxd_p_in,
+        HDINN_CH0           => sd_rxd_n_in,
+        HDOUTP_CH0          => sd_txd_p_out,
+        HDOUTN_CH0          => sd_txd_n_out,
+
+        RXICLK_CH0          => clk_rx,
+        TXICLK_CH0          => clk_tx,
+        FPGA_RXREFCLK_CH0   => clk_ref,
+        FPGA_TXREFCLK       => clk_ref,
+        RX_FULL_CLK_CH0     => open,
+        RX_HALF_CLK_CH0     => ff_rxhalfclk,
+        TX_FULL_CLK_CH0     => open,
+        TX_HALF_CLK_CH0     => ff_txhalfclk,
+
+        TXDATA_CH0          => tx_data,
+        TX_K_CH0            => tx_k,
+        TX_FORCE_DISP_CH0   => tx_correct,
+        TX_DISP_SEL_CH0     => "00",
+
+        SB_FELB_CH0_C       => '0', --loopback enable
+        SB_FELB_RST_CH0_C   => '0', --loopback reset
+
+        TX_PWRUP_CH0_C      => '1', --tx power up
+        RX_PWRUP_CH0_C      => '1', --rx power up
+        TX_DIV2_MODE_CH0_C  => '0', --full rate
+        RX_DIV2_MODE_CH0_C  => '0', --full rate
+
+        SCI_WRDATA          => (others => '0'),
+        SCI_RDDATA          => open,
+        SCI_ADDR            => (others => '0'),
+        SCI_SEL_QUAD        => '0',
+        SCI_SEL_CH0         => '0',
+        SCI_RD              => '0',
+        SCI_WRN             => '0',
+
+        TX_SERDES_RST_C     => CLEAR,
+        RST_N               => '1',
+        SERDES_RST_QD_C     => ffc_quad_rst,
+
+        RXDATA_CH0          => comb_rx_data,
+        RX_K_CH0            => comb_rx_k,
+        RX_DISP_ERR_CH0     => open,
+        RX_CV_ERR_CH0       => link_error(7 downto 6),
+
+        RX_LOS_LOW_CH0_S    => link_error(8),
+        LSM_STATUS_CH0_S    => link_ok(0),
+        RX_CDR_LOL_CH0_S    => link_error(4),
+        TX_PLL_LOL_QD_S     => link_error(5)    
+        );
+  end generate;
+
+  gen_serdes_0_200 : if SERDES_NUM = 0 and EXT_CLOCK = c_NO and USE_200_MHZ = c_YES and USE_CTC = c_NO generate
     THE_SERDES: sfp_0_200_int
       port map(
         HDINP_CH0           => sd_rxd_p_in,
@@ -436,10 +559,10 @@ refclk2core_out <= '0';
         HDOUTP_CH0          => sd_txd_p_out,
         HDOUTN_CH0          => sd_txd_n_out,
 
-        RXICLK_CH0          => ff_rxhalfclk,
-        TXICLK_CH0          => ff_txhalfclk,
-        FPGA_RXREFCLK_CH0   => CLK,
-        FPGA_TXREFCLK       => CLK,
+        RXICLK_CH0          => clk_rx,
+        TXICLK_CH0          => clk_tx,
+        FPGA_RXREFCLK_CH0   => clk_ref,
+        FPGA_TXREFCLK       => clk_ref,
         RX_FULL_CLK_CH0     => open,
         RX_HALF_CLK_CH0     => ff_rxhalfclk,
         TX_FULL_CLK_CH0     => open,
@@ -490,14 +613,14 @@ refclk2core_out <= '0';
         HDOUTP_CH1          => sd_txd_p_out,
         HDOUTN_CH1          => sd_txd_n_out,
 
-        RXICLK_CH1          => ff_rxhalfclk,
-        TXICLK_CH1          => ff_txhalfclk,
-        FPGA_RXREFCLK_CH1   => CLK,
-        FPGA_TXREFCLK       => CLK,
+        RXICLK_CH1          => clk_rx,
+        TXICLK_CH1          => clk_tx,
+        FPGA_RXREFCLK_CH1   => clk_ref,
+        FPGA_TXREFCLK       => clk_ref,
         RX_FULL_CLK_CH1     => open,
         RX_HALF_CLK_CH1     => ff_rxhalfclk,
         TX_FULL_CLK_CH1     => open,
-        TX_HALF_CLK_CH1     => ff_txhalfclk,
+        TX_HALF_CLK_CH1     => clk_tx,
 
         TXDATA_CH1          => tx_data,
         TX_K_CH1            => tx_k,
@@ -544,8 +667,8 @@ THE_FIFO_SFP_TO_FPGA: trb_net_fifo_16bit_bram_dualport
 generic map(
   USE_STATUS_FLAGS => c_NO
        )
-port map( read_clock_in  => sysclk,
-      write_clock_in     => ff_rxhalfclk, -- CHANGED
+port map( read_clock_in  => clk_sys,
+      write_clock_in     => clk_rx, -- CHANGED
       read_enable_in     => fifo_rx_rd_en,
       write_enable_in    => fifo_rx_wr_en,
       fifo_gsr_in        => fifo_rx_reset,
@@ -561,7 +684,7 @@ fifo_rx_rd_en <= not fifo_rx_empty;
 -- Received bytes need to be swapped if the SerDes is "off by one" in its internal 8bit path
 THE_BYTE_SWAP_PROC: process
   begin
-    wait until rising_edge(ff_rxhalfclk);  --CHANGED
+    wait until rising_edge(clk_rx);  --CHANGED
     last_rx <= rx_k(1) & rx_data(15 downto 8);
     if( swap_bytes = '0' ) then
       fifo_rx_din   <= rx_k(1) & rx_k(0) & rx_data(15 downto 8) & rx_data(7 downto 0);
@@ -580,7 +703,7 @@ med_read_out              <= tx_allow_q and not fifo_tx_almost_full;
 
 THE_CNT_RESET_PROC : process
   begin
-    wait until rising_edge(ff_rxhalfclk);  --CHANGED
+    wait until rising_edge(clk_rx);  --CHANGED
     if reset_i_rx = '1' then
       send_reset_words  <= '0';
       make_trbnet_reset <= '0';
@@ -604,7 +727,7 @@ THE_CNT_RESET_PROC : process
 
 THE_SYNC_PROC: process
   begin
-    wait until rising_edge(sysclk);
+    wait until rising_edge(clk_sys);
     med_dataready_out     <= buf_med_dataready_out;
     med_data_out          <= buf_med_data_out;
     med_packet_num_out    <= buf_med_packet_num_out;
@@ -616,9 +739,9 @@ THE_SYNC_PROC: process
 
 --rx packet counter
 ---------------------
-THE_RX_PACKETS_PROC: process( sysclk )
+THE_RX_PACKETS_PROC: process( clk_sys )
   begin
-    if( rising_edge(sysclk) ) then
+    if( rising_edge(clk_sys) ) then
       last_fifo_rx_empty <= fifo_rx_empty;
       if reset_i = '1' or rx_allow_q = '0' then
         rx_counter <= c_H0;
@@ -640,8 +763,8 @@ THE_FIFO_FPGA_TO_SFP: trb_net_fifo_16bit_bram_dualport
   generic map(
     USE_STATUS_FLAGS => c_NO
         )
-  port map( read_clock_in => ff_txhalfclk,
-        write_clock_in    => sysclk,
+  port map( read_clock_in => clk_tx,
+        write_clock_in    => clk_sys,
         read_enable_in    => fifo_tx_rd_en,
         write_enable_in   => fifo_tx_wr_en,
         fifo_gsr_in       => fifo_tx_reset,
@@ -658,9 +781,9 @@ fifo_tx_wr_en <= med_dataready_in and tx_allow_q;
 fifo_tx_rd_en <= tx_allow_qtx;
 
 
-THE_SERDES_INPUT_PROC: process( ff_txhalfclk )
+THE_SERDES_INPUT_PROC: process( clk_tx )
   begin
-    if( rising_edge(ff_txhalfclk) ) then
+    if( rising_edge(clk_tx) ) then
       last_fifo_tx_empty <= fifo_tx_empty;
       first_idle <= not last_fifo_tx_empty and fifo_tx_empty;
       if send_reset_in = '1' then
@@ -681,9 +804,9 @@ THE_SERDES_INPUT_PROC: process( ff_txhalfclk )
 
 --Generate LED signals
 ----------------------
-process( sysclk )
+process( clk_sys )
   begin
-    if rising_edge(sysclk) then
+    if rising_edge(clk_sys) then
       led_counter <= led_counter + to_unsigned(1,1);
 
       if buf_med_dataready_out = '1' then
@@ -722,8 +845,8 @@ stat_debug(28)           <= fifo_rx_full;
 stat_debug(29)           <= last_rx(8);
 stat_debug(30)           <= rx_allow_q;
 stat_debug(41 downto 31) <= (others => '0');
-stat_debug(42)           <= sysclk;
-stat_debug(43)           <= sysclk;
+stat_debug(42)           <= clk_sys;
+stat_debug(43)           <= clk_sys;
 stat_debug(59 downto 44) <= (others => '0');
 stat_debug(63 downto 60) <= buf_stat_debug(3 downto 0);
 
diff --git a/media_interfaces/trb_net16_med_ecp3_sfp_4.vhd b/media_interfaces/trb_net16_med_ecp3_sfp_4.vhd
new file mode 100644 (file)
index 0000000..c01f1c9
--- /dev/null
@@ -0,0 +1,889 @@
+--Media interface for Lattice ECP3 using PCS at 2GHz, RX clock == TX clock
+--For fully synchronized FPGAs only!
+--Either 200 MHz input for 2GBit or 125 MHz for 2.5GBit.
+--system clock can be 100 MHz or 125 MHz
+
+LIBRARY IEEE;
+USE IEEE.std_logic_1164.ALL;
+use ieee.numeric_std.all;
+
+library work;
+use work.trb_net_std.all;
+use work.trb_net_components.all;
+
+entity trb_net16_med_ecp3_sfp_4 is
+  generic(
+    REVERSE_ORDER : integer range 0 to 1 := c_NO;
+    FREQUENCY     : integer range 125 to 200 := 200 --200 or 125
+  --  USED_PORTS : std_logic-vector(3 downto 0) := "1111"
+    );
+  port(
+    CLK          : in  std_logic; -- SerDes clock
+    SYSCLK       : in  std_logic; -- fabric clock
+    RESET        : in  std_logic; -- synchronous reset
+    CLEAR        : in  std_logic; -- asynchronous reset
+    CLK_EN       : in  std_logic;
+    --Internal Connection
+    MED_DATA_IN        : in  std_logic_vector(4*c_DATA_WIDTH-1 downto 0);
+    MED_PACKET_NUM_IN  : in  std_logic_vector(4*c_NUM_WIDTH-1 downto 0);
+    MED_DATAREADY_IN   : in  std_logic_vector(3 downto 0);
+    MED_READ_OUT       : out std_logic_vector(3 downto 0);
+    MED_DATA_OUT       : out std_logic_vector(4*c_DATA_WIDTH-1 downto 0);
+    MED_PACKET_NUM_OUT : out std_logic_vector(4*c_NUM_WIDTH-1 downto 0);
+    MED_DATAREADY_OUT  : out std_logic_vector(3 downto 0);
+    MED_READ_IN        : in  std_logic_vector(3 downto 0);
+    REFCLK2CORE_OUT    : out std_logic;
+    --SFP Connection
+    SD_RXD_P_IN        : in  std_logic_vector(3 downto 0);
+    SD_RXD_N_IN        : in  std_logic_vector(3 downto 0);
+    SD_TXD_P_OUT       : out std_logic_vector(3 downto 0);
+    SD_TXD_N_OUT       : out std_logic_vector(3 downto 0);
+    SD_REFCLK_P_IN     : in  std_logic;
+    SD_REFCLK_N_IN     : in  std_logic;
+    SD_PRSNT_N_IN      : in  std_logic_vector(3 downto 0); -- SFP Present ('0' = SFP in place, '1' = no SFP mounted)
+    SD_LOS_IN          : in  std_logic_vector(3 downto 0); -- SFP Loss Of Signal ('0' = OK, '1' = no signal)
+    SD_TXDIS_OUT       : out  std_logic_vector(3 downto 0); -- SFP disable
+    -- Status and control port
+    STAT_OP            : out  std_logic_vector (4*16-1 downto 0);
+    CTRL_OP            : in  std_logic_vector (4*16-1 downto 0);
+    STAT_DEBUG         : out  std_logic_vector (64*4-1 downto 0);
+    CTRL_DEBUG         : in  std_logic_vector (63 downto 0)
+   );
+end entity;
+
+architecture arch_ecp3_sfp_4 of trb_net16_med_ecp3_sfp_4 is
+
+  component serdes_full_ctc
+  port(
+    hdinp_ch0          : in std_logic;
+    hdinn_ch0          : in std_logic;
+    hdinp_ch1          : in std_logic;
+    hdinn_ch1          : in std_logic;
+    hdinp_ch2          : in std_logic;
+    hdinn_ch2          : in std_logic;
+    hdinp_ch3          : in std_logic;
+    hdinn_ch3          : in std_logic;
+    hdoutp_ch0         : out std_logic;
+    hdoutn_ch0         : out std_logic;
+    hdoutp_ch1         : out std_logic;
+    hdoutn_ch1         : out std_logic;
+    hdoutp_ch2         : out std_logic;
+    hdoutn_ch2         : out std_logic;
+    hdoutp_ch3         : out std_logic;
+    hdoutn_ch3         : out std_logic;
+
+    rxiclk_ch0         : in std_logic;
+    txiclk_ch0         : in std_logic;
+    rxiclk_ch1         : in std_logic;
+    txiclk_ch1         : in std_logic;
+    rxiclk_ch2         : in std_logic;
+    txiclk_ch2         : in std_logic;
+    rxiclk_ch3         : in std_logic;
+    txiclk_ch3         : in std_logic;
+    fpga_rxrefclk_ch0  : in std_logic;
+    fpga_rxrefclk_ch1  : in std_logic;
+    fpga_rxrefclk_ch2  : in std_logic;
+    fpga_rxrefclk_ch3  : in std_logic;
+    rx_full_clk_ch0    : out std_logic;
+    rx_half_clk_ch0    : out std_logic;
+    tx_full_clk_ch0    : out std_logic;
+    tx_half_clk_ch0    : out std_logic;
+    rx_full_clk_ch1    : out std_logic;
+    rx_half_clk_ch1    : out std_logic;
+    tx_full_clk_ch1    : out std_logic;
+    tx_half_clk_ch1    : out std_logic;
+    rx_full_clk_ch2    : out std_logic;
+    rx_half_clk_ch2    : out std_logic;
+    tx_full_clk_ch2    : out std_logic;
+    tx_half_clk_ch2    : out std_logic;
+    rx_full_clk_ch3    : out std_logic;
+    rx_half_clk_ch3    : out std_logic;
+    tx_full_clk_ch3    : out std_logic;
+    tx_half_clk_ch3    : out std_logic;
+    
+    txdata_ch0         : in std_logic_vector(15 downto 0);
+    txdata_ch1         : in std_logic_vector(15 downto 0);
+    txdata_ch2         : in std_logic_vector(15 downto 0);
+    txdata_ch3         : in std_logic_vector(15 downto 0);
+    tx_k_ch0           : in std_logic_vector(1 downto 0);
+    tx_k_ch1           : in std_logic_vector(1 downto 0);
+    tx_k_ch2           : in std_logic_vector(1 downto 0);
+    tx_k_ch3           : in std_logic_vector(1 downto 0);
+    tx_force_disp_ch0  : in std_logic_vector(1 downto 0);
+    tx_force_disp_ch1  : in std_logic_vector(1 downto 0);
+    tx_force_disp_ch2  : in std_logic_vector(1 downto 0);
+    tx_force_disp_ch3  : in std_logic_vector(1 downto 0);
+    tx_disp_sel_ch0    : in std_logic_vector(1 downto 0);
+    tx_disp_sel_ch1    : in std_logic_vector(1 downto 0);
+    tx_disp_sel_ch2    : in std_logic_vector(1 downto 0);
+    tx_disp_sel_ch3    : in std_logic_vector(1 downto 0);
+
+    sb_felb_ch0_c      : in std_logic;
+    sb_felb_ch1_c      : in std_logic;
+    sb_felb_ch2_c      : in std_logic;
+    sb_felb_ch3_c      : in std_logic;
+    sb_felb_rst_ch0_c  : in std_logic;
+    sb_felb_rst_ch1_c  : in std_logic;
+    sb_felb_rst_ch2_c  : in std_logic;
+    sb_felb_rst_ch3_c  : in std_logic;
+
+    tx_pwrup_ch0_c     : in std_logic;
+    rx_pwrup_ch0_c     : in std_logic;
+    tx_pwrup_ch1_c     : in std_logic;
+    rx_pwrup_ch1_c     : in std_logic;
+    tx_pwrup_ch2_c     : in std_logic;
+    rx_pwrup_ch2_c     : in std_logic;
+    tx_pwrup_ch3_c     : in std_logic;
+    rx_pwrup_ch3_c     : in std_logic;
+    tx_div2_mode_ch0_c : in std_logic;
+    rx_div2_mode_ch0_c : in std_logic;
+    tx_div2_mode_ch1_c : in std_logic;
+    rx_div2_mode_ch1_c : in std_logic;
+    tx_div2_mode_ch2_c : in std_logic;
+    rx_div2_mode_ch2_c : in std_logic;
+    tx_div2_mode_ch3_c : in std_logic;
+    rx_div2_mode_ch3_c : in std_logic;
+    
+    rxdata_ch0         : out std_logic_vector(15 downto 0);
+    rxdata_ch1         : out std_logic_vector(15 downto 0);
+    rxdata_ch2         : out std_logic_vector(15 downto 0);
+    rxdata_ch3         : out std_logic_vector(15 downto 0);
+    rx_k_ch0           : out std_logic_vector(1 downto 0);
+    rx_k_ch1           : out std_logic_vector(1 downto 0);
+    rx_k_ch2           : out std_logic_vector(1 downto 0);
+    rx_k_ch3           : out std_logic_vector(1 downto 0);
+    rx_disp_err_ch0    : out std_logic_vector(1 downto 0);
+    rx_disp_err_ch1    : out std_logic_vector(1 downto 0);
+    rx_disp_err_ch2    : out std_logic_vector(1 downto 0);
+    rx_disp_err_ch3    : out std_logic_vector(1 downto 0);
+    rx_cv_err_ch0      : out std_logic_vector(1 downto 0);
+    rx_cv_err_ch1      : out std_logic_vector(1 downto 0);
+    rx_cv_err_ch2      : out std_logic_vector(1 downto 0);
+    rx_cv_err_ch3      : out std_logic_vector(1 downto 0);
+    
+    rx_los_low_ch0_s   : out std_logic;
+    rx_los_low_ch1_s   : out std_logic;
+    rx_los_low_ch2_s   : out std_logic;
+    rx_los_low_ch3_s   : out std_logic;
+    lsm_status_ch0_s   : out std_logic;
+    lsm_status_ch1_s   : out std_logic;
+    lsm_status_ch2_s   : out std_logic;
+    lsm_status_ch3_s   : out std_logic;
+    rx_cdr_lol_ch0_s   : out std_logic;
+    rx_cdr_lol_ch1_s   : out std_logic;
+    rx_cdr_lol_ch2_s   : out std_logic;
+    rx_cdr_lol_ch3_s   : out std_logic;
+
+    fpga_txrefclk    : in std_logic;
+    tx_serdes_rst_c  : in std_logic;
+    tx_sync_qd_c     : in std_logic;
+    tx_pll_lol_qd_s  : out std_logic;
+    rst_n            : in std_logic;
+    serdes_rst_qd_c  : in std_logic;          
+    refclk2fpga      : out std_logic;
+    
+    sci_sel_ch0   : in  std_logic;
+    sci_sel_ch1   : in  std_logic;
+    sci_sel_ch2   : in  std_logic;
+    sci_sel_ch3   : in  std_logic;
+    sci_wrdata    : in  std_logic_vector(7 downto 0);
+    sci_addr      : in  std_logic_vector(5 downto 0);
+    sci_sel_quad  : in  std_logic;
+    sci_rd        : in  std_logic;
+    sci_wrn       : in  std_logic;
+    sci_rddata    : out std_logic_vector(7 downto 0)
+
+    );
+  end component;
+  
+  -- Placer Directives
+  attribute HGROUP : string;
+  -- for whole architecture
+  attribute HGROUP of arch_ecp3_sfp_4 : architecture  is "media_interface_group";
+  attribute syn_sharing : string;
+  attribute syn_sharing of arch_ecp3_sfp_4 : architecture is "off";
+
+
+  signal refck2core             : std_logic;
+  --reset signals
+  signal ffc_quad_rst           : std_logic;
+  signal ffc_lane_tx_rst        : std_logic_vector(3 downto 0);
+  signal ffc_lane_rx_rst        : std_logic_vector(3 downto 0);
+  --serdes connections
+  signal tx_data                : std_logic_vector(4*16-1 downto 0);
+  signal tx_k                   : std_logic_vector(4*2-1 downto 0);
+  signal rx_data                : std_logic_vector(4*16-1 downto 0); -- delayed signals
+  signal rx_k                   : std_logic_vector(4*2-1 downto 0);  -- delayed signals
+  signal comb_rx_data           : std_logic_vector(4*16-1 downto 0); -- original signals from SFP
+  signal comb_rx_k              : std_logic_vector(4*2-1 downto 0);  -- original signals from SFP
+  signal link_ok                : std_logic_vector(4*1-1 downto 0);
+  signal link_error             : std_logic_vector(4*9-1 downto 0);
+  signal ff_txhalfclk           : std_logic_vector(4*1-1 downto 0);
+  signal ff_rxhalfclk           : std_logic_vector(4*1-1 downto 0);
+  --rx fifo signals
+  signal fifo_rx_rd_en          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_rx_wr_en          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_rx_reset          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_rx_din            : std_logic_vector(4*18-1 downto 0);
+  signal fifo_rx_dout           : std_logic_vector(4*18-1 downto 0);
+  signal fifo_rx_full           : std_logic_vector(4*1-1 downto 0);
+  signal fifo_rx_empty          : std_logic_vector(4*1-1 downto 0);
+  --tx fifo signals
+  signal fifo_tx_rd_en          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_tx_wr_en          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_tx_reset          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_tx_din            : std_logic_vector(4*18-1 downto 0);
+  signal fifo_tx_dout           : std_logic_vector(4*18-1 downto 0);
+  signal fifo_tx_full           : std_logic_vector(4*1-1 downto 0);
+  signal fifo_tx_empty          : std_logic_vector(4*1-1 downto 0);
+  signal fifo_tx_almost_full    : std_logic_vector(4*1-1 downto 0);
+  --rx path
+  signal rx_counter             : std_logic_vector(4*3-1 downto 0);
+  signal buf_med_dataready_out  : std_logic_vector(4*1-1 downto 0);
+  signal buf_med_data_out       : std_logic_vector(4*16-1 downto 0);
+  signal buf_med_packet_num_out : std_logic_vector(4*3-1 downto 0);
+  signal last_rx                : std_logic_vector(4*9-1 downto 0);
+  signal last_fifo_rx_empty     : std_logic_vector(4*1-1 downto 0);
+  --tx path
+  signal last_fifo_tx_empty     : std_logic_vector(4*1-1 downto 0);
+  --link status
+  signal rx_k_q                 : std_logic_vector(4*2-1 downto 0);
+
+  signal quad_rst               : std_logic_vector(4*1-1 downto 0);
+  signal lane_rst               : std_logic_vector(4*1-1 downto 0);
+  signal tx_allow               : std_logic_vector(4*1-1 downto 0);
+  signal rx_allow               : std_logic_vector(4*1-1 downto 0);
+  signal tx_allow_qtx           : std_logic_vector(4*1-1 downto 0);
+
+  signal rx_allow_q             : std_logic_vector(4*1-1 downto 0); -- clock domain changed signal
+  signal tx_allow_q             : std_logic_vector(4*1-1 downto 0);
+  signal swap_bytes             : std_logic_vector(4*1-1 downto 0);
+  signal buf_stat_debug         : std_logic_vector(4*32-1 downto 0);
+
+  -- status inputs from SFP
+  signal sfp_prsnt_n            : std_logic_vector(4*1-1 downto 0);
+  signal sfp_los                : std_logic_vector(4*1-1 downto 0);
+
+  signal buf_STAT_OP            : std_logic_vector(4*16-1 downto 0);
+
+  signal led_counter            : unsigned(16 downto 0);
+  signal rx_led                 : std_logic_vector(4*1-1 downto 0);
+  signal tx_led                 : std_logic_vector(4*1-1 downto 0);
+
+
+  signal tx_correct             : std_logic_vector(4*2-1 downto 0); -- GbE mode SERDES: automatic IDLE2 -> IDLE1 conversion
+  signal first_idle             : std_logic_vector(4*1-1 downto 0); -- tag the first IDLE2 after data
+
+  type arr5_t is array (0 to 3) of unsigned(4 downto 0);
+  signal reset_word_cnt    : arr5_t;
+  signal make_trbnet_reset : std_logic_vector(4*1-1 downto 0);
+  signal make_trbnet_reset_q : std_logic_vector(4*1-1 downto 0);
+  signal send_reset_words  : std_logic_vector(4*1-1 downto 0);
+  signal send_reset_words_q : std_logic_vector(4*1-1 downto 0);
+  signal send_reset_in      : std_logic_vector(4*1-1 downto 0);
+  signal send_reset_in_qtx  : std_logic_vector(4*1-1 downto 0);
+  signal reset_i                : std_logic;
+  signal reset_i_rx             : std_logic;
+  signal pwr_up                 : std_logic_vector(4*1-1 downto 0);
+  signal clear_n   : std_logic;
+
+  signal clk_sys : std_logic;
+  signal clk_tx  : std_logic;
+  signal clk_rx  : std_logic;
+  signal clk_ref : std_logic;
+
+  attribute syn_keep : boolean;
+  attribute syn_preserve : boolean;
+  attribute syn_keep of led_counter : signal is true;
+  attribute syn_keep of send_reset_in : signal is true;
+  attribute syn_keep of reset_i : signal is true;
+  attribute syn_preserve of reset_i : signal is true;
+
+begin
+
+--------------------------------------------------------------------------
+-- Select proper clock configuration
+--------------------------------------------------------------------------
+gen_clocks_200 : if FREQUENCY = 200 generate
+  clk_sys <= SYSCLK;
+  clk_tx  <= SYSCLK;
+  clk_rx  <= SYSCLK;
+  clk_ref <= CLK;
+end generate;
+
+-- gen_clocks_125 : if FREQUENCY = 125 generate
+--   clk_sys <= SYSCLK;
+--   clk_tx  <= CLK;
+--   clk_rx  <= CLK;
+--   clk_ref <= CLK;
+-- end generate;
+
+--------------------------------------------------------------------------
+-- Internal Resets
+--------------------------------------------------------------------------
+  clear_n <= not clear;
+
+  PROC_RESET : process(clk_sys)
+    begin
+      if rising_edge(clk_sys) then
+        reset_i <= RESET;
+        send_reset_in(0) <= ctrl_op(15);
+        send_reset_in(1) <= ctrl_op(15+16);
+        send_reset_in(2) <= ctrl_op(15+32);
+        send_reset_in(3) <= ctrl_op(15+48);
+        pwr_up  <= x"F"; --not CTRL_OP(i*16+14);
+      end if;
+    end process;
+
+--------------------------------------------------------------------------
+-- Synchronizer stages
+--------------------------------------------------------------------------
+
+-- Input synchronizer for SFP_PRESENT and SFP_LOS signals (external signals from SFP)
+sfp_prsnt_n <= SD_PRSNT_N_IN when rising_edge(clk_sys);
+sfp_los     <= SD_LOS_IN     when rising_edge(clk_sys);
+rx_k_q      <= rx_k          when rising_edge(clk_sys);
+
+send_reset_words_q   <= send_reset_words;
+make_trbnet_reset_q  <= make_trbnet_reset;
+reset_i_rx           <= reset_i;    
+
+
+rx_data     <= comb_rx_data  when rising_edge(clk_rx);
+rx_k        <= comb_rx_k     when rising_edge(clk_rx);
+
+rx_allow_q  <= rx_allow      when rising_edge(clk_sys);
+tx_allow_q  <= tx_allow      when rising_edge(clk_sys);
+
+send_reset_in_qtx <= send_reset_in when rising_edge(clk_tx);
+tx_allow_qtx      <= tx_allow      when rising_edge(clk_tx);
+
+
+--------------------------------------------------------------------------
+-- Main control state machine, startup control for SFP
+--------------------------------------------------------------------------
+gen_LSM : for i in 0 to 3 generate
+  THE_SFP_LSM: trb_net16_lsm_sfp
+      generic map (
+        HIGHSPEED_STARTUP => c_YES
+        )  
+      port map(
+        SYSCLK            => clk_sys,
+        RESET             => reset_i,
+        CLEAR             => clear,
+        SFP_MISSING_IN    => sfp_prsnt_n(i),
+        SFP_LOS_IN        => sfp_los(i),
+        SD_LINK_OK_IN     => link_ok(i),
+        SD_LOS_IN         => link_error(i*9+8),
+        SD_TXCLK_BAD_IN   => link_error(5),
+        SD_RXCLK_BAD_IN   => link_error(i*9+4),
+        SD_RETRY_IN       => '0', -- '0' = handle byte swapping in logic, '1' = simply restart link and hope
+        SD_ALIGNMENT_IN   => rx_k_q(i*2+1 downto i*2),
+        SD_CV_IN          => link_error(i*8+7 downto i*8+6),
+        FULL_RESET_OUT    => quad_rst(i),
+        LANE_RESET_OUT    => lane_rst(i),
+        TX_ALLOW_OUT      => tx_allow(i),
+        RX_ALLOW_OUT      => rx_allow(i),
+        SWAP_BYTES_OUT    => swap_bytes(i),
+        STAT_OP           => buf_stat_op(i*16+15 downto i*16),
+        CTRL_OP           => ctrl_op(i*16+15 downto i*16),
+        STAT_DEBUG        => buf_stat_debug(i*32+31 downto i*32)
+        );
+
+  sd_txdis_out(i) <= quad_rst(i) or reset_i;
+
+  ffc_quad_rst         <= quad_rst(0);
+  ffc_lane_tx_rst(i)   <= lane_rst(i);
+  ffc_lane_rx_rst(i)   <= lane_rst(i);
+
+end generate;
+
+-- Instantiation of serdes module
+gen_serdes_200 : if FREQUENCY = 200 generate
+  THE_SERDES: serdes_full_ctc
+    port map(
+      HDINP_CH0           => sd_rxd_p_in(0),
+      HDINN_CH0           => sd_rxd_n_in(0),
+      HDINP_CH1           => sd_rxd_p_in(1),
+      HDINN_CH1           => sd_rxd_n_in(1),
+      HDINP_CH2           => sd_rxd_p_in(2),
+      HDINN_CH2           => sd_rxd_n_in(2),
+      HDINP_CH3           => sd_rxd_p_in(3),
+      HDINN_CH3           => sd_rxd_n_in(3),
+      HDOUTP_CH0          => sd_txd_p_out(0),
+      HDOUTN_CH0          => sd_txd_n_out(0),
+      HDOUTP_CH1          => sd_txd_p_out(1),
+      HDOUTN_CH1          => sd_txd_n_out(1),
+      HDOUTP_CH2          => sd_txd_p_out(2),
+      HDOUTN_CH2          => sd_txd_n_out(2),
+      HDOUTP_CH3          => sd_txd_p_out(3),
+      HDOUTN_CH3          => sd_txd_n_out(3),
+
+      RXICLK_CH0          => clk_rx,
+      TXICLK_CH0          => clk_tx,
+      RXICLK_CH1          => clk_rx,
+      TXICLK_CH1          => clk_tx,
+      RXICLK_CH2          => clk_rx,
+      TXICLK_CH2          => clk_tx,
+      RXICLK_CH3          => clk_rx,
+      TXICLK_CH3          => clk_tx,
+      FPGA_RXREFCLK_CH0   => clk_ref,
+      FPGA_RXREFCLK_CH1   => clk_ref,
+      FPGA_RXREFCLK_CH2   => clk_ref,
+      FPGA_RXREFCLK_CH3   => clk_ref,
+      FPGA_TXREFCLK       => clk_ref,
+      RX_FULL_CLK_CH0     => open,
+      RX_HALF_CLK_CH0     => open,
+      TX_FULL_CLK_CH0     => open,
+      TX_HALF_CLK_CH0     => open,
+      RX_FULL_CLK_CH1     => open,
+      RX_HALF_CLK_CH1     => open,
+      TX_FULL_CLK_CH1     => open,
+      TX_HALF_CLK_CH1     => open,
+      RX_FULL_CLK_CH2     => open,
+      RX_HALF_CLK_CH2     => open,
+      TX_FULL_CLK_CH2     => open,
+      TX_HALF_CLK_CH2     => open,
+      RX_FULL_CLK_CH3     => open,
+      RX_HALF_CLK_CH3     => open,
+      TX_FULL_CLK_CH3     => open,
+      TX_HALF_CLK_CH3     => open,
+
+      TXDATA_CH0          => tx_data(15 downto  0),
+      TXDATA_CH1          => tx_data(31 downto  16),
+      TXDATA_CH2          => tx_data(47 downto  32),
+      TXDATA_CH3          => tx_data(63 downto  48),
+      TX_K_CH0            => tx_k(1 downto 0),
+      TX_K_CH1            => tx_k(3 downto 2),
+      TX_K_CH2            => tx_k(5 downto 4),
+      TX_K_CH3            => tx_k(7 downto 6),
+      TX_FORCE_DISP_CH0   => tx_correct(1 downto 0),
+      TX_FORCE_DISP_CH1   => tx_correct(3 downto 2),
+      TX_FORCE_DISP_CH2   => tx_correct(5 downto 4),
+      TX_FORCE_DISP_CH3   => tx_correct(7 downto 6),
+      TX_DISP_SEL_CH0     => "00",
+      TX_DISP_SEL_CH1     => "00",
+      TX_DISP_SEL_CH2     => "00",
+      TX_DISP_SEL_CH3     => "00",
+
+      SB_FELB_CH0_C       => '0', --loopback enable
+      SB_FELB_CH1_C       => '0', --loopback enable
+      SB_FELB_CH2_C       => '0', --loopback enable
+      SB_FELB_CH3_C       => '0', --loopback enable
+      SB_FELB_RST_CH0_C   => '0', --loopback reset
+      SB_FELB_RST_CH1_C   => '0', --loopback reset
+      SB_FELB_RST_CH2_C   => '0', --loopback reset
+      SB_FELB_RST_CH3_C   => '0', --loopback reset
+
+      TX_PWRUP_CH0_C      => '1', --tx power up
+      RX_PWRUP_CH0_C      => '1', --rx power up
+      TX_PWRUP_CH1_C      => '1', --tx power up
+      RX_PWRUP_CH1_C      => '1', --rx power up
+      TX_PWRUP_CH2_C      => '1', --tx power up
+      RX_PWRUP_CH2_C      => '1', --rx power up
+      TX_PWRUP_CH3_C      => '1', --tx power up
+      RX_PWRUP_CH3_C      => '1', --rx power up
+      TX_DIV2_MODE_CH0_C  => '0', --full rate
+      RX_DIV2_MODE_CH0_C  => '0', --full rate
+      TX_DIV2_MODE_CH1_C  => '0', --full rate
+      RX_DIV2_MODE_CH1_C  => '0', --full rate
+      TX_DIV2_MODE_CH2_C  => '0', --full rate
+      RX_DIV2_MODE_CH2_C  => '0', --full rate
+      TX_DIV2_MODE_CH3_C  => '0', --full rate
+      RX_DIV2_MODE_CH3_C  => '0', --full rate
+
+      SCI_WRDATA          => (others => '0'),
+      SCI_RDDATA          => open,
+      SCI_ADDR            => (others => '0'),
+      SCI_SEL_QUAD        => '0',
+      SCI_SEL_CH0         => '0',
+      SCI_SEL_CH1         => '0',
+      SCI_SEL_CH2         => '0',
+      SCI_SEL_CH3         => '0',
+      SCI_RD              => '0',
+      SCI_WRN             => '0',
+
+      TX_SERDES_RST_C     => CLEAR,
+      TX_SYNC_QD_C        => '0',
+      RST_N               => '1',
+      SERDES_RST_QD_C     => ffc_quad_rst,
+
+      RXDATA_CH0          => comb_rx_data(15 downto  0),
+      RXDATA_CH1          => comb_rx_data(31 downto  16),
+      RXDATA_CH2          => comb_rx_data(47 downto  32),
+      RXDATA_CH3          => comb_rx_data(63 downto  48),
+      RX_K_CH0            => comb_rx_k(1 downto 0),
+      RX_K_CH1            => comb_rx_k(3 downto 2),
+      RX_K_CH2            => comb_rx_k(5 downto 4),
+      RX_K_CH3            => comb_rx_k(7 downto 6),    
+      
+      RX_DISP_ERR_CH0     => open,
+      RX_DISP_ERR_CH1     => open,
+      RX_DISP_ERR_CH2     => open,
+      RX_DISP_ERR_CH3     => open,
+      RX_CV_ERR_CH0       => link_error(0*9+7 downto 0*9+6),
+      RX_CV_ERR_CH1       => link_error(1*9+7 downto 1*9+6),
+      RX_CV_ERR_CH2       => link_error(2*9+7 downto 2*9+6),
+      RX_CV_ERR_CH3       => link_error(3*9+7 downto 3*9+6),
+
+      RX_LOS_LOW_CH0_S    => link_error(0*9+8),
+      RX_LOS_LOW_CH1_S    => link_error(1*9+8),
+      RX_LOS_LOW_CH2_S    => link_error(2*9+8),
+      RX_LOS_LOW_CH3_S    => link_error(3*9+8),
+      LSM_STATUS_CH0_S    => link_ok(0),
+      LSM_STATUS_CH1_S    => link_ok(1),
+      LSM_STATUS_CH2_S    => link_ok(2),
+      LSM_STATUS_CH3_S    => link_ok(3),
+      RX_CDR_LOL_CH0_S    => link_error(0*9+4),
+      RX_CDR_LOL_CH1_S    => link_error(1*9+4),
+      RX_CDR_LOL_CH2_S    => link_error(2*9+4),
+      RX_CDR_LOL_CH3_S    => link_error(3*9+4),
+      TX_PLL_LOL_QD_S     => link_error(5)    
+      );
+end generate;
+
+-- gen_serdes_125 : if FREQUENCY = 125 generate
+--   THE_SERDES: serdes_onboard_full_125
+--     port map(
+--       HDINP_CH0           => sd_rxd_p_in(0),
+--       HDINN_CH0           => sd_rxd_n_in(0),
+--       HDINP_CH1           => sd_rxd_p_in(1),
+--       HDINN_CH1           => sd_rxd_n_in(1),
+--       HDINP_CH2           => sd_rxd_p_in(2),
+--       HDINN_CH2           => sd_rxd_n_in(2),
+--       HDINP_CH3           => sd_rxd_p_in(3),
+--       HDINN_CH3           => sd_rxd_n_in(3),
+--       HDOUTP_CH0          => sd_txd_p_out(0),
+--       HDOUTN_CH0          => sd_txd_n_out(0),
+--       HDOUTP_CH1          => sd_txd_p_out(1),
+--       HDOUTN_CH1          => sd_txd_n_out(1),
+--       HDOUTP_CH2          => sd_txd_p_out(2),
+--       HDOUTN_CH2          => sd_txd_n_out(2),
+--       HDOUTP_CH3          => sd_txd_p_out(3),
+--       HDOUTN_CH3          => sd_txd_n_out(3),
+-- 
+--       RXICLK_CH0          => clk_rx,
+--       TXICLK_CH0          => clk_tx,
+--       RXICLK_CH1          => clk_rx,
+--       TXICLK_CH1          => clk_tx,
+--       RXICLK_CH2          => clk_rx,
+--       TXICLK_CH2          => clk_tx,
+--       RXICLK_CH3          => clk_rx,
+--       TXICLK_CH3          => clk_tx,
+--       FPGA_RXREFCLK_CH0   => clk_ref,
+--       FPGA_RXREFCLK_CH1   => clk_ref,
+--       FPGA_RXREFCLK_CH2   => clk_ref,
+--       FPGA_RXREFCLK_CH3   => clk_ref,
+--       FPGA_TXREFCLK       => clk_ref,
+--       RX_FULL_CLK_CH0     => open,
+--       RX_HALF_CLK_CH0     => open,
+--       TX_FULL_CLK_CH0     => open,
+--       TX_HALF_CLK_CH0     => open,
+--       RX_FULL_CLK_CH1     => open,
+--       RX_HALF_CLK_CH1     => open,
+--       TX_FULL_CLK_CH1     => open,
+--       TX_HALF_CLK_CH1     => open,
+--       RX_FULL_CLK_CH2     => open,
+--       RX_HALF_CLK_CH2     => open,
+--       TX_FULL_CLK_CH2     => open,
+--       TX_HALF_CLK_CH2     => open,
+--       RX_FULL_CLK_CH3     => open,
+--       RX_HALF_CLK_CH3     => open,
+--       TX_FULL_CLK_CH3     => open,
+--       TX_HALF_CLK_CH3     => open,
+-- 
+--       TXDATA_CH0          => tx_data(15 downto  0),
+--       TXDATA_CH1          => tx_data(31 downto  16),
+--       TXDATA_CH2          => tx_data(47 downto  32),
+--       TXDATA_CH3          => tx_data(63 downto  48),
+--       TX_K_CH0            => tx_k(1 downto 0),
+--       TX_K_CH1            => tx_k(3 downto 2),
+--       TX_K_CH2            => tx_k(5 downto 4),
+--       TX_K_CH3            => tx_k(7 downto 6),
+--       TX_FORCE_DISP_CH0   => tx_correct(1 downto 0),
+--       TX_FORCE_DISP_CH1   => tx_correct(3 downto 2),
+--       TX_FORCE_DISP_CH2   => tx_correct(5 downto 4),
+--       TX_FORCE_DISP_CH3   => tx_correct(7 downto 6),
+--       TX_DISP_SEL_CH0     => "00",
+--       TX_DISP_SEL_CH1     => "00",
+--       TX_DISP_SEL_CH2     => "00",
+--       TX_DISP_SEL_CH3     => "00",
+-- 
+--       SB_FELB_CH0_C       => '0', --loopback enable
+--       SB_FELB_CH1_C       => '0', --loopback enable
+--       SB_FELB_CH2_C       => '0', --loopback enable
+--       SB_FELB_CH3_C       => '0', --loopback enable
+--       SB_FELB_RST_CH0_C   => '0', --loopback reset
+--       SB_FELB_RST_CH1_C   => '0', --loopback reset
+--       SB_FELB_RST_CH2_C   => '0', --loopback reset
+--       SB_FELB_RST_CH3_C   => '0', --loopback reset
+-- 
+--       TX_PWRUP_CH0_C      => '1', --tx power up
+--       RX_PWRUP_CH0_C      => '1', --rx power up
+--       TX_PWRUP_CH1_C      => '1', --tx power up
+--       RX_PWRUP_CH1_C      => '1', --rx power up
+--       TX_PWRUP_CH2_C      => '1', --tx power up
+--       RX_PWRUP_CH2_C      => '1', --rx power up
+--       TX_PWRUP_CH3_C      => '1', --tx power up
+--       RX_PWRUP_CH3_C      => '1', --rx power up
+--       TX_DIV2_MODE_CH0_C  => '0', --full rate
+--       RX_DIV2_MODE_CH0_C  => '0', --full rate
+--       TX_DIV2_MODE_CH1_C  => '0', --full rate
+--       RX_DIV2_MODE_CH1_C  => '0', --full rate
+--       TX_DIV2_MODE_CH2_C  => '0', --full rate
+--       RX_DIV2_MODE_CH2_C  => '0', --full rate
+--       TX_DIV2_MODE_CH3_C  => '0', --full rate
+--       RX_DIV2_MODE_CH3_C  => '0', --full rate
+-- 
+--       SCI_WRDATA          => (others => '0'),
+--       SCI_RDDATA          => open,
+--       SCI_ADDR            => (others => '0'),
+--       SCI_SEL_QUAD        => '0',
+--       SCI_SEL_CH0         => '0',
+--       SCI_SEL_CH1         => '0',
+--       SCI_SEL_CH2         => '0',
+--       SCI_SEL_CH3         => '0',
+--       SCI_RD              => '0',
+--       SCI_WRN             => '0',
+-- 
+--       TX_SERDES_RST_C     => CLEAR,
+--       TX_SYNC_QD_C        => '0',
+--       RST_N               => '1',
+--       SERDES_RST_QD_C     => ffc_quad_rst,
+-- 
+--       RXDATA_CH0          => comb_rx_data(15 downto  0),
+--       RXDATA_CH1          => comb_rx_data(31 downto  16),
+--       RXDATA_CH2          => comb_rx_data(47 downto  32),
+--       RXDATA_CH3          => comb_rx_data(63 downto  48),
+--       RX_K_CH0            => comb_rx_k(1 downto 0),
+--       RX_K_CH1            => comb_rx_k(3 downto 2),
+--       RX_K_CH2            => comb_rx_k(5 downto 4),
+--       RX_K_CH3            => comb_rx_k(7 downto 6),    
+--       
+--       RX_DISP_ERR_CH0     => open,
+--       RX_DISP_ERR_CH1     => open,
+--       RX_DISP_ERR_CH2     => open,
+--       RX_DISP_ERR_CH3     => open,
+--       RX_CV_ERR_CH0       => link_error(0*9+7 downto 0*9+6),
+--       RX_CV_ERR_CH1       => link_error(1*9+7 downto 1*9+6),
+--       RX_CV_ERR_CH2       => link_error(2*9+7 downto 2*9+6),
+--       RX_CV_ERR_CH3       => link_error(3*9+7 downto 3*9+6),
+-- 
+--       RX_LOS_LOW_CH0_S    => link_error(0*9+8),
+--       RX_LOS_LOW_CH1_S    => link_error(1*9+8),
+--       RX_LOS_LOW_CH2_S    => link_error(2*9+8),
+--       RX_LOS_LOW_CH3_S    => link_error(3*9+8),
+--       LSM_STATUS_CH0_S    => link_ok(0),
+--       LSM_STATUS_CH1_S    => link_ok(1),
+--       LSM_STATUS_CH2_S    => link_ok(2),
+--       LSM_STATUS_CH3_S    => link_ok(3),
+--       RX_CDR_LOL_CH0_S    => link_error(0*9+4),
+--       RX_CDR_LOL_CH1_S    => link_error(1*9+4),
+--       RX_CDR_LOL_CH2_S    => link_error(2*9+4),
+--       RX_CDR_LOL_CH3_S    => link_error(3*9+4),
+--       TX_PLL_LOL_QD_S     => link_error(5)    
+--       );
+-- end generate;
+
+
+-------------------------------------------------------------------------
+-- RX Fifo & Data output
+-------------------------------------------------------------------------
+gen_logic : for i in 0 to 3 generate
+
+  THE_FIFO_SFP_TO_FPGA: trb_net_fifo_16bit_bram_dualport
+  generic map(
+    USE_STATUS_FLAGS => c_NO
+        )
+  port map( read_clock_in  => clk_sys,
+        write_clock_in     => clk_rx,
+        read_enable_in     => fifo_rx_rd_en(i),
+        write_enable_in    => fifo_rx_wr_en(i),
+        fifo_gsr_in        => fifo_rx_reset(i),
+        write_data_in      => fifo_rx_din(i*18+17 downto i*18),
+        read_data_out      => fifo_rx_dout(i*18+17 downto i*18),
+        full_out           => fifo_rx_full(i),
+        empty_out          => fifo_rx_empty(i)
+      );
+
+  fifo_rx_reset(i) <= reset_i or not rx_allow_q(i);
+  fifo_rx_rd_en(i) <= not fifo_rx_empty(i);
+
+  -- Received bytes need to be swapped if the SerDes is "off by one" in its internal 8bit path
+  THE_BYTE_SWAP_PROC: process
+    begin
+      wait until rising_edge(clk_rx);  --CHANGED sysclk
+      last_rx(i*9+8 downto i*9) <= rx_k(i*2+1) & rx_data(i*16+15 downto i*16+8);
+      if( swap_bytes(i) = '0' ) then
+        fifo_rx_din(i*18+17 downto i*18)   <= rx_k(i*2+1) & rx_k(i*2+0) 
+                                            & rx_data(i*16+15 downto i*16+8) & rx_data(i*16+7 downto i*16+0);
+        fifo_rx_wr_en(i) <= not rx_k(i*2+0) and rx_allow(i) and link_ok(i);
+      else
+        fifo_rx_din(i*18+17 downto i*18)   <= rx_k(i*2+0) & last_rx(i*9+8) 
+                                            & rx_data(i*16+7 downto i*16+0) & last_rx(i*9+7 downto i*9+0);
+        fifo_rx_wr_en(i) <= not last_rx(i*9+8) and rx_allow(i) and link_ok(i);
+      end if;
+    end process THE_BYTE_SWAP_PROC;
+
+  buf_med_data_out(i*16+15 downto i*16)      <= fifo_rx_dout(i*18+15 downto i*18);
+  buf_med_dataready_out(i)     <= not fifo_rx_dout(i*18+17) and not fifo_rx_dout(i*18+16) 
+                                  and not last_fifo_rx_empty(i) and rx_allow_q(i);
+  buf_med_packet_num_out(i*3+2 downto i*3)    <= rx_counter(i*3+2 downto i*3);
+  med_read_out(i)              <= tx_allow_q(i) and not fifo_tx_almost_full(i);
+
+
+  THE_CNT_RESET_PROC : process
+    begin
+      wait until rising_edge(clk_rx); --CHANGED sysclk
+      if reset_i_rx = '1' then
+        send_reset_words(i)  <= '0';
+        make_trbnet_reset(i) <= '0';
+        reset_word_cnt(i)    <= (others => '0');
+      else
+        send_reset_words(i)   <= '0';
+        make_trbnet_reset(i)  <= '0';
+        if fifo_rx_din(i*18+17 downto i*18) = "11" & x"FEFE" then
+          if reset_word_cnt(i)(4) = '0' then
+            reset_word_cnt(i) <= reset_word_cnt(i) + to_unsigned(1,1);
+          else
+            send_reset_words(i) <= '1';
+          end if;
+        else
+          reset_word_cnt(i)    <= (others => '0');
+          make_trbnet_reset(i) <= reset_word_cnt(i)(4);
+        end if;
+      end if;
+    end process;
+
+
+  THE_SYNC_PROC: process
+    begin
+      wait until rising_edge(clk_sys);
+      med_dataready_out(i)                   <= buf_med_dataready_out(i);
+      med_data_out(i*16+15 downto i*16)      <= buf_med_data_out(i*16+15 downto i*16);
+      med_packet_num_out(i*3+2 downto i*3)   <= buf_med_packet_num_out(i*3+2 downto i*3);
+      if reset_i = '1' then
+        med_dataready_out(i) <= '0';
+      end if;
+    end process;
+
+
+  --rx packet counter
+  ---------------------
+  THE_RX_PACKETS_PROC: process( clk_sys )
+    begin
+      if( rising_edge(sysclk) ) then
+        last_fifo_rx_empty(i) <= fifo_rx_empty(i);
+        if reset_i = '1' or rx_allow_q(i) = '0' then
+          rx_counter(i*3+2 downto i*3) <= c_H0;
+        else
+          if( buf_med_dataready_out(i) = '1' ) then
+            if( rx_counter(i*3+2 downto i*3) = c_max_word_number ) then
+              rx_counter(i*3+2 downto i*3) <= (others => '0');
+            else
+              rx_counter(i*3+2 downto i*3) <= std_logic_vector(unsigned(rx_counter(i*3+2 downto i*3)) + to_unsigned(1,1));
+            end if;
+          end if;
+        end if;
+      end if;
+    end process;
+
+  --TX Fifo & Data output to Serdes
+  ---------------------
+  THE_FIFO_FPGA_TO_SFP: trb_net_fifo_16bit_bram_dualport
+    generic map(
+      USE_STATUS_FLAGS => c_NO
+          )
+    port map( read_clock_in => clk_tx,--sysclk,
+          write_clock_in    => clk_sys,
+          read_enable_in    => fifo_tx_rd_en(i),
+          write_enable_in   => fifo_tx_wr_en(i),
+          fifo_gsr_in       => fifo_tx_reset(i),
+          write_data_in     => fifo_tx_din(i*18+17 downto i*18),
+          read_data_out     => fifo_tx_dout(i*18+17 downto i*18),
+          full_out          => fifo_tx_full(i),
+          empty_out         => fifo_tx_empty(i),
+          almost_full_out   => fifo_tx_almost_full(i)
+        );
+
+  fifo_tx_reset(i) <= reset_i or not tx_allow_q(i);
+  fifo_tx_din(i*18+17 downto i*18)   <= med_packet_num_in(i*3+2) & med_packet_num_in(i*3+0) & med_data_in(i*16+15 downto i*16);
+  fifo_tx_wr_en(i) <= med_dataready_in(i) and tx_allow_q(i);
+  fifo_tx_rd_en(i) <= tx_allow_qtx(i);
+
+
+  THE_SERDES_INPUT_PROC: process begin
+    wait until rising_edge(clk_tx);
+    last_fifo_tx_empty(i) <= fifo_tx_empty(i);
+    first_idle(i) <= not last_fifo_tx_empty(i) and fifo_tx_empty(i);
+    if send_reset_in(i) = '1' then
+      tx_data(i*16+15 downto i*16) <= x"FEFE";
+      tx_k(i*2+1 downto i*2) <= "11";
+    elsif( (last_fifo_tx_empty(i) = '1') or (tx_allow_qtx(i) = '0') ) then
+      tx_data(i*16+15 downto i*16) <= x"50bc";
+      tx_k(i*2+1 downto i*2) <= "01";
+      tx_correct(i*2+1 downto i*2) <= first_idle(i) & '0';
+    else
+      tx_data(i*16+15 downto i*16) <= fifo_tx_dout(i*18+15 downto i*18);
+      tx_k(i*2+1 downto i*2) <= "00";
+      tx_correct(i*2+1 downto i*2) <= "00";
+    end if;
+  end process THE_SERDES_INPUT_PROC;
+
+end generate;    
+--------------------------------------------------------------------------
+--------------------------------------------------------------------------
+
+-- SerDes clock output to FPGA fabric
+refclk2core_out <= '0';
+
+--------------------------------------------------------------------------
+--Generate LED signals
+--------------------------------------------------------------------------
+  PROC_LED : process begin
+    wait until rising_edge(clk_sys);
+    led_counter <= led_counter + to_unsigned(1,1);
+
+    if led_counter = 0 then
+      rx_led <= x"0";
+    else
+      rx_led <= rx_led or buf_med_dataready_out;
+    end if;
+
+    if led_counter = 0 then
+      tx_led <= x"0";
+    else
+      tx_led <= tx_led or not (tx_k(6) & tx_k(4) & tx_k(2) & tx_k(0));
+    end if;
+  end process;
+
+gen_outputs : for i in 0 to 3 generate
+  stat_op(i*16+15)              <= send_reset_words_q(i);
+  stat_op(i*16+14)              <= buf_stat_op(i*16+14);
+  stat_op(i*16+13)              <= make_trbnet_reset_q(i);
+  stat_op(i*16+12)              <= '0';
+  stat_op(i*16+11)              <= tx_led(i); --tx led
+  stat_op(i*16+10)              <= rx_led(I); --rx led
+  stat_op(i*16+9 downto i*16+0) <= buf_stat_op(i*16+9 downto i*16+0);
+                                                  
+  -- Debug output                                 
+  stat_debug(i*64+15 downto i*64+0)  <= rx_data(i*16+15 downto i*16);            
+  stat_debug(i*64+17 downto i*64+16) <= rx_k(i*2+1 downto i*2);               
+  stat_debug(i*64+19 downto i*64+18) <= (others => '0');
+  stat_debug(i*64+23 downto i*64+20) <= buf_stat_debug(i*16+3 downto i*16+0);
+  stat_debug(i*64+24)                <= fifo_rx_rd_en(i);
+  stat_debug(i*64+25)                <= fifo_rx_wr_en(i);
+  stat_debug(i*64+26)                <= fifo_rx_reset(i);
+  stat_debug(i*64+27)                <= fifo_rx_empty(i);
+  stat_debug(i*64+28)                <= fifo_rx_full(i);
+  stat_debug(i*64+29)                <= last_rx(i*9+8);
+  stat_debug(i*64+30)                <= rx_allow_q(i);
+  stat_debug(i*64+41 downto i*64+31) <= (others => '0');
+  stat_debug(i*64+42)                <= sysclk;
+  stat_debug(i*64+43)                <= sysclk;
+  stat_debug(i*64+59 downto i*64+44) <= (others => '0');
+  stat_debug(i*64+63 downto i*64+60) <= buf_stat_debug(i*16+3 downto i*16+0);
+end generate;
+
+end architecture;
\ No newline at end of file
index ed4057c5b6752351767f63c5d850efd256fc3b19..dde31fd1338713301ee3d44a050015b919a74edb 100644 (file)
@@ -2020,7 +2020,8 @@ generic(
   SERDES_NUM : integer range 0 to 3 := 0;\r
   EXT_CLOCK  : integer range 0 to 1 := c_NO;\r
   USE_200_MHZ: integer range 0 to 1 := c_YES;\r
-  USE_125_MHZ: integer range 0 to 1 := c_NO\r
+  USE_125_MHZ: integer range 0 to 1 := c_NO;\r
+  USE_CTC    : integer range 0 to 1 := c_YES\r
   );\r
 port(\r
   CLK                : in  std_logic; -- SerDes clock\r