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

# XDC constraints for the BittWare XUSP3S board
# part: xcvu095-ffvb2104-2-e

# 100 MHz DDR4 A clock from Si5338 A ch 1
set_property -dict {LOC BB36 IOSTANDARD DIFF_SSTL12_DCI ODT RTT_48} [get_ports clk_ddr_a_p]
set_property -dict {LOC BC36 IOSTANDARD DIFF_SSTL12_DCI ODT RTT_48} [get_ports clk_ddr_a_n]
create_clock -period 10.000 -name clk_ddr_a [get_ports clk_ddr_a_p]

# DDR4 A (U5, U6, U7, U8, U9, U32, U33, U34, U35)
# 9x MT40A512M8RH-083E
set_property -dict {LOC AY33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[0]}]
set_property -dict {LOC BA33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[1]}]
set_property -dict {LOC AV34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[2]}]
set_property -dict {LOC AW34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[3]}]
set_property -dict {LOC AV33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[4]}]
set_property -dict {LOC AW33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[5]}]
set_property -dict {LOC AU34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[6]}]
set_property -dict {LOC AT33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[7]}]
set_property -dict {LOC AT34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[8]}]
set_property -dict {LOC AP33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[9]}]
set_property -dict {LOC AR33 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[10]}]
set_property -dict {LOC AN34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[11]}]
set_property -dict {LOC AP34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[12]}]
set_property -dict {LOC AL32 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[13]}]
set_property -dict {LOC AM32 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[14]}]
set_property -dict {LOC AL34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[15]}]
set_property -dict {LOC AM34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_adr[16]}]
set_property -dict {LOC BA34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_ba[0]}]
set_property -dict {LOC BB34 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_ba[1]}]
set_property -dict {LOC AY35 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_bg[0]}]
set_property -dict {LOC AY36 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_bg[1]}]
set_property -dict {LOC AW35 IOSTANDARD DIFF_SSTL12_DCI } [get_ports {ddr4_a_ck_t[0]}]
set_property -dict {LOC AW36 IOSTANDARD DIFF_SSTL12_DCI } [get_ports {ddr4_a_ck_c[0]}]
set_property -dict {LOC BE36 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_cke[0]}]
set_property -dict {LOC BE35 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_cs_n[0]}]
set_property -dict {LOC BF35 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_act_n}]
set_property -dict {LOC BC37 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_odt[0]}]
set_property -dict {LOC BB35 IOSTANDARD SSTL12_DCI      } [get_ports {ddr4_a_par}]
set_property -dict {LOC BC34 IOSTANDARD LVCMOS12 DRIVE 8} [get_ports {ddr4_a_reset_n}]

