# SPDX-License-Identifier: MIT
#
# Copyright (c) 2014-2026 FPGA Ninja, LLC
#
# Authors:
# - Alex Forencich
#

# XDC constraints for the ADM-PCIE-9V3
# part: xcvu3p-ffvc1517-2-i

# 300 MHz memory clock (C1)
set_property -dict {LOC AN25 IOSTANDARD LVDS DIFF_TERM_ADV TERM_100} [get_ports mem_clk_300mhz_1_p]
set_property -dict {LOC AN26 IOSTANDARD LVDS DIFF_TERM_ADV TERM_100} [get_ports mem_clk_300mhz_1_n]
#create_clock -period 3.333 -name mem_clk_300mhz_1 [get_ports mem_clk_300mhz_1_p]

# DDR4 C1
# 5x K4A8G085WB-RC
set_property -dict {LOC AN9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[0]}]
set_property -dict {LOC AM9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[1]}]
set_property -dict {LOC AP11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[2]}]
set_property -dict {LOC AU9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[3]}]
set_property -dict {LOC AT10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[4]}]
set_property -dict {LOC AL12 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[5]}]
set_property -dict {LOC AM12 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[6]}]
set_property -dict {LOC AM10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[7]}]
set_property -dict {LOC AL11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[8]}]
set_property -dict {LOC AP7  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[9]}]
set_property -dict {LOC AR8  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[10]}]
set_property -dict {LOC AL10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[11]}]
set_property -dict {LOC AP8  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[12]}]
set_property -dict {LOC AK11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[13]}]
set_property -dict {LOC AP9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[14]}]
set_property -dict {LOC AV10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[15]}]
set_property -dict {LOC AT11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[16]}]
set_property -dict {LOC AL8  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_adr[17]}]
set_property -dict {LOC AN11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_ba[0]}]
set_property -dict {LOC AR9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_ba[1]}]
set_property -dict {LOC AP12 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_bg[0]}]
set_property -dict {LOC AN10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_bg[1]}]
set_property -dict {LOC AW13 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_c[0]}]
set_property -dict {LOC AU10 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_c[1]}]
set_property -dict {LOC AW11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_c[2]}]
set_property -dict {LOC AM7  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c1_ck_t}]
set_property -dict {LOC AN7  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c1_ck_c}]
set_property -dict {LOC AU12 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_cke}]
set_property -dict {LOC AT12 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_cs_n}]
set_property -dict {LOC AV9  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_act_n}]
set_property -dict {LOC AR11 IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_odt}]
set_property -dict {LOC AM8  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c1_par}]
set_property -dict {LOC AN12 IOSTANDARD LVCMOS12       } [get_ports {ddr4_c1_reset_n}]
set_property -dict {LOC AR10 IOSTANDARD LVCMOS12       } [get_ports {ddr4_c1_alert_n}]
set_property -dict {LOC AV11 IOSTANDARD LVCMOS12       } [get_ports {ddr4_c1_ten}]

