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

# XDC constraints for the Xilinx Alveo AU200/AU250/VCU1525
# AU200 part: xcu200-fsgd2104-2-e
# AU250 part: xcu250-figd2104-2-e
# VCU1525 part: xcvu9p-fsgd2104-2L-e

# 300 MHz (DDR C2)
set_property -dict {LOC F32  IOSTANDARD LVDS} [get_ports clk_ddr4_c2_p]
set_property -dict {LOC E32  IOSTANDARD LVDS} [get_ports clk_ddr4_c2_n]
#create_clock -period 3.333 -name clk_ddr4_c2 [get_ports clk_ddr4_c2_p]

# DDR4 C2
set_property -dict {LOC L29  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[0]}]
set_property -dict {LOC A33  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[1]}]
set_property -dict {LOC C33  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[2]}]
set_property -dict {LOC J29  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[3]}]
set_property -dict {LOC H31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[4]}]
set_property -dict {LOC G31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[5]}]
set_property -dict {LOC C32  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[6]}]
set_property -dict {LOC B32  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[7]}]
set_property -dict {LOC A32  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[8]}]
set_property -dict {LOC D31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[9]}]
set_property -dict {LOC A34  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[10]}]
set_property -dict {LOC E31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[11]}]
set_property -dict {LOC M30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[12]}]
set_property -dict {LOC F33  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[13]}]
set_property -dict {LOC A35  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[14]}]
set_property -dict {LOC G32  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[15]}]
set_property -dict {LOC K30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_adr[16]}]
set_property -dict {LOC D33  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_ba[0]}]
set_property -dict {LOC B36  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_ba[1]}]
set_property -dict {LOC C31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_bg[0]}]
set_property -dict {LOC J30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_bg[1]}]
set_property -dict {LOC C34  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c2_ck_t[0]}]
set_property -dict {LOC B34  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c2_ck_c[0]}]
set_property -dict {LOC D34  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c2_ck_t[1]}]
set_property -dict {LOC D35  IOSTANDARD DIFF_SSTL12_DCI} [get_ports {ddr4_c2_ck_c[1]}]
set_property -dict {LOC G30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cke[0]}]
set_property -dict {LOC E30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cke[1]}]
set_property -dict {LOC B35  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cs_n[0]}]
set_property -dict {LOC J31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cs_n[1]}]
set_property -dict {LOC L30  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cs_n[2]}]
set_property -dict {LOC K31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_cs_n[3]}]
set_property -dict {LOC B31  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_act_n}]
set_property -dict {LOC E33  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_odt[0]}]
set_property -dict {LOC F34  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_odt[1]}]
set_property -dict {LOC M29  IOSTANDARD SSTL12_DCI     } [get_ports {ddr4_c2_par}]
set_property -dict {LOC D36  IOSTANDARD LVCMOS12       } [get_ports {ddr4_c2_reset_n}]

