NET sysclk_p_i LOC = K15 | IOSTANDARD = LVDS_25 | DIFF_TERM = TRUE | TNM_NET = tnm_sysclk;
NET sysclk_n_i LOC = K16 | IOSTANDARD = LVDS_25 | DIFF_TERM = TRUE;

TIMESPEC TS_sysclk = PERIOD tnm_sysclk 200MHz;

# remove for now
#NET Reset_i LOC=P4; ## Global Reset

#NET ipb_clk TNM_NET = tnm_ipb_clk;
#NET clk125  TNM_NET = tnm_clk125;
#TIMESPEC TS_tig_ipb_125 = FROM tnm_ipb_clk TO tnm_clk125 TIG;
#TIMESPEC TS_tig_125_ipb = FROM tnm_clk125 TO tnm_ipb_clk TIG;

# NET clocks/rst* TIG;
NET I6/s_clk_is_xtal TIG;

NET leds_o<0> LOC=E13 | IOSTANDARD=LVCMOS25;
NET leds_o<1> LOC=C14 | IOSTANDARD=LVCMOS25;
NET leds_o<2> LOC=C4 | IOSTANDARD=LVCMOS25;
NET leds_o<3> LOC=A4 | IOSTANDARD=LVCMOS25;

NET dip_switch_i<0> LOC=D14;
NET dip_switch_i<1> LOC=E12;
NET dip_switch_i<2> LOC=F12;
NET dip_switch_i<3> LOC=V13;

# Ethernet PHY

TIMEGRP TG_gmii_tx=PADS("gmii_tx*");
TIMEGRP TG_gmii_tx OFFSET = OUT AFTER sysclk_p_i REFERENCE_PIN "gmii_gtx_clk_o" RISING;

NET gmii_gtx_clk_o LOC=A9 | IOSTANDARD=LVCMOS25 | SLEW=FAST;
NET gmii_txd_o<0> LOC=F8 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<1> LOC=G8 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<2> LOC=A6 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<3> LOC=B6 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<4> LOC=E6 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<5> LOC=F7 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<6> LOC=A5 | IOSTANDARD=LVCMOS25;
NET gmii_txd_o<7> LOC=C5 | IOSTANDARD=LVCMOS25;
NET gmii_tx_en_o LOC=B8 | IOSTANDARD=LVCMOS25;
NET gmii_tx_er_o LOC=A8 | IOSTANDARD=LVCMOS25;

NET gmii_rx_clk_i LOC=L16 | IOSTANDARD=LVCMOS25 | TNM_NET= "gmii_rx_clk_i";
TIMESPEC "TS_GMII_RX_CLK_I" = PERIOD "gmii_rx_clk_i" 125MHz;
OFFSET = IN 2.5ns VALID 3ns BEFORE gmii_rx_clk_i;
NET gmii_rxd_i<0> LOC=M14 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<1> LOC=U18 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<2> LOC=U17 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<3> LOC=T18 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<4> LOC=T17 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<5> LOC=N16 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<6> LOC=N15 | IOSTANDARD=LVCMOS25;
NET gmii_rxd_i<7> LOC=P18 | IOSTANDARD=LVCMOS25;
NET gmii_rx_dv_i LOC=N18 | IOSTANDARD=LVCMOS25;
NET gmii_rx_er_i LOC=P17 | IOSTANDARD=LVCMOS25;

NET phy_rstb_o LOC=L13 | IOSTANDARD=LVCMOS25;

# Main I2C bus
NET "I2C_SCL_B"				LOC = "P11"; ##  C30 on FMC
NET "I2C_SDA_B"				LOC = "N10"; ##  C31 on FMC

#
# I/O to devices under test


#NET "BUSY_P_I<0>"				LOC = "D12"; ## "FMC_LA06_P" , C10 on FMC
#NET "BUSY_N_I<0>"				LOC = "C12"; ## "FMC_LA06_N" , C11 on FMC
#NET "BUSY_P_I<1>"				LOC = "U11"; ## "FMC_LA28_P" , H31 on FMC
#NET "BUSY_N_I<1>"				LOC = "V11"; ## "FMC_LA28_N" , H32 on FMC
#NET "BUSY_P_I<2>"				LOC = "E7"; ## "FMC_LA07_P" , H13 on FMC
#NET "BUSY_N_I<2>"				LOC = "E8"; ## "FMC_LA07_N" , H14 on FMC

