Skip to content

Commit

Permalink
Extend Vivado run script to support FPGAs of the Versal family
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Schenkel committed Nov 8, 2024
1 parent 7bcbf9f commit e01ca02
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 24 deletions.
9 changes: 6 additions & 3 deletions edalize/templates/vivado/vivado-run.tcl.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -30,5 +32,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions edalize/tools/templates/vivado/vivado-run.tcl.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/test_vivado/board_file/test_vivado_0_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/test_vivado/minimal/test_vivado_minimal_0_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/test_vivado/test_vivado_0_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/test_vivado/yosys/test_vivado_yosys_0_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/tools/vivado/design_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}
9 changes: 6 additions & 3 deletions tests/tools/vivado/tags/design_run.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Create a bin file which can be used to program the flash on the FPGA
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
if { [llength [list_property [get_runs impl_1] STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE]] } {
set_property STEPS.WRITE_BITSTREAM.ARGS.BIN_FILE true [get_runs impl_1]
}

# Vivado will raise an error if impl_1 is launched when it is already done. So
# check the progress first and only launch if its not complete.
Expand Down Expand Up @@ -29,5 +31,6 @@ if { [get_property PROGRESS [get_runs impl_1]] != "100%"} {
# The Vivado default name is beneficial when using the GUI, as it is set as
# default bitstream in the "Program Device" dialog; non-standard names need to
# be selected from a file picker first.
set vivadoDefaultBitstreamFile [ get_property DIRECTORY [current_run] ]/[ get_property top [current_fileset] ].bit
file copy -force $vivadoDefaultBitstreamFile [pwd]/[current_project].bit
foreach vivadoBitstreamFile [glob -path [file rootname [get_property DIRECTORY [current_run]]/[get_property top [current_fileset]]] .{bit,bif}] {
file copy -force $vivadoBitstreamFile [pwd]/[current_project][file extension $vivadoBitstreamFile]
}

0 comments on commit e01ca02

Please sign in to comment.