# 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 (C0)
set_property -dict {LOC G31  IOSTANDARD LVDS DIFF_TERM_ADV TERM_100} [get_ports mem_clk_300mhz_0_p]
set_property -dict {LOC G32  IOSTANDARD LVDS DIFF_TERM_ADV TERM_100} [get_ports mem_clk_300mhz_0_n]
#create_clock -period 3.333 -name mem_clk_300mhz_0 [get_ports mem_clk_300mhz_0_p]

# DDR4 C0
# 5x K4A8G085WB-RC
set_property -dict {LOC F9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[0]}]
set_property -dict {LOC G9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[1]}]
set_property -dict {LOC G11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[2]}]
set_property -dict {LOC D11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[3]}]
set_property -dict {LOC E12  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[4]}]
set_property -dict {LOC G10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[5]}]
set_property -dict {LOC F10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[6]}]
set_property -dict {LOC J9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[7]}]
set_property -dict {LOC J8   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[8]}]
set_property -dict {LOC F12  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[9]}]
set_property -dict {LOC D9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[10]}]
set_property -dict {LOC H11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[11]}]
set_property -dict {LOC E8   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[12]}]
set_property -dict {LOC J11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[13]}]
set_property -dict {LOC C9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[14]}]
set_property -dict {LOC B11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[15]}]
set_property -dict {LOC K12  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[16]}]
set_property -dict {LOC H9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_adr[17]}]
set_property -dict {LOC F8   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_ba[0]}]
set_property -dict {LOC H8   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_ba[1]}]
set_property -dict {LOC D10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_bg[0]}]
set_property -dict {LOC E11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_bg[1]}]
set_property -dict {LOC B10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_c[0]}]
set_property -dict {LOC C11  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_c[1]}]
set_property -dict {LOC A9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_c[2]}]
set_property -dict {LOC H12  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c0_ck_t}]
set_property -dict {LOC G12  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c0_ck_c}]
set_property -dict {LOC B9   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_cke}]
set_property -dict {LOC E10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_cs_n}]
set_property -dict {LOC C12  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_act_n}]
set_property -dict {LOC A10  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_odt}]
set_property -dict {LOC G7   IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c0_par}]
set_property -dict {LOC F7   IOSTANDARD LVCMOS12       } [get_ports {ddr4_c0_reset_n}]
set_property -dict {LOC H7   IOSTANDARD LVCMOS12       } [get_ports {ddr4_c0_alert_n}]
set_property -dict {LOC J10  IOSTANDARD LVCMOS12       } [get_ports {ddr4_c0_ten}]

set_property -dict {LOC L10  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[0]}]
set_property -dict {LOC L9   IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[1]}]
set_property -dict {LOC N9   IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[2]}]
set_property -dict {LOC M9   IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[3]}]
set_property -dict {LOC M10  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[4]}]
set_property -dict {LOC K11  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[5]}]
set_property -dict {LOC M11  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[6]}]
set_property -dict {LOC K10  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[7]}]
set_property -dict {LOC L17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[8]}]
set_property -dict {LOC M16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[9]}]
set_property -dict {LOC M15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[10]}]
set_property -dict {LOC M17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[11]}]
set_property -dict {LOC M14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[12]}]
set_property -dict {LOC N18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[13]}]
set_property -dict {LOC N16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[14]}]
set_property -dict {LOC N17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[15]}]
set_property -dict {LOC F15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[16]}]
set_property -dict {LOC E16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[17]}]
set_property -dict {LOC F14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[18]}]
set_property -dict {LOC E17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[19]}]
set_property -dict {LOC G16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[20]}]
set_property -dict {LOC F17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[21]}]
set_property -dict {LOC E15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[22]}]
set_property -dict {LOC G17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[23]}]
set_property -dict {LOC A17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[24]}]
set_property -dict {LOC C16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[25]}]
set_property -dict {LOC B16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[26]}]
set_property -dict {LOC A14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[27]}]
set_property -dict {LOC B17  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[28]}]
set_property -dict {LOC B14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[29]}]
set_property -dict {LOC D16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[30]}]
set_property -dict {LOC D15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[31]}]
set_property -dict {LOC F18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[32]}]
set_property -dict {LOC F20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[33]}]
set_property -dict {LOC F19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[34]}]
set_property -dict {LOC D21  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[35]}]
set_property -dict {LOC E18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[36]}]
set_property -dict {LOC G19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[37]}]
set_property -dict {LOC E21  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[38]}]
set_property -dict {LOC G20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[39]}]
set_property -dict {LOC D18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[40]}]
set_property -dict {LOC B22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[41]}]
set_property -dict {LOC A19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[42]}]
set_property -dict {LOC A18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[43]}]
set_property -dict {LOC C19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[44]}]
set_property -dict {LOC B19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[45]}]
set_property -dict {LOC A22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[46]}]
set_property -dict {LOC C18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[47]}]
set_property -dict {LOC G22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[48]}]
set_property -dict {LOC J20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[49]}]
set_property -dict {LOC H19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[50]}]
set_property -dict {LOC J19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[51]}]
set_property -dict {LOC H18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[52]}]
set_property -dict {LOC J18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[53]}]
set_property -dict {LOC G21  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[54]}]
set_property -dict {LOC K18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[55]}]
set_property -dict {LOC L20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[56]}]
set_property -dict {LOC L18  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[57]}]
set_property -dict {LOC N19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[58]}]
set_property -dict {LOC M21  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[59]}]
set_property -dict {LOC M19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[60]}]
set_property -dict {LOC M22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[61]}]
set_property -dict {LOC L19  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[62]}]
set_property -dict {LOC M20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[63]}]
set_property -dict {LOC H16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[64]}]
set_property -dict {LOC K15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[65]}]
set_property -dict {LOC J16  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[66]}]
set_property -dict {LOC J14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[67]}]
set_property -dict {LOC K13  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[68]}]
set_property -dict {LOC L13  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[69]}]
set_property -dict {LOC H14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[70]}]
set_property -dict {LOC J15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dq[71]}]
set_property -dict {LOC M12  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[0]}]
set_property -dict {LOC L12  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[0]}]
set_property -dict {LOC L15  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[1]}]
set_property -dict {LOC L14  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[1]}]
set_property -dict {LOC F13  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[2]}]
set_property -dict {LOC E13  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[2]}]
set_property -dict {LOC B15  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[3]}]
set_property -dict {LOC A15  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[3]}]
set_property -dict {LOC F22  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[4]}]
set_property -dict {LOC E22  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[4]}]
set_property -dict {LOC C21  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[5]}]
set_property -dict {LOC B21  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[5]}]
set_property -dict {LOC K21  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[6]}]
set_property -dict {LOC K20  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[6]}]
set_property -dict {LOC L22  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[7]}]
set_property -dict {LOC K22  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[7]}]
set_property -dict {LOC K17  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_t[8]}]
set_property -dict {LOC K16  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c0_dqs_c[8]}]
set_property -dict {LOC N12  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[0]}]
set_property -dict {LOC P14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[1]}]
set_property -dict {LOC G15  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[2]}]
set_property -dict {LOC D14  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[3]}]
set_property -dict {LOC E20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[4]}]
set_property -dict {LOC B20  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[5]}]
set_property -dict {LOC H22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[6]}]
set_property -dict {LOC N22  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[7]}]
set_property -dict {LOC J13  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c0_dm_dbi_n[8]}]
