Forum Discussion

EPrec's avatar
EPrec
Icon for New Contributor rankNew Contributor
6 years ago

Tcl commands required to create project files in sub-directory

I used the 'Generate tcl file for Project' to generate a base Tcl file for my project. I'd like to modify that Tcl file so that I can 'Source' it one folder level above where I want my project (.qpf) and constraint (.qsf) files to be created.

For example, the generated Tcl script starts with the command:

if {[is_project_open]} {
	if {[string compare $quartus(project) "my_project"]} {
		puts "Project my_project is not open"
		set make_assignments 0
	}
} else {
	# Only open if not already open
	if {[project_exists my_project]} {
		project_open -revision my_project my_project
	} else {
		project_new -revision my_project my_project
	}
	set need_to_close_project 1
}

the 'is_project_open' command must look only in the local directory (where the Tcl script resides). Is there a Tcl command that can 'cd' into a sub-directory, run all the commands that create the project and make assignments and then exit?

2 Replies

  • EPrec's avatar
    EPrec
    Icon for New Contributor rankNew Contributor

    ... think I answered my own question. I added the following to the top of the Tcl file and it appears to be working as desired:

    set origin_dir "./Work_Dir"
    cd $origin_dir