set_property -dict {LOC W34  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[0]}]
set_property -dict {LOC W33  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[1]}]
set_property -dict {LOC Y33  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[2]}]
set_property -dict {LOC Y32  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[3]}]
set_property -dict {LOC Y30  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[4]}]
set_property -dict {LOC W30  IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[5]}]
set_property -dict {LOC AB34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[6]}]
set_property -dict {LOC AA34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[7]}]
set_property -dict {LOC AD34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[8]}]
set_property -dict {LOC AC34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[9]}]
set_property -dict {LOC AC33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[10]}]
set_property -dict {LOC AC32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[11]}]
set_property -dict {LOC AF30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[12]}]
set_property -dict {LOC AE30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[13]}]
set_property -dict {LOC AE33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[14]}]
set_property -dict {LOC AD33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[15]}]
set_property -dict {LOC AF33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[16]}]
set_property -dict {LOC AF32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[17]}]
set_property -dict {LOC AG32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[18]}]
set_property -dict {LOC AG31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[19]}]
set_property -dict {LOC AG34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[20]}]
set_property -dict {LOC AF34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[21]}]
set_property -dict {LOC AJ33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[22]}]
set_property -dict {LOC AH33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[23]}]
set_property -dict {LOC AK31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[24]}]
set_property -dict {LOC AJ31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[25]}]
set_property -dict {LOC AG30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[26]}]
set_property -dict {LOC AG29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[27]}]
set_property -dict {LOC AJ30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[28]}]
set_property -dict {LOC AJ29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[29]}]
set_property -dict {LOC AK28 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[30]}]
set_property -dict {LOC AJ28 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[31]}]
set_property -dict {LOC AL30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[32]}]
set_property -dict {LOC AL29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[33]}]
set_property -dict {LOC AN31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[34]}]
set_property -dict {LOC AM31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[35]}]
set_property -dict {LOC AP29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[36]}]
set_property -dict {LOC AN29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[37]}]
set_property -dict {LOC AR30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[38]}]
set_property -dict {LOC AP30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[39]}]
set_property -dict {LOC AT30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[40]}]
set_property -dict {LOC AT29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[41]}]
set_property -dict {LOC AU31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[42]}]
set_property -dict {LOC AU30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[43]}]
set_property -dict {LOC AV32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[44]}]
set_property -dict {LOC AU32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[45]}]
set_property -dict {LOC AW31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[46]}]
set_property -dict {LOC AV31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[47]}]
set_property -dict {LOC AY32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[48]}]
set_property -dict {LOC AY31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[49]}]
set_property -dict {LOC BA30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[50]}]
set_property -dict {LOC AY30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[51]}]
set_property -dict {LOC BB29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[52]}]
set_property -dict {LOC BA29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[53]}]
set_property -dict {LOC BB31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[54]}]
set_property -dict {LOC BB30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[55]}]
set_property -dict {LOC BD29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[56]}]
set_property -dict {LOC BC29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[57]}]
set_property -dict {LOC BE33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[58]}]
set_property -dict {LOC BD33 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[59]}]
set_property -dict {LOC BF30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[60]}]
set_property -dict {LOC BE30 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[61]}]
set_property -dict {LOC BE32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[62]}]
set_property -dict {LOC BE31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[63]}]
set_property -dict {LOC BC38 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[64]}]
set_property -dict {LOC BB38 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[65]}]
set_property -dict {LOC BD39 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[66]}]
set_property -dict {LOC BC39 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[67]}]
set_property -dict {LOC BF37 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[68]}]
set_property -dict {LOC BE37 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[69]}]
set_property -dict {LOC BF38 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[70]}]
set_property -dict {LOC BE38 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dq[71]}]
set_property -dict {LOC W31  IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[0]}]
set_property -dict {LOC Y31  IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[0]}]
set_property -dict {LOC AC31 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[1]}]
set_property -dict {LOC AD31 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[1]}]
set_property -dict {LOC AH31 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[2]}]
set_property -dict {LOC AH32 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[2]}]
set_property -dict {LOC AH28 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[3]}]
set_property -dict {LOC AH29 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[3]}]
set_property -dict {LOC AM29 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[4]}]
set_property -dict {LOC AM30 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[4]}]
set_property -dict {LOC AU29 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[5]}]
set_property -dict {LOC AV29 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[5]}]
set_property -dict {LOC BA32 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[6]}]
set_property -dict {LOC BB32 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[6]}]
set_property -dict {LOC BD30 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[7]}]
set_property -dict {LOC BD31 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[7]}]
set_property -dict {LOC BD40 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_t[8]}]
set_property -dict {LOC BE40 IOSTANDARD DIFF_POD12_DCI  } [get_ports {ddr4_a_dqs_c[8]}]
set_property -dict {LOC AA32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[0]}]
set_property -dict {LOC AE31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[1]}]
set_property -dict {LOC AH34 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[2]}]
set_property -dict {LOC AJ27 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[3]}]
set_property -dict {LOC AP31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[4]}]
set_property -dict {LOC AW29 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[5]}]
set_property -dict {LOC BC31 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[6]}]
set_property -dict {LOC BF32 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[7]}]
set_property -dict {LOC BF39 IOSTANDARD POD12_DCI       } [get_ports {ddr4_a_dm_dbi_n[8]}]