#NET "TRIGGERS_P_O<0>"				LOC = "D8"; ## "FMC_LA10_P" , C14 on FMC
##NET "TRIGGERS_N_O<0>"				LOC = "C8"; ## "FMC_LA10_N" , C15 on FMC
#NET "TRIGGERS_P_O<1>"				LOC = "U15"; ## "FMC_LA32_P" , H37 on FMC
##NET "TRIGGERS_N_O<1>"				LOC = "V15"; ## "FMC_LA32_N" , H38 on FMC
#NET "TRIGGERS_P_O<2>"				LOC = "G11"; ## "FMC_LA09_P" , D14 on FMC
##NET "TRIGGERS_N_O<2>"				LOC = "F10"; ## "FMC_LA09_N" , D15 on FMC

# Remove for now.
#NET "SHUTTERS_P_O<0>"				LOC = "N7"; ## "FMC_LA20_P" , G21 on FMC
##NET "SHUTTERS_N_O<0>"				LOC = "P8"; ## "FMC_LA20_N" , G22 on FMC
#NET "SHUTTERS_P_O<1>"				LOC = "R10"; ## "FMC_LA18_CC_P" , C22 on FMC
##NET "SHUTTERS_N_O<1>"				LOC = "T10"; ## "FMC_LA18_CC_N" , C23 on FMC
#NET "SHUTTERS_P_O<2>"				LOC = "N6"; ## "FMC_LA19_P" , H22 on FMC
##NET "SHUTTERS_N_O<2>"				LOC = "P6"; ## "FMC_LA19_N" , H23 on FMC

#NET "DUT_CLK_P_I<0>"			LOC = "T6"; ## "FMC_LA31_P" , G33 on FMC , "DUT_CLK_P_I<0>
#NET "DUT_CLK_N_I<0>"			LOC = "V6"; ## "FMC_LA31_N" , G34 on FMC , DUT_CLK_N<0>
#NET "DUT_CLK_P_I<1>"				LOC = "U8"; ## "FMC_LA24_P" , H28 on FMC , CONT_P<1>
#NET "DUT_CLK_N_I<1>"				LOC = "V8"; ## "FMC_LA24_N" , H29 on FMC , CONT_N<1>
#NET "DUT_CLK_P_I<2>"				LOC = "F11"; ## "FMC_LA08_P" , G12 on FMC , CONT_P<2>
#NET "DUT_CLK_N_I<2>"				LOC = "E11"; ## "FMC_LA08_N" , G13 on FMC , CONT_N<2>

#NET "RESET_OR_CLK_P_O<0>"				LOC = "M10"; ## "FMC_LA33_P" , G36 on FMC , CONT_P<0>
##NET "RESET_OR_CLK_N_O<0>"				LOC = "N9"; ## "FMC_LA33_N" , G37 on FMC , CONT_N<0>
#NET "RESET_OR_CLK_P_O<1>"				LOC = "T4"; ## "FMC_LA21_P" , H25 on FMC , CLK_P<1>
##NET "RESET_OR_CLK_N_O<1>"				LOC = "V4"; ## "FMC_LA21_N" , H26 on FMC , CLK_QN<1>
#NET "RESET_OR_CLK_P_O<2>"				LOC = "B16"; ## "FMC_LA04_P" , H10 on FMC , CLK_P<2>
##NET "RESET_OR_CLK_N_O<2>"				LOC = "A16"; ## "FMC_LA04_N" , H11 on FMC , CLK_N<2>


# Trigger Inputs

# Constant-fraction-discrimiator comparator outputs
#NET "CFD_DISCR_P_I<0>"		LOC = "D9"; ## "FMC_LA00_CC_P" , G6 on FMC
#NET "CFD_DISCR_N_I<0>"		LOC = "C9"; ## "FMC_LA00_CC_N" , G7 on FMC
#
#NET "CFD_DISCR_P_I<1>"		LOC = "B2"; ## "FMC_LA14_P" , C18 on FMC
#NET "CFD_DISCR_N_I<1>"		LOC = "A2"; ## "FMC_LA14_N" , C19 on FMC
#
#NET "CFD_DISCR_P_I<2>"		LOC = "B14"; ## "FMC_LA05_P" , D11 on FMC
#NET "CFD_DISCR_N_I<2>"		LOC = "A14"; ## "FMC_LA05_N" , D12 on FMC
#
#NET "CFD_DISCR_P_I<3>"		LOC = "B11"; ## "FMC_LA13_P" , D17 on FMC
#NET "CFD_DISCR_N_I<3>"		LOC = "A11"; ## "FMC_LA13_N" , D18 on FMC

