5.33.12 Running Tcl scripts from the command line

You can run Tcl scripts from your Windows or Unix command line as well as pass arguments to scripts from the command line.

To execute a Tcl script file in the Libero IDE Project Manager software from a shell command line:

At the prompt, type the path to the Microchip software followed by the word "SCRIPT" and a colon, and then the name of the script file as follows:

<location of Microchip software>\bin\libero SCRIPT:<filename>

where <location of Microchip software> is the root directory in which you installed the Microchip software, and <filename> is the name, including a relative or full path, of the Tcl script file to execute. For example, to run the Tcl script file "myscript.tcl", type:

C:\libero\designer\bin\libero SCRIPT:myscript.tcl

If myscript.tcl is in a particular folder named "mydesign", you can use SCRIPT_DIR to change the current working directory before calling the script, as in the following example:

C:\libero\designer\bin\libero SCRIPT:myscript.tcl "SCRIPT_DIR:C:\actelprj\mydesign"

To execute a Tcl script file in the Designer software from a shell command line:

At the prompt, type the path to the Microchip software followed by the word "SCRIPT" and a colon, and then the name of the script file as follows:

<location of Microchip software>\bin\designer SCRIPT:<filename>

where <location of Microchip software> is the root directory in which you installed the Microchip software, and<filename>is the name, including a relative or full path, of the Tcl script file to execute.

For example, to run the Tcl script file named "myscript.tcl" from the command line, you can type:

C:\libero\designer\bin\designer SCRIPT:myscript.tcl

If myscript.tcl is in a particular folder named "mydesign", you can use SCRIPT_DIR to change the current working directory before calling the script, as in the following example:

C:\libero\designer\bin\designer SCRIPT:myscript.tcl "SCRIPT_DIR:C:\actelprj\mydesign"

To pass arguments from the command line to your Tcl script file:

At the prompt, type the path to the Microchip software followed by the SCRIPT argument. Enclose the entire argument expression in double quotes:

<location of Microchip software>\bin\designer "SCRIPT:<filename arg1 arg2 ...>"

where <location of Microchip software> is the root directory in which you installed the Microchip software, and <filename arg1 arg2 ...>is the name, including a relative or full path, of the Tcl script file and arguments you are passing to the script file.

For example,

C:\libero\designer\bin\designer "SCRIPT:myscript.tcl one two three"

To obtain the output from the log file:

At the prompt, type the path to the Microchip software followed by the SCRIPT and LOGFILE arguments.

<location of Microchip software>\bin\designer "SCRIPT:<filename arg1 arg2 ...>" LOGFILE:<output.log>

where <location of Microchip software> is the root directory in which you installed the Microchip software, <filename arg1 arg2 ...>is the name, including a relative or full path, of the Tcl script file and arguments you are passing to the script file, and output.log is the name of the log file.

For example,

C:\libero\designer\bin\designer "SCRIPT:myscript.tcl one two three" "LOGILE:output.log"