set_property -dict {LOC R25  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[0]}]
set_property -dict {LOC P25  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[1]}]
set_property -dict {LOC M25  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[2]}]
set_property -dict {LOC L25  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[3]}]
set_property -dict {LOC P26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[4]}]
set_property -dict {LOC R26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[5]}]
set_property -dict {LOC N27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[6]}]
set_property -dict {LOC N28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[7]}]
set_property -dict {LOC J28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[8]}]
set_property -dict {LOC H29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[9]}]
set_property -dict {LOC H28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[10]}]
set_property -dict {LOC G29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[11]}]
set_property -dict {LOC K25  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[12]}]
set_property -dict {LOC L27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[13]}]
set_property -dict {LOC K26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[14]}]
set_property -dict {LOC K27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[15]}]
set_property -dict {LOC F27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[16]}]
set_property -dict {LOC E27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[17]}]
set_property -dict {LOC E28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[18]}]
set_property -dict {LOC D28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[19]}]
set_property -dict {LOC G27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[20]}]
set_property -dict {LOC G26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[21]}]
set_property -dict {LOC F28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[22]}]
set_property -dict {LOC F29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[23]}]
set_property -dict {LOC D26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[24]}]
set_property -dict {LOC C26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[25]}]
set_property -dict {LOC B27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[26]}]
set_property -dict {LOC B26  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[27]}]
set_property -dict {LOC A29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[28]}]
set_property -dict {LOC A30  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[29]}]
set_property -dict {LOC C27  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[30]}]
set_property -dict {LOC C28  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[31]}]
set_property -dict {LOC F35  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[32]}]
set_property -dict {LOC E38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[33]}]
set_property -dict {LOC D38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[34]}]
set_property -dict {LOC E35  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[35]}]
set_property -dict {LOC E36  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[36]}]
set_property -dict {LOC E37  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[37]}]
set_property -dict {LOC F38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[38]}]
set_property -dict {LOC G38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[39]}]
set_property -dict {LOC P30  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[40]}]
set_property -dict {LOC R30  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[41]}]
set_property -dict {LOC P29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[42]}]
set_property -dict {LOC N29  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[43]}]
set_property -dict {LOC L32  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[44]}]
set_property -dict {LOC M32  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[45]}]
set_property -dict {LOC P31  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[46]}]
set_property -dict {LOC N32  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[47]}]
set_property -dict {LOC J35  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[48]}]
set_property -dict {LOC K35  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[49]}]
set_property -dict {LOC L33  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[50]}]
set_property -dict {LOC K33  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[51]}]
set_property -dict {LOC J34  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[52]}]
set_property -dict {LOC J33  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[53]}]
set_property -dict {LOC N34  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[54]}]
set_property -dict {LOC P34  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[55]}]
set_property -dict {LOC H36  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[56]}]
set_property -dict {LOC G36  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[57]}]
set_property -dict {LOC H37  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[58]}]
set_property -dict {LOC J36  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[59]}]
set_property -dict {LOC K37  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[60]}]
set_property -dict {LOC K38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[61]}]
set_property -dict {LOC G35  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[62]}]
set_property -dict {LOC G34  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[63]}]
set_property -dict {LOC C36  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[64]}]
set_property -dict {LOC B37  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[65]}]
set_property -dict {LOC A37  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[66]}]
set_property -dict {LOC A38  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[67]}]
set_property -dict {LOC C39  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[68]}]
set_property -dict {LOC D39  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[69]}]
set_property -dict {LOC A40  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[70]}]
set_property -dict {LOC B40  IOSTANDARD POD12_DCI      } [get_ports {ddr4_c2_dq[71]}]
set_property -dict {LOC N26  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[0]}]
set_property -dict {LOC M26  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[0]}]
set_property -dict {LOC R28  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[1]}]
set_property -dict {LOC P28  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[1]}]
set_property -dict {LOC J25  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[2]}]
set_property -dict {LOC J26  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[2]}]
set_property -dict {LOC M27  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[3]}]
set_property -dict {LOC L28  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[3]}]
set_property -dict {LOC D29  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[4]}]
set_property -dict {LOC D30  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[4]}]
set_property -dict {LOC H26  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[5]}]
set_property -dict {LOC H27  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[5]}]
set_property -dict {LOC A27  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[6]}]
set_property -dict {LOC A28  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[6]}]
set_property -dict {LOC C29  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[7]}]
set_property -dict {LOC B29  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[7]}]
set_property -dict {LOC E39  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[8]}]
set_property -dict {LOC E40  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[8]}]
set_property -dict {LOC G37  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[9]}]
set_property -dict {LOC F37  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[9]}]
set_property -dict {LOC N31  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[10]}]
set_property -dict {LOC M31  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[10]}]
set_property -dict {LOC T30  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[11]}]
set_property -dict {LOC R31  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[11]}]
set_property -dict {LOC L35  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[12]}]
set_property -dict {LOC L36  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[12]}]
set_property -dict {LOC M34  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[13]}]
set_property -dict {LOC L34  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[13]}]
set_property -dict {LOC J38  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[14]}]
set_property -dict {LOC H38  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[14]}]
set_property -dict {LOC H33  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[15]}]
set_property -dict {LOC H34  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[15]}]
set_property -dict {LOC B39  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[16]}]
set_property -dict {LOC A39  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[16]}]
set_property -dict {LOC C37  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_t[17]}]
set_property -dict {LOC C38  IOSTANDARD DIFF_POD12_DCI } [get_ports {ddr4_c2_dqs_c[17]}]
