Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Tcl script to save and restore parameters

Sometimes I want to run a quick compile of a design but don't want to lose all my current Quartus settings. I wrote a simple Tcl script which saves off the current compiler settings, sets the options to compile much more quickly, then restores the options when it is done. You can copy this to a Tcl file and then tie that to the Tcl toolbar.

load_package flow

# Read and save existing settings

set Old_FITTER_EFFORT [get_global_assignment -name FITTER_EFFORT]

set Old_PHYSICAL_SYNTHESIS_COMBO_LOGIC [get_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC]

set Old_PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION [get_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION]

set Old_PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING [get_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING]

set Old_PHYSICAL_SYNTHESIS_REGISTER_RETIMING [get_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING]

set Old_PHYSICAL_SYNTHESIS_EFFORT [get_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT]

# Make settings so it will compile faster

set_global_assignment -name FITTER_EFFORT "FAST FIT"

set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF

set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF

set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING OFF

set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF

set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT FAST

# Compile the design

if {[catch {execute_flow -compile} result]} {

puts "ERROR: Compilation failed. See report files.\n"

} else {

puts "INFO: Compilation was successful.\n"

}

# Restore settings to their previous values

set_global_assignment -name FITTER_EFFORT $Old_FITTER_EFFORT

set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC $Old_PHYSICAL_SYNTHESIS_COMBO_LOGIC

set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION $Old_PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION

set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING $Old_PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING

set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING $Old_PHYSICAL_SYNTHESIS_REGISTER_RETIMING

set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT $Old_PHYSICAL_SYNTHESIS_EFFORT

No RepliesBe the first to reply