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

# XDC constraints for the HiTech Global HTG-ZRF8-EM board
# part: xczu28dr-ffvg1517-2-e
# part: xczu48dr-ffvg1517-2-e

# DDR4 components
set_property -dict {LOC AN11 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[0]}]
set_property -dict {LOC AM14 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[1]}]
set_property -dict {LOC AM7  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[2]}]
set_property -dict {LOC AL14 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[3]}]
set_property -dict {LOC AL10 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[4]}]
set_property -dict {LOC AM12 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[5]}]
set_property -dict {LOC AN7  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[6]}]
set_property -dict {LOC AR11 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[7]}]
set_property -dict {LOC AM8  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[8]}]
set_property -dict {LOC AN12 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[9]}]
set_property -dict {LOC AN10 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[10]}]
set_property -dict {LOC AL7  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[11]}]
set_property -dict {LOC AK14 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[12]}]
set_property -dict {LOC AP11 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[13]}]
set_property -dict {LOC AM10 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[14]}]
set_property -dict {LOC AJ14 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[15]}]
set_property -dict {LOC AH13 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_a[16]}]

set_property -dict {LOC AP10 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_act_n}]
set_property -dict {LOC AM9  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_alert_n}]

set_property -dict {LOC AL8  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_ba[0]}]
set_property -dict {LOC AK13 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_ba[1]}]
set_property -dict {LOC AN8  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_bg[0]}]

set_property -dict {LOC AR9  IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_cke}]
set_property -dict {LOC AM13 IOSTANDARD DIFF_SSTL2_DCI} [get_ports {ddr4_c_ck_t}]
set_property -dict {LOC AN13 IOSTANDARD DIFF_SSTL2_DCI} [get_ports {ddr4_c_ck_c}]
set_property -dict {LOC AL12 IOSTANDARD SSTL12_DCI} [get_ports {ddr4_c_cs_n}]

set_property -dict {LOC AP9  IOSTANDARD LVCMOS12} [get_ports {ddr4_c_odt}]
set_property -dict {LOC AK12 IOSTANDARD LVCMOS12} [get_ports {ddr4_c_rst_n}]
set_property -dict {LOC AL9  IOSTANDARD LVCMOS12} [get_ports {ddr4_c_par}]
set_property -dict {LOC AR12 IOSTANDARD LVCMOS12} [get_ports {ddr4_c_ten}]

set_property -dict {LOC AT10 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[0]}]
set_property -dict {LOC AW11 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[1]}]
set_property -dict {LOC AU10 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[2]}]
set_property -dict {LOC AV11 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[3]}]
set_property -dict {LOC AW8  IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[4]}]
set_property -dict {LOC AV12 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[5]}]
set_property -dict {LOC AW9  IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[6]}]
set_property -dict {LOC AU12 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[7]}]
set_property -dict {LOC AH16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[8]}]
set_property -dict {LOC AJ16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[9]}]
set_property -dict {LOC AF16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[10]}]
set_property -dict {LOC AJ15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[11]}]
set_property -dict {LOC AF17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[12]}]
set_property -dict {LOC AK16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[13]}]
set_property -dict {LOC AH15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[14]}]
set_property -dict {LOC AK17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[15]}]
set_property -dict {LOC AV15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[16]}]
set_property -dict {LOC AU15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[17]}]
set_property -dict {LOC AV13 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[18]}]
set_property -dict {LOC AW15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[19]}]
set_property -dict {LOC AT15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[20]}]
set_property -dict {LOC AT16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[21]}]
set_property -dict {LOC AU14 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[22]}]
set_property -dict {LOC AU13 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[23]}]
set_property -dict {LOC AN15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[24]}]
set_property -dict {LOC AR16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[25]}]
set_property -dict {LOC AM15 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[26]}]
set_property -dict {LOC AP14 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[27]}]
set_property -dict {LOC AM17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[28]}]
set_property -dict {LOC AR14 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[29]}]
set_property -dict {LOC AL17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[30]}]
set_property -dict {LOC AP16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[31]}]
set_property -dict {LOC AV18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[32]}]
set_property -dict {LOC AU19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[33]}]
set_property -dict {LOC AU18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[34]}]
set_property -dict {LOC AU20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[35]}]
set_property -dict {LOC AV17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[36]}]
set_property -dict {LOC AV20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[37]}]
set_property -dict {LOC AU17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[38]}]
set_property -dict {LOC AW20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[39]}]
set_property -dict {LOC AP18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[40]}]
set_property -dict {LOC AR21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[41]}]
set_property -dict {LOC AR19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[42]}]
set_property -dict {LOC AT21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[43]}]
set_property -dict {LOC AT19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[44]}]
set_property -dict {LOC AP20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[45]}]
set_property -dict {LOC AR18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[46]}]
set_property -dict {LOC AP19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[47]}]
set_property -dict {LOC AN21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[48]}]
set_property -dict {LOC AL21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[49]}]
set_property -dict {LOC AL19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[50]}]
set_property -dict {LOC AM18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[51]}]
set_property -dict {LOC AP21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[52]}]
set_property -dict {LOC AL20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[53]}]
set_property -dict {LOC AM19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[54]}]
set_property -dict {LOC AN18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[55]}]
set_property -dict {LOC AH18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[56]}]
set_property -dict {LOC AG18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[57]}]
set_property -dict {LOC AK22 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[58]}]
set_property -dict {LOC AF20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[59]}]
set_property -dict {LOC AK21 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[60]}]
set_property -dict {LOC AF19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[61]}]
set_property -dict {LOC AJ19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[62]}]
set_property -dict {LOC AJ20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dq[63]}]

set_property -dict {LOC AT12 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[0]}]
set_property -dict {LOC AT11 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[0]}]
set_property -dict {LOC AG17 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[1]}]
set_property -dict {LOC AH17 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[1]}]
set_property -dict {LOC AV16 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[2]}]
set_property -dict {LOC AW16 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[2]}]
set_property -dict {LOC AN17 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[3]}]
set_property -dict {LOC AN16 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[3]}]
set_property -dict {LOC AV21 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[4]}]
set_property -dict {LOC AW21 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[4]}]
set_property -dict {LOC AR22 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[5]}]
set_property -dict {LOC AT22 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[5]}]
set_property -dict {LOC AL22 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[6]}]
set_property -dict {LOC AM22 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[6]}]
set_property -dict {LOC AG20 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_t[7]}]
set_property -dict {LOC AH20 IOSTANDARD DIFF_POD12} [get_ports {ddr4_c_dqs_c[7]}]

set_property -dict {LOC AV10 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[0]}]
set_property -dict {LOC AL16 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[1]}]
set_property -dict {LOC AW14 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[2]}]
set_property -dict {LOC AP13 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[3]}]
set_property -dict {LOC AW19 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[4]}]
set_property -dict {LOC AR17 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[5]}]
set_property -dict {LOC AM20 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[6]}]
set_property -dict {LOC AJ18 IOSTANDARD POD12_DCI} [get_ports {ddr4_c_dm_dbi_n[7]}]
