Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
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.
17268 Discussions

quartus II tcl script problems

Altera_Forum
Honored Contributor II
1,253 Views

Hello,  

I am new to tcl scripting in Quartus II.  

My task is to compile a project using a tcl script and then use another tcl script to change the directory and again compile a project using a tcl script in the new directory. 

 

To compile the project the script is : 

set project_name fulladder_new 

project_new -overwrite $project_name# project_open fulladder 

source fulladder.qsf 

load_package flow 

execute_flow -compile 

project_close 

 

To change the directory the script is: 

set dirname D:/tcl_test 

set sysdir $dirname 

cd $dirname 

 

I am using a main tcl script to source these two scripts.  

source compile_script.tcl 

source change_dir_script.tcl 

 

However at the end of running the main script as 

quartus_sh -t main.tcl  

The directory doesnt change.  

However if I run individual scripts, both of them work.  

 

Can anyone suggest any way to fix this problem 

 

Thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
565 Views

I would suggest using a single script with relative paths to both directories where your projects reside.

0 Kudos
Altera_Forum
Honored Contributor II
565 Views

Thanks for the reply. 

But the project requirements is such that I need individual scripts for all the sub-tasks.  

That is why I need to have the structure that I have declared.
0 Kudos
Altera_Forum
Honored Contributor II
565 Views

Ok. I suppose the problem is that the path changes in change_dir_script, but remains the old one when returning to the top script. I would suggest one of the following: 

 

1. Change the dir in the top script 

source compile_script.tcl 

set dirname D:/tcl_test 

set sysdir $dirname 

cd $dirname 

source compile_script.tcl 

 

2. Use relative paths in the compile scripts, referring to the initial dir where the top script is invoked.
0 Kudos
Reply