Run Quartus II fitter and TimeQuest Timing Analyzer automatically using Tcl script

This is a Quartus II Tcl script that will automate the fitter and TimeQuest Timing Analyzer automatically sequentially. By default in Quartus II, the tasks flow customization does not allow running fitter first without running elaboration and synthesis first. This is one of the pre-requisites Altera enforce on the tasks flow. Some times when optimizing a FPGA design by playing around the fitter settings, you will just need to rerun fitter and TimeQuest to get the timing analysis results of the fitter settings change.

This script is intended to be use as the script file argument for the "quartus_sh" command line.


  1. Copy and paste the Tcl code example into a text editor. 
  2. Change the "top" design name according to the Quartus II design name.
  3. Save the text file as Tcl script with ".tcl" as extension.

Example Tcl codes

load_package flow
load_package report
set project_name top
set project_revision top
project_open -revision $project_revision $project_name
# Place & Route
if {[catch {execute_module -tool fit} result]} {
puts "\nResult: $result\n"
puts "ERROR: Quartus II Fitter failed. See the report file.\n"
qexit -error
} else {
puts "\nInfo: Quartus II Fitter was successful.\n"
# TimeQuest Timing Analyzer
if {[catch {execute_module -tool sta} result]} {
puts "\nResult: $result\n"
puts "ERROR: TimeQuest Analyzer failed. See the report file.\n"
qexit -error
} else {
puts "\nInfo: TimeQuest Analyzer was successful.\n"

Command line usage

quartus_sh -t script.tcl


Popular posts from this blog

How to recalibrate your Samsung Note 4 battery

How to import Tasker projects, profiles, tasks and scenes

How to turn your Windows 7 laptop or dekstop into a WiFi repeater or extender