I have found numerous issues with enable_auto_incremental_compile.tcl. Unfortunately this scripts does not seem to be usable as is and I'm surprised that they are available at all in the Tcl Store.
I've attached a modified working version (tested in Vivado 2016.2) and discussed the changes made below:
Issue 1:
The scripts replaces launch_runs with its own incremental version. The problem is that reset_run (which is called by the GUI first) removes the .dcps that is meant to be reused before launch_runs is actually called. This makes these scripts useless in most cases, unless the user runs launch_runs without reset_runs in the Tcl Console.
reset_run should also be replacedo with an incremental version. The attached fixed versions does exactly that.
Issue 2:
line 259 is invalid as is:
set runs_placed_or_routed [ list ]
It should be:
set runs_placed_or_routed [ list $impl_runs ]
Issue 3:
Just an enhancement:
Replace line 246 as from:
puts "AutoIncrementalCompile: Incremental Flow not enabled as $guideFile for scheme $::tclapp::xilinx::incrcompile::autoIncrCompileScheme does not exist"
to become:
if {[string length $guideFile] == 0} {
puts "AutoIncrementalCompile: Incremental Flow not enabled no guide file for scheme $::tclapp::xilinx::incrcompile::autoIncrCompileScheme does exists"
} else {
puts "AutoIncrementalCompile: Incremental Flow not enabled as $guideFile for scheme $::tclapp::xilinx::incrcompile::autoIncrCompileScheme does not exist"
}
Issue 4:
Proc ::tclapp::xilinx::incrcompile::get_placed_or_routed_dcp is flawed in its implementation as it does not create a copy of the checkpoint outside of the implementation directory.
This results in Vivado giving:
CRITICAL WARNING: [Vivado 12-3202] The incremental checkpoint file 'D:/proj/reference_designs/incremental_compile/incremental_compile.runs/impl_1/top_routed.dcp' is in the run directory 'D:/proj/reference_designs/incremental_compile/incremental_compile.runs/impl_1' and will be deleted the next time this run is reset.
It should create a copy of the found checkpoint outside of the implementation directory. This can be done by adding the following just before the last line of the function:
set impl_dir_cdUp "$impl_dir/../"
if {[string length $dcpFile] != 0} {
set dcpFileName [file tail $dcpFile]
set dcpFileTarget "${impl_dir_cdUp}${dcpFileName}"
if {[catch {file copy -force $dcpFile $dcpFileTarget}]} {
puts "AutoIncrementalCompile: Could not create copy of incremental checkpoint: Source = $dcpFile, Destination = $dcpFileTarget."
} else {
#puts "Successfully created reference copy of routed checkpoint for incremental reuse. Location: $dcpFileTarget."
}
set dcpFile $dcpFileTarget
} else {
# When the user resets the run in the GUI, the latest dcp will be removed and we will get in here.
# However, we might still have a dcp which we've copied to the .runs directory previously that we can use.
# Check if it exists and if so reuse it:
set top [ get_property TOP [current_fileset] ]
set dcpFileTarget "${impl_dir_cdUp}${top}_routed.dcp"
if {[file exists $dcpFileTarget] == 0} {
set dcpFileTarget "${impl_dir_cdUp}${top}_placed.dcp"
puts "2 = $dcpFileTarget"
}
if {[file exists $dcpFileTarget]} {
set dcpFile $dcpFileTarget
puts "AutoIncrementalCompile: Reusing previously copied guide file: $dcpFileTarget."
}
}
Issue 5:
Change Line 249 from
puts "AutoIncrementalCompile: Incremental Flow enabled for $run with ${refRun}'s guide file ($guideFile) as the reference checkpoint"
to
puts "AutoIncrementalCompile: Incremental Flow enabled for $run with ${refRun}'s guide file ($guideFile) as the reference checkpoint"
to make for easier reading...
Issue 6:
If no reuse checkpoint can be found, the script should correctly reset the previously set INCREMENTAL_CHECKPOINT property! If it isn't not done, Vivado falls over with:
ERROR: [Vivado 12-3280] Incremental checkpoint file 'D:/proj/reference_designs/incremental_compile/incremental_compile.runs/top_routed.dcp' set on run 'impl_1' does not exist.
This can be done using:
reset_property INCREMENTAL_CHECKPOINT $run