Skip to content

Commit 9527efc

Browse files
committed
projects: scripts: adi_project_xilinx: Don't generate .bin file for Versal projects
Versal boards do not support generating .bin files, in order for Vivado to not fail when ADI_GENERATE_BIN is set we must skip the .bin generation if the project is targetting a Versal FPGA even if the variable exists. Signed-off-by: Bogdan Luncan <bogdan.luncan@analog.com>
1 parent 5f9975b commit 9527efc

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

projects/scripts/adi_project_xilinx.tcl

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved.
2+
## Copyright (C) 2014-2023, 2025 Analog Devices, Inc. All rights reserved.
33
### SPDX short identifier: ADIBSD
44
###############################################################################
55

@@ -28,6 +28,17 @@ set ADI_USE_INCR_COMP 1
2828
## Set to enable power optimization
2929
set ADI_POWER_OPTIMIZATION 0
3030

31+
## Set to generate .bin (for selmap)
32+
if {![info exists ::env(ADI_GENERATE_BIN)]} {
33+
set ADI_GENERATE_BIN 0
34+
} else {
35+
if {[string equal $::env(ADI_GENERATE_BIN) n]} {
36+
set ADI_GENERATE_BIN 0
37+
} else {
38+
set ADI_GENERATE_BIN 1
39+
}
40+
}
41+
3142
## Initialize global variables
3243
set p_board "not-applicable"
3344
set p_device "none"
@@ -335,9 +346,11 @@ proc adi_project_files {project_name project_files} {
335346
proc adi_project_run {project_name} {
336347

337348
global ad_project_dir
349+
global sys_zynq
338350
global ADI_POWER_OPTIMIZATION
339351
global ADI_USE_OOC_SYNTHESIS
340352
global ADI_MAX_OOC_JOBS
353+
global ADI_GENERATE_BIN
341354

342355
if {![info exists ::env(ADI_PROJECT_DIR)]} {
343356
set actual_project_name $project_name
@@ -549,14 +562,24 @@ proc adi_project_run {project_name} {
549562
if { [string match "*VIOLATED*" $timing_string] == 1 ||
550563
[string match "*Timing constraints are not met*" $timing_string] == 1} {
551564
write_hw_platform -fixed -force -include_bit -file ${actual_project_name}.sdk/system_top_bad_timing.xsa
552-
if {[info exists ::env(ADI_GENERATE_BIN)]} {
553-
write_bitstream -bin_file ${actual_project_name}.sdk/system_top_bad_timing.bit
565+
# Generate .bin file only for non Versal designs
566+
if {$ADI_GENERATE_BIN == 1} {
567+
if {$sys_zynq == 3} {
568+
puts "Bin generation skipped, Versal families do not support it."
569+
} else {
570+
write_bitstream -bin_file ${actual_project_name}.sdk/system_top_bad_timing.bit
571+
}
554572
}
555573
return -code error [format "ERROR: Timing Constraints NOT met!"]
556574
} else {
557575
write_hw_platform -fixed -force -include_bit -file ${actual_project_name}.sdk/system_top.xsa
558-
if {[info exists ::env(ADI_GENERATE_BIN)]} {
559-
write_bitstream -bin_file ${actual_project_name}.sdk/system_top.bit
576+
# Generate .bin file only for non Versal designs
577+
if {$ADI_GENERATE_BIN == 1} {
578+
if {$sys_zynq == 3} {
579+
puts "Bin generation skipped, Versal families do not support it."
580+
} else {
581+
write_bitstream -bin_file ${actual_project_name}.sdk/system_top.bit
582+
}
560583
}
561584
}
562585
}

0 commit comments

Comments
 (0)