Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

quartus II tcl script problems

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

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.