From 88f6864ddc14da88327beec9f0dfa9966aac1d8f Mon Sep 17 00:00:00 2001 From: PopPaul2021 Date: Thu, 14 Nov 2024 10:43:13 +0200 Subject: [PATCH] projects/dac_fmc_ebz/zcu102: Add LANE_RATE parameter The ADI_LANE_RATE parameter is added on ZCU102 project. The parameter can take the 12.5GHz OR 15.4GHz values. The default value is 15.4GHz. Signed-off-by: PopPaul2021 --- projects/dac_fmc_ebz/zcu102/system_bd.tcl | 43 +++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/projects/dac_fmc_ebz/zcu102/system_bd.tcl b/projects/dac_fmc_ebz/zcu102/system_bd.tcl index 0dd421c373..1416c49b79 100644 --- a/projects/dac_fmc_ebz/zcu102/system_bd.tcl +++ b/projects/dac_fmc_ebz/zcu102/system_bd.tcl @@ -5,33 +5,53 @@ set dac_fifo_address_width 13 +source $ad_hdl_dir/projects/scripts/adi_pd.tcl source $ad_hdl_dir/projects/common/zcu102/zcu102_system_bd.tcl source $ad_hdl_dir/projects/common/xilinx/dacfifo_bd.tcl source ../common/dac_fmc_ebz_bd.tcl -source $ad_hdl_dir/projects/scripts/adi_pd.tcl -#parameters are for 12.5 GHz Lane Rate +if {[info exists ::env(ADI_LANE_RATE)]} { + set ADI_LANE_RATE [get_env_param ADI_LANE_RATE 15.4] +} elseif {![info exists ADI_LANE_RATE]} { + set ADI_LANE_RATE 15.4 +} + +# Common for both 12.5 and 15.4 GHz Lane Rate ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_REFCLK_DIV 1 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2 0xFC1 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG3 0x120 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG0 0x331C ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_FBDIV 40 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG4 0x4 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG1 0xD038 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG1_G3 0xD038 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2_G3 0xFC1 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_CLK25_DIV 13 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_OUT_DIV 1 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TXPI_CFG 0x0 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.A_TXDIFFCTRL 0xC -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_PI_BIASSET 2 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.POR_CFG 0x0 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.PPF0_CFG 0x800 -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.PPF1_CFG 0x600 ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CP 0xFF ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CP_G3 0xF -ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_LPF 0x37F + +if { $ADI_LANE_RATE == 15.4 } { + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2 0xFC0 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG0 0x333C + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG4 0x45 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2_G3 0xFC0 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_CLK25_DIV 15 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_PI_BIASSET 3 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.PPF0_CFG 0xF00 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_LPF 0x31D +} elseif { $ADI_LANE_RATE == 12.5 } { + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2 0xFC1 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG0 0x331C + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG4 0x4 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_CFG2_G3 0xFC1 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_CLK25_DIV 13 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.TX_PI_BIASSET 2 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.PPF0_CFG 0x800 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.PPF1_CFG 0x600 + ad_ip_parameter util_dac_jesd204_xcvr CONFIG.QPLL_LPF 0x37F +} else { + error "ADI_LANE_RATE must be either 12.5 GHz or 15.4GHz" +} ad_ip_parameter dac_jesd204_link/tx CONFIG.SYSREF_IOB false ad_ip_parameter dac_dma CONFIG.DMA_DATA_WIDTH_SRC 128 @@ -52,6 +72,7 @@ LINKS=$ad_project_params(NUM_LINKS)\ DEVICE_CODE=$ad_project_params(DEVICE_CODE)\ DAC_DEVICE=$ADI_DAC_DEVICE\ DAC_MODE=$ADI_DAC_MODE\ +ADI_LANE_RATE=$ADI_LANE_RATE\ DAC_FIFO_ADDR_WIDTH=$dac_fifo_address_width" sysid_gen_sys_init_file $sys_cstring