Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 9/30/2024
Public
Document Table of Contents

1.7.2. Check Design File Syntax

The .tcl script example below assumes the Quartus® Prime software fir_filter tutorial project exists in the current directory. You can find the fir_filter project in the < Quartus® Prime directory>/qdesigns/fir_filter directory unless the Quartus® Prime software tutorial files are not installed.

When options are not specified, the executable uses the project database values. If not specified in the project database, the executable uses the Quartus® Prime software default values.

To run this script, save this script to a file such as check_syntax.tcl and then run the following command from a command prompt: quartus_syn -t check_syntax.tcl.
set dir [pwd]; # set dir to current working directory

# assign quartus_files variable to all files within current working directory
# asterisk (*) may be changed to specific file extensions (i.e. *.v, *.vhdl, *.etc)
set quartus_files [glob -directory $dir *]

# open project fir_filter with revision name filtref
project_open fir_filter -revision filtref

foreach file $quartus_files {
      post_message $file;         # echo which file was analyzed
      analyze_files -files $file -library work; # analyze file for syntax
}

project_close; # close project