-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix timing issues on FMCOMMS2 and AD9081/VCU118 #1909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
1489474
87f8044
beda6b0
f2d6cf0
c485f42
ebdd90f
711ecfb
e96efa8
2cc0018
d9f795f
dcd4b10
dbddf29
19827c5
ba61f00
8c4ef13
4d9f047
7a59b76
175a371
73d1d5d
0c62f70
734c73a
ac0b807
7fed80d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/scripts/auto_timing_fix.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 | ||
|
phlfm marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/scripts/auto_timing_fix.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 | ||
|
phlfm marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/scripts/auto_timing_fix.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 | ||
|
phlfm marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/scripts/auto_timing_fix.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 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo line 321: existing. Add source files to an existing project. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it is not related to this commit, but maybe it could be added as well. It is not necessary the elseif in line 332, just an else satisfies the filter for constrs_1 and sources_1.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,6 +324,7 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app | |
# \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"} { | ||
|
@@ -335,6 +336,10 @@ proc adi_project_files {project_name project_files} { | |
} | ||
} | ||
|
||
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 +348,31 @@ proc adi_project_files {project_name project_files} { | |
# | ||
# \param[project_name] - name of the project | ||
# | ||
# Additional configuration flags are: | ||
# - 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. | ||
|
||
proc adi_project_run {project_name} { | ||
|
||
global ad_project_dir | ||
|
@@ -351,6 +381,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 +420,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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
############################################################################### | ||
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved. | ||
### SPDX short identifier: ADIBSD | ||
############################################################################### | ||
# This script attempts to automatically fix timing violations after routing | ||
phlfm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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" | ||
} | ||
|
||
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 | ||
write_checkpoint -force "AutoTimingFix_${attempt}_before_system_top_placed.dcp" | ||
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 | ||
} | ||
} | ||
|
||
write_checkpoint -force "AutoTimingFix_${attempt}_final_system_top_placed.dcp" | ||
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." | ||
} elseif {$final_wns <= $ADI_AUTOFIX_WNS_THRESHOLD} { | ||
puts "WARNING: ATF: WNS (${wns} ns) excedes threshold (${ADI_AUTOFIX_WNS_THRESHOLD} ns). Automatic fix aborted." | ||
|
||
} else { | ||
puts "WARNING: ATF: auto timing fix FAILURE after ${attempt} attempts - final WNS is ${final_wns} ns." | ||
} | ||
} | ||
|
||
puts "INFO: auto timing fix (ATF) finished." |
Uh oh!
There was an error while loading. Please reload this page.