diff --git a/docs/user_guide/build_hdl.rst b/docs/user_guide/build_hdl.rst index 3b29637b26b..3d90f1034cb 100644 --- a/docs/user_guide/build_hdl.rst +++ b/docs/user_guide/build_hdl.rst @@ -576,9 +576,37 @@ Running the command below will create a folder named **LVDSCMOSN1**. make LVDS_CMOS_N=1 -Enabling Out-of-Context synthesis +Available build flags and parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Below are some of the available parameters and system variables that can be used +when building a project: + +- **ADI_EXTRACT_PORTS**: if set, extracts port properties from a predefined list + of IPs into 'ports_properties.txt'. +- **ADI_GENERATE_BIN**: if set, generates a binary bitstream file (.bin) + in addition to the .xsa hardware platform. +- **ADI_GENERATE_UTILIZATION**: if set, generates CSV and log files detailing + resource utilization for the design and specific IPs. +- **ADI_GENERATE_XPA**: if set, runs a Xilinx Power Analysis (XPA) and generates + a summary report. +- **ADI_MAX_OOC_JOBS**: specifies the number of parallel jobs to use for + Out-of-Context (OOC) synthesis. +- **ADI_MAX_THREADS**: specifies the maximum number of threads for Vivado + operations. Default value is 8. +- **ADI_NO_BITSTREAM_COMPRESSION**: if set, disables compression of the final + bitstream file. +- **ADI_POST_ROUTE_SCRIPT**: specifies the path to a Tcl script to be executed + after the routing design step. +- **ADI_POWER_OPTIMIZATION**: if set to 1, enables power optimization during the + implementation run. +- **ADI_PROJECT_DIR**: specifies a base directory for output files such as logs + and reports. +- **ADI_SKIP_SYNTHESIS**: if set, the entire procedure will exit before starting + synthesis. +- **ADI_USE_OOC_SYNTHESIS**: if set to 1, launches synthesis for OOC IP modules + in parallel. + You can opt in for out-of-context synthesis during the build by defining the ``ADI_USE_OOC_SYNTHESIS`` system variable. By setting the ``ADI_MAX_OOC_JOBS`` system variable you can adjust the number of diff --git a/projects/ad9081_fmca_ebz/vcu118/system_project.tcl b/projects/ad9081_fmca_ebz/vcu118/system_project.tcl index c4e6450754d..2e22588456e 100644 --- a/projects/ad9081_fmca_ebz/vcu118/system_project.tcl +++ b/projects/ad9081_fmca_ebz/vcu118/system_project.tcl @@ -6,6 +6,7 @@ source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] # get_env_param retrieves parameter value from the environment if exists, # other case use the default value @@ -95,4 +96,6 @@ if {$ADI_USE_OOC_SYNTHESIS == 1} { set_property used_in_synthesis false [get_files timing_constr.xdc] } +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] + adi_project_run ad9081_fmca_ebz_vcu118 diff --git a/projects/daq2/kcu105/system_project.tcl b/projects/daq2/kcu105/system_project.tcl index 3f6884ed096..fd2067fc26f 100644 --- a/projects/daq2/kcu105/system_project.tcl +++ b/projects/daq2/kcu105/system_project.tcl @@ -1,11 +1,13 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME kcu105 # get_env_param retrieves parameter value from the environment if exists, # other case use the default value @@ -13,14 +15,14 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl # Use over-writable parameters from the environment. # # e.g. -# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 +# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 # Parameter description: # [RX/TX]_JESD_M : Number of converters per link # [RX/TX]_JESD_L : Number of lanes per link # [RX/TX]_JESD_S : Number of samples per frame -adi_project daq2_kcu105 0 [list \ +adi_project daq2_${BOARD_NAME} 0 [list \ RX_JESD_M [get_env_param RX_JESD_M 2 ] \ RX_JESD_L [get_env_param RX_JESD_L 4 ] \ RX_JESD_S [get_env_param RX_JESD_S 1 ] \ @@ -29,14 +31,15 @@ adi_project daq2_kcu105 0 [list \ TX_JESD_S [get_env_param TX_JESD_S 1 ] \ ] -adi_project_files daq2_kcu105 [list \ +adi_project_files daq2_${BOARD_NAME} [list \ "../common/daq2_spi.v" \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/kcu105/kcu105_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -## To improve timing in DDR4 MIG -set_property strategy Performance_RefinePlacement [get_runs impl_1] +## daq2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] -adi_project_run daq2_kcu105 +adi_project_run daq2_${BOARD_NAME} diff --git a/projects/daq2/zc706/system_project.tcl b/projects/daq2/zc706/system_project.tcl index 21f32519ce6..c1dfef59372 100644 --- a/projects/daq2/zc706/system_project.tcl +++ b/projects/daq2/zc706/system_project.tcl @@ -1,11 +1,13 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zc706 # get_env_param retrieves parameter value from the environment if exists, # other case use the default value @@ -13,14 +15,14 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl # Use over-writable parameters from the environment. # # e.g. -# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 +# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 # Parameter description: # [RX/TX]_JESD_M : Number of converters per link # [RX/TX]_JESD_L : Number of lanes per link # [RX/TX]_JESD_S : Number of samples per frame -adi_project daq2_zc706 0 [list \ +adi_project daq2_${BOARD_NAME} 0 [list \ RX_JESD_M [get_env_param RX_JESD_M 2 ] \ RX_JESD_L [get_env_param RX_JESD_L 4 ] \ RX_JESD_S [get_env_param RX_JESD_S 1 ] \ @@ -29,17 +31,16 @@ adi_project daq2_zc706 0 [list \ TX_JESD_S [get_env_param TX_JESD_S 1 ] \ ] -adi_project_files daq2_zc706 [list \ +adi_project_files daq2_${BOARD_NAME} [list \ "../common/daq2_spi.v" \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zc706/zc706_plddr3_constr.xdc" \ - "$ad_hdl_dir/projects/common/zc706/zc706_system_constr.xdc" ] - -adi_project_run daq2_zc706 - -## To improve timing in the axi_ad9680_offload component -set_property strategy Performance_Retiming [get_runs impl_1] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_plddr3_constr.xdc" \ + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] +## daq2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] +adi_project_run daq2_${BOARD_NAME} diff --git a/projects/daq2/zcu102/system_project.tcl b/projects/daq2/zcu102/system_project.tcl index cdc8af46cef..3d55b77b78b 100644 --- a/projects/daq2/zcu102/system_project.tcl +++ b/projects/daq2/zcu102/system_project.tcl @@ -1,11 +1,13 @@ ############################################################################### -## Copyright (C) 2016-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2016-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zcu102 # get_env_param retrieves parameter value from the environment if exists, # other case use the default value @@ -13,14 +15,14 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl # Use over-writable parameters from the environment. # # e.g. -# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 +# make RX_JESD_L=4 RX_JESD_M=2 TX_JESD_L=4 TX_JESD_M=2 # Parameter description: # [RX/TX]_JESD_M : Number of converters per link # [RX/TX]_JESD_L : Number of lanes per link # [RX/TX]_JESD_S : Number of samples per frame -adi_project daq2_zcu102 0 [list \ +adi_project daq2_${BOARD_NAME} 0 [list \ RX_JESD_M [get_env_param RX_JESD_M 2 ] \ RX_JESD_L [get_env_param RX_JESD_L 4 ] \ RX_JESD_S [get_env_param RX_JESD_S 1 ] \ @@ -29,14 +31,15 @@ adi_project daq2_zcu102 0 [list \ TX_JESD_S [get_env_param TX_JESD_S 1 ] \ ] -adi_project_files daq2_zcu102 [list \ +adi_project_files daq2_${BOARD_NAME} [list \ "../common/daq2_spi.v" \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zcu102/zcu102_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run daq2_zcu102 +## daq2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] -## To improve timing in the axi_ad9680_offload component -set_property strategy Performance_Retiming [get_runs impl_1] +adi_project_run daq2_${BOARD_NAME} diff --git a/projects/fmcomms2/kcu105/system_project.tcl b/projects/fmcomms2/kcu105/system_project.tcl index 7f30a24dea1..a8dbdee725a 100644 --- a/projects/fmcomms2/kcu105/system_project.tcl +++ b/projects/fmcomms2/kcu105/system_project.tcl @@ -6,18 +6,20 @@ source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME kcu105 -adi_project fmcomms2_kcu105 -adi_project_files fmcomms2_kcu105 [list \ +adi_project fmcomms2_${BOARD_NAME} +adi_project_files fmcomms2_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/kcu105/kcu105_system_constr.xdc" \ - "$ad_hdl_dir/projects/common/kcu105/kcu105_system_lutram_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" \ + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_lutram_constr.xdc" ] -## To improve timing in DDR4 MIG -set_property strategy Performance_RefinePlacement [get_runs impl_1] -set_property STEPS.PHYS_OPT_DESIGN.ARGS.DIRECTIVE ExploreWithAggressiveHoldFix [get_runs impl_1] +## fmcomms2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] -adi_project_run fmcomms2_kcu105 +adi_project_run fmcomms2_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms2/zc702/system_project.tcl b/projects/fmcomms2/zc702/system_project.tcl index 6aef021b926..4780d3c9172 100644 --- a/projects/fmcomms2/zc702/system_project.tcl +++ b/projects/fmcomms2/zc702/system_project.tcl @@ -1,21 +1,25 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zc702 -adi_project fmcomms2_zc702 -adi_project_files fmcomms2_zc702 [list \ +adi_project fmcomms2_${BOARD_NAME} +adi_project_files fmcomms2_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc" \ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zc702/zc702_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -set_property strategy Performance_Explore [get_runs impl_1] +## fmcomms2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] -adi_project_run fmcomms2_zc702 +adi_project_run fmcomms2_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms2/zc706/system_project.tcl b/projects/fmcomms2/zc706/system_project.tcl index 4ae778edb0a..6347ec4b78a 100644 --- a/projects/fmcomms2/zc706/system_project.tcl +++ b/projects/fmcomms2/zc706/system_project.tcl @@ -1,19 +1,25 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zc706 -adi_project fmcomms2_zc706 -adi_project_files fmcomms2_zc706 [list \ +adi_project fmcomms2_${BOARD_NAME} +adi_project_files fmcomms2_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zc706/zc706_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms2_zc706 +## fmcomms2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] + +adi_project_run fmcomms2_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms2/zcu102/system_project.tcl b/projects/fmcomms2/zcu102/system_project.tcl index 7af4ad85d27..9357388a647 100644 --- a/projects/fmcomms2/zcu102/system_project.tcl +++ b/projects/fmcomms2/zcu102/system_project.tcl @@ -1,19 +1,25 @@ ############################################################################### -## Copyright (C) 2016-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zcu102 -adi_project fmcomms2_zcu102 -adi_project_files fmcomms2_zcu102 [list \ +adi_project fmcomms2_${BOARD_NAME} +adi_project_files fmcomms2_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zcu102/zcu102_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms2_zcu102 +## fmcomms2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] + +adi_project_run fmcomms2_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms2/zed/system_project.tcl b/projects/fmcomms2/zed/system_project.tcl index 2afe1d2fc5e..10043bedc30 100644 --- a/projects/fmcomms2/zed/system_project.tcl +++ b/projects/fmcomms2/zed/system_project.tcl @@ -1,19 +1,24 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zed -adi_project fmcomms2_zed -adi_project_files fmcomms2_zed [list \ +adi_project fmcomms2_${BOARD_NAME} +adi_project_files fmcomms2_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zed/zed_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms2_zed -source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl +## fmcomms2 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] +adi_project_run fmcomms2_${BOARD_NAME} +source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms5/zc702/system_project.tcl b/projects/fmcomms5/zc702/system_project.tcl index 94190d5deb7..e7f2cb3f66e 100644 --- a/projects/fmcomms5/zc702/system_project.tcl +++ b/projects/fmcomms5/zc702/system_project.tcl @@ -1,19 +1,25 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zc702 -adi_project fmcomms5_zc702 -adi_project_files fmcomms5_zc702 [list \ +adi_project fmcomms5_${BOARD_NAME} +adi_project_files fmcomms5_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zc702/zc702_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms5_zc702 +## fmcomms5 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] + +adi_project_run fmcomms5_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms5/zc706/system_project.tcl b/projects/fmcomms5/zc706/system_project.tcl index 40098fde02c..42328ac0b47 100644 --- a/projects/fmcomms5/zc706/system_project.tcl +++ b/projects/fmcomms5/zc706/system_project.tcl @@ -1,19 +1,25 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zc706 -adi_project fmcomms5_zc706 -adi_project_files fmcomms5_zc706 [list \ +adi_project fmcomms5_${BOARD_NAME} +adi_project_files fmcomms5_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zc706/zc706_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms5_zc706 +## fmcomms5 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] + +adi_project_run fmcomms5_${BOARD_NAME} source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/fmcomms5/zcu102/system_project.tcl b/projects/fmcomms5/zcu102/system_project.tcl index 06f53599e88..acf176dc178 100644 --- a/projects/fmcomms5/zcu102/system_project.tcl +++ b/projects/fmcomms5/zcu102/system_project.tcl @@ -1,19 +1,24 @@ ############################################################################### -## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved. +## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved. ### SPDX short identifier: ADIBSD ############################################################################### source ../../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl +set ADI_POST_ROUTE_SCRIPT [file normalize $ad_hdl_dir/projects/scripts/auto_timing_fix_xilinx.tcl] +set BOARD_NAME zcu102 -adi_project fmcomms5_zcu102 -adi_project_files fmcomms5_zcu102 [list \ +adi_project fmcomms5_${BOARD_NAME} +adi_project_files fmcomms5_${BOARD_NAME} [list \ "system_top.v" \ "system_constr.xdc"\ "$ad_hdl_dir/library/common/ad_iobuf.v" \ - "$ad_hdl_dir/projects/common/zcu102/zcu102_system_constr.xdc" ] + "$ad_hdl_dir/projects/common/${BOARD_NAME}/${BOARD_NAME}_system_constr.xdc" ] -adi_project_run fmcomms5_zcu102 -source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl +## fmcomms5 design is presenting hold time violations on some paths +## set the strategy to spread logic and help with hold time fixes +set_property strategy Congestion_SpreadLogic_high [get_runs impl_1] +adi_project_run fmcomms5_${BOARD_NAME} +source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl diff --git a/projects/scripts/adi_project_xilinx.tcl b/projects/scripts/adi_project_xilinx.tcl index 655e14f18c2..5e664aa0905 100644 --- a/projects/scripts/adi_project_xilinx.tcl +++ b/projects/scripts/adi_project_xilinx.tcl @@ -318,23 +318,26 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app } -## Add source files to an exiting project. +## Add source files to an existing project. # # \param[project_name] - name of the project # \param[project_files] - list of project files # proc adi_project_files {project_name project_files} { + global ADI_POST_ROUTE_SCRIPT foreach pfile $project_files { if {[string range $pfile [expr 1 + [string last . $pfile]] end] == "xdc"} { add_files -norecurse -fileset constrs_1 $pfile - } elseif [regexp "_constr.tcl" $pfile] { - add_files -norecurse -fileset sources_1 $pfile } else { add_files -norecurse -fileset sources_1 $pfile } } + if {[info exists ADI_POST_ROUTE_SCRIPT]} { + add_files -fileset utils_1 -norecurse ${ADI_POST_ROUTE_SCRIPT} + } + # NOTE: top file name is always system_top set_property top system_top [current_fileset] } @@ -343,6 +346,8 @@ proc adi_project_files {project_name project_files} { # # \param[project_name] - name of the project # +# Additional configuration flags are documented in docs/user_guide/build_hdl.rst +# at the "Available build flags and parameters" section. proc adi_project_run {project_name} { global ad_project_dir @@ -351,6 +356,12 @@ proc adi_project_run {project_name} { global ADI_USE_OOC_SYNTHESIS global ADI_MAX_OOC_JOBS global ADI_GENERATE_BIN + global ADI_POST_ROUTE_SCRIPT + + if {[info exists ::env(ADI_MAX_THREADS)]} { + set_param general.maxThreads ${::env(ADI_MAX_THREADS)} + puts "INFO: maxThreads set to ${::env(ADI_MAX_THREADS)}" + } if {![info exists ::env(ADI_PROJECT_DIR)]} { set actual_project_name $project_name @@ -384,6 +395,10 @@ proc adi_project_run {project_name} { set_param board.repoPaths [get_property LOCAL_ROOT_DIR [xhub::get_xstores xilinx_board_store]] + if {[info exists ADI_POST_ROUTE_SCRIPT]} { + set_property STEPS.ROUTE_DESIGN.TCL.POST [ get_files ${ADI_POST_ROUTE_SCRIPT} -of [get_fileset utils_1] ] [get_runs impl_1] + } + launch_runs impl_1 -to_step write_bitstream wait_on_run impl_1 open_run impl_1 diff --git a/projects/scripts/auto_timing_fix_xilinx.tcl b/projects/scripts/auto_timing_fix_xilinx.tcl new file mode 100644 index 00000000000..63f6ba14c20 --- /dev/null +++ b/projects/scripts/auto_timing_fix_xilinx.tcl @@ -0,0 +1,81 @@ +############################################################################### +## Copyright (C) 2025 Analog Devices, Inc. All rights reserved. +### SPDX short identifier: ADIBSD +############################################################################### +# This script attempts to automatically fix timing violations after routing +# using phys_opt_design. It will make multiple attempts up to a maximum number +# of tries, or until no violations remain. It can be configured via the +# ADI_AUTOFIX_WNS_THRESHOLD and ADI_AUTOFIX_MAX_ATTEMPTS environment variables. +# +# ADI_AUTOFIX_WNS_THRESHOLD limits the worst negative slack (WNS) that will be +# automatically fixed. If the WNS is worse than this threshold, no automatic fix +# will be attempted. The threshold should be a negative number and the value is +# in nanoseconds. For example, a threshold of -1.0 means that only violations +# where "0 > WNS > -1.0 ns" will be automatically fixed. +# +puts "INFO: starting auto timing fix (ATF)..." +set attempt 0 + +# Set default values if not provided +if {![info exists ADI_AUTOFIX_WNS_THRESHOLD]} { + set ADI_AUTOFIX_WNS_THRESHOLD -1.0 + puts "INFO: ATF: ADI_AUTOFIX_WNS_THRESHOLD not set, using default of $ADI_AUTOFIX_WNS_THRESHOLD" +} +if {![info exists ADI_AUTOFIX_MAX_ATTEMPTS]} { + set ADI_AUTOFIX_MAX_ATTEMPTS 5 + puts "INFO: ATF: ADI_AUTOFIX_MAX_ATTEMPTS not set, using default of $ADI_AUTOFIX_MAX_ATTEMPTS" +} + +write_checkpoint -force "AutoTimingFix_before_system_top_placed.dcp" +while {$attempt < $ADI_AUTOFIX_MAX_ATTEMPTS} { + # Get the single worst timing path object in the design + set worst_path [get_timing_paths -nworst 1 -max_paths 1 -delay_type min_max] + if {[llength $worst_path] == 0} { break } ; # No paths found + set wns [get_property SLACK $worst_path] + if {${wns} >= 0.0} { break } ; # No violations remain + set delay_type [get_property DELAY_TYPE $worst_path] ;# Returns "max" for Setup, "min" for Hold + # Check if autofix should attempt based on WNS threshold + if {$wns > $ADI_AUTOFIX_WNS_THRESHOLD} { + incr attempt + puts "INFO: ATF: WNS = ${wns} ns of type $delay_type. Attempting automatic fix (${attempt} of ${ADI_AUTOFIX_MAX_ATTEMPTS})." + report_timing_summary -delay_type min_max -max_paths 5 -nworst 1 -file "AutoTimingFix_${attempt}_before_timing_summary.txt" + } else { + break ; # Abort automatic fix due to WNS threshold + } + # Attempt fix via phys_opt_design + if {$delay_type eq "min"} { + phys_opt_design -hold_fix + } elseif {$delay_type eq "max"} { + phys_opt_design + } else { + puts "ERROR: ATF: Unknown path type '${delay_type}'. Aborting automatic fix." + break + } +} + +report_timing_summary -delay_type min_max -max_paths 5 -nworst 1 -file "AutoTimingFix_${attempt}_final_timing_summary.txt" + +# Print a final report +if {[llength $worst_path] == 0} { + # Loop broke early due to no paths found + puts "ERROR: ATF: No constrained timing paths found. Exiting." +} elseif {${attempt} == 0 && ${wns} >= 0.0} { + # Loop broke early due to no violations on first check + puts "INFO: ATF: No timing violations detected on first check. No action required." +} else { + # Loop broke after at least one attempt + set worst_path [get_timing_paths -nworst 1 -max_paths 1 -delay_type min_max] + set final_wns [get_property SLACK $worst_path] + if {$final_wns >= 0} { + puts "INFO: ATF: auto timing fix SUCCESS after ${attempt} attempts - final WNS is ${final_wns} ns." + write_checkpoint -force "AutoTimingFix_success_system_top_placed.dcp" + } elseif {$final_wns <= $ADI_AUTOFIX_WNS_THRESHOLD} { + puts "WARNING: ATF: WNS (${wns} ns) exceeds threshold (${ADI_AUTOFIX_WNS_THRESHOLD} ns). Automatic fix aborted." + write_checkpoint -force "AutoTimingFix_aborted_system_top_placed.dcp" + } else { + puts "WARNING: ATF: auto timing fix FAILURE after ${attempt} attempts - final WNS is ${final_wns} ns." + write_checkpoint -force "AutoTimingFix_failure_system_top_placed.dcp" + } +} + +puts "INFO: auto timing fix (ATF) finished."