FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
6673 Discussions

Tcl commands required to create project files in sub-directory

EPrec
Beginner
1,130 Views

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?

 

 

 

0 Kudos
2 Replies
EPrec
Beginner
831 Views

... 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

 

0 Kudos
KhaiChein_Y_Intel
831 Views

It's glad that you found the command.

0 Kudos
Reply