set_property -dict {LOC AK9  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[0]}]
set_property -dict {LOC AK10 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[1]}]
set_property -dict {LOC AH10 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[2]}]
set_property -dict {LOC AJ11 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[3]}]
set_property -dict {LOC AJ9  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[4]}]
set_property -dict {LOC AH12 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[5]}]
set_property -dict {LOC AG10 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[6]}]
set_property -dict {LOC AJ12 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[7]}]
set_property -dict {LOC AM15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[8]}]
set_property -dict {LOC AN14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[9]}]
set_property -dict {LOC AL13 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[10]}]
set_property -dict {LOC AM14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[11]}]
set_property -dict {LOC AL15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[12]}]
set_property -dict {LOC AM17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[13]}]
set_property -dict {LOC AL17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[14]}]
set_property -dict {LOC AM13 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[15]}]
set_property -dict {LOC AR15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[16]}]
set_property -dict {LOC AP14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[17]}]
set_property -dict {LOC AT15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[18]}]
set_property -dict {LOC AR14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[19]}]
set_property -dict {LOC AP17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[20]}]
set_property -dict {LOC AN16 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[21]}]
set_property -dict {LOC AN17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[22]}]
set_property -dict {LOC AN15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[23]}]
set_property -dict {LOC AU15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[24]}]
set_property -dict {LOC AT17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[25]}]
set_property -dict {LOC AV15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[26]}]
set_property -dict {LOC AT16 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[27]}]
set_property -dict {LOC AV14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[28]}]
set_property -dict {LOC AW17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[29]}]
set_property -dict {LOC AW14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[30]}]
set_property -dict {LOC AW18 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[31]}]
set_property -dict {LOC AP19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[32]}]
set_property -dict {LOC AT20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[33]}]
set_property -dict {LOC AN21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[34]}]
set_property -dict {LOC AR19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[35]}]
set_property -dict {LOC AN20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[36]}]
set_property -dict {LOC AR18 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[37]}]
set_property -dict {LOC AR20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[38]}]
set_property -dict {LOC AP18 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[39]}]
set_property -dict {LOC AW19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[40]}]
set_property -dict {LOC AU22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[41]}]
set_property -dict {LOC AV19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[42]}]
set_property -dict {LOC AW22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[43]}]
set_property -dict {LOC AU18 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[44]}]
set_property -dict {LOC AT22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[45]}]
set_property -dict {LOC AW21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[46]}]
set_property -dict {LOC AU19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[47]}]
set_property -dict {LOC AH19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[48]}]
set_property -dict {LOC AJ22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[49]}]
set_property -dict {LOC AF21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[50]}]
set_property -dict {LOC AH22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[51]}]
set_property -dict {LOC AF20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[52]}]
set_property -dict {LOC AJ19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[53]}]
set_property -dict {LOC AH21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[54]}]
set_property -dict {LOC AJ21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[55]}]
set_property -dict {LOC AM19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[56]}]
set_property -dict {LOC AK20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[57]}]
set_property -dict {LOC AM22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[58]}]
set_property -dict {LOC AL22 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[59]}]
set_property -dict {LOC AM20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[60]}]
set_property -dict {LOC AK19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[61]}]
set_property -dict {LOC AN19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[62]}]
set_property -dict {LOC AL20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[63]}]
set_property -dict {LOC AF15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[64]}]
set_property -dict {LOC AJ17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[65]}]
set_property -dict {LOC AH17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[66]}]
set_property -dict {LOC AJ14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[67]}]
set_property -dict {LOC AG15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[68]}]
set_property -dict {LOC AJ13 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[69]}]
set_property -dict {LOC AG17 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[70]}]
set_property -dict {LOC AJ16 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dq[71]}]
set_property -dict {LOC AG9  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[0]}]
set_property -dict {LOC AH9  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[0]}]
set_property -dict {LOC AK16 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[1]}]
set_property -dict {LOC AL16 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[1]}]
set_property -dict {LOC AR13 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[2]}]
set_property -dict {LOC AT13 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[2]}]
set_property -dict {LOC AU17 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[3]}]
set_property -dict {LOC AV17 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[3]}]
set_property -dict {LOC AN22 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[4]}]
set_property -dict {LOC AP22 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[4]}]
set_property -dict {LOC AV22 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[5]}]
set_property -dict {LOC AV21 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[5]}]
set_property -dict {LOC AG20 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[6]}]
set_property -dict {LOC AH20 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[6]}]
set_property -dict {LOC AK21 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[7]}]
set_property -dict {LOC AL21 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[7]}]
set_property -dict {LOC AH16 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_t[8]}]
set_property -dict {LOC AH15 IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c1_dqs_c[8]}]
set_property -dict {LOC AG12 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[0]}]
set_property -dict {LOC AK15 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[1]}]
set_property -dict {LOC AP16 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[2]}]
set_property -dict {LOC AV16 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[3]}]
set_property -dict {LOC AP21 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[4]}]
set_property -dict {LOC AU20 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[5]}]
set_property -dict {LOC AG19 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[6]}]
set_property -dict {LOC AL18 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[7]}]
set_property -dict {LOC AG14 IOSTANDARD POD12_DCI      } [get_ports {ddr4_c1_dm_dbi_n[8]}]
