From 623377e2d68ca7bd4ca86b37f47e07a9b602aebd Mon Sep 17 00:00:00 2001 From: Olof Kindgren Date: Wed, 13 Nov 2024 21:13:24 +0100 Subject: [PATCH] Fix reference files for Vivado --- tests/test_vivado/edif_netlist/test_vivado_0_run.tcl | 9 ++++++--- .../edif_netlist_no_link_design/test_vivado_0_run.tcl | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_vivado/edif_netlist/test_vivado_0_run.tcl b/tests/test_vivado/edif_netlist/test_vivado_0_run.tcl index a1d38e707..73d1257bb 100644 --- a/tests/test_vivado/edif_netlist/test_vivado_0_run.tcl +++ b/tests/test_vivado/edif_netlist/test_vivado_0_run.tcl @@ -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. @@ -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] +} diff --git a/tests/test_vivado/edif_netlist_no_link_design/test_vivado_0_run.tcl b/tests/test_vivado/edif_netlist_no_link_design/test_vivado_0_run.tcl index a1d38e707..73d1257bb 100644 --- a/tests/test_vivado/edif_netlist_no_link_design/test_vivado_0_run.tcl +++ b/tests/test_vivado/edif_netlist_no_link_design/test_vivado_0_run.tcl @@ -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. @@ -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] +}