# Threshold comparator outputs
NET "THRESHOLD_DISCR_P_I<0>"			LOC = "D11"; ## "FMC_LA01_CC_P" , D8 on FMC
NET "THRESHOLD_DISCR_N_I<0>"			LOC = "C11"; ## "FMC_LA01_CC_N" , D9 on FMC

NET "THRESHOLD_DISCR_P_I<1>"			LOC = "C13"; ## "FMC_LA03_P" , G9  on FMC
NET "THRESHOLD_DISCR_N_I<1>"			LOC = "A13"; ## "FMC_LA03_N" , G10 on FMC

NET "THRESHOLD_DISCR_P_I<2>"			LOC = "D6"; ## "FMC_LA12_P" , G15 on FMC
NET "THRESHOLD_DISCR_N_I<2>"			LOC = "C6"; ## "FMC_LA12_N" , G16 on FMC

NET "THRESHOLD_DISCR_P_I<3>"			LOC = "C7"; ## "FMC_LA16_P" , G18 on FMC
NET "THRESHOLD_DISCR_N_I<3>"			LOC = "A7"; ## "FMC_LA16_N" , G19 on FMC

#NET "SPARE_P<2>"			LOC = "R8"; ## "FMC_LA17_CC_P" , D20 on FMC
#NET "SPARE_N<2>"			LOC = "T8"; ## "FMC_LA17_CC_N" , D21 on FMC
#NET "SPARE_P<1>"			LOC = "T12"; ## "FMC_LA30_P" , H34 on FMC
#NET "SPARE_N<1>"			LOC = "V12"; ## "FMC_LA30_N" , H35 on FMC

NET "EXTCLK_P_B"			LOC = "C10"; ## "FMC_CLK0_M2C_P" , H4 on FMC , "FRONT_PANEL_CLK_P"	
NET "EXTCLK_N_B"			LOC = "A10"; ## "FMC_CLK0_M2C_N" , H5 on FMC ,  "FRONT_PANEL_CLK_N"
#NET "HDMI_POWER_ENABLE1"		LOC = "C15"; ## "FMC_LA02_P" , H7 on FMC
#NET "HDMI_POWER_ENABLE2"		LOC = "A15"; ## "FMC_LA02_N" , H8 on FMC

# GPIO pins for debugging.
#NET "GPIO_HDR<0>"                     LOC = "N17"; ## 1 on J13 (thru series R100 200 ohm)
#NET "GPIO_HDR<1>"                     LOC = "M18"; ## 3 on J13 (thru series R102 200 ohm)
#NET "GPIO_HDR<2>"                     LOC = "A3";  ## 5 on J13 (thru series R101 200 ohm)
#NET "GPIO_HDR<3>"                     LOC = "L15"; ## 7 on J13 (thru series R103 200 ohm)
#NET "GPIO_HDR<4>"                     LOC = "F15"; ## 2 on J13 (thru series R99 200 ohm)
#NET "GPIO_HDR<5>"                     LOC = "B4";  ## 4 on J13 (thru series R98 200 ohm)
#NET "GPIO_HDR<6>"                     LOC = "F13"; ## 6 on J13 (thru series R97 200 ohm)
#NET "GPIO_HDR<7>"                     LOC = "P12"; ## 8 on J13 (thru series R96 20

NET "output_0_p[0]" LOC = D8;
NET "output_0_p[1]" LOC = U15;
NET "output_0_p[2]" LOC = G11;
NET "output_0_n[0]" LOC = C8;
NET "output_0_n[1]" LOC = V15;
NET "output_0_n[2]" LOC = F10;
NET "output_1_p[0]" LOC = T6;
NET "output_1_p[1]" LOC = U8;
NET "output_1_p[2]" LOC = F11;
NET "output_1_n[0]" LOC = V6;
NET "output_1_n[1]" LOC = V8;
NET "output_1_n[2]" LOC = E11;
NET "output_2_p[0]" LOC = M10;
NET "output_2_p[1]" LOC = T4;
NET "output_2_p[2]" LOC = B16;
NET "output_2_n[0]" LOC = N9;
NET "output_2_n[1]" LOC = V4;
NET "output_2_n[2]" LOC = A16;
NET "output_3_p[0]" LOC = D12;
NET "output_3_p[1]" LOC = U11;
NET "output_3_p[2]" LOC = E7;
NET "output_3_n[0]" LOC = C12;
NET "output_3_n[1]" LOC = V11;
NET "output_3_n[2]" LOC = E8;