PREV UP NEXT

# XSCHEM SCRIPTS

Xschem is a tcl interpreter and as such TCL scripts and commands can be executed. Xschem adds its own extension commands, mostly with the `xschem` TCL command. See this manual page. The same procedure as tcl is used to load and execute a script:

         source /path/to/script.tcl

there are various ways to run a script in xschem:

1. On the xschem command prompt:

       source myscript.tcl

2. In the `xschemrc` you may set the `tcl_files` tcl variable with a list of files to read in and execute after xschem is started:

       set tcl_files {/path/to/file1.tcl  /path/to/file2.tcl}

3. the `postinit_commands` variable in `xschemrc` can be filled with tcl code , it is executed when starting xschem:

       set postinit_commands {
         puts hello
         puts world
       }

4. On the unix shell command line with `--tcl` (this code is executed after reading `xschemrc`, this is usually done to override `xschemrc` settings:

       xschem --tcl 'set intuitive_interface 0'

5. On the unix shell command line with `--preinit`. Same as `--tcl`, but the commands are executed at the very beginning of xschem startup, before reading `xschemrc`. Usually done to change some internal variables for testing

       xschem --preinit 'some_weird_tcl_code'

6. On the unix shell command line with `--command`. The specified tcl code is executed after complete startup so all extended `xschem` commands are available:

       xschem solar_panel.sch --command 'xschem netlist; simulate'  #there are other ways to do this, just an example

7. On the unix shell command line with `--script`. Specify a file to source, it will be executed after complete startup.

       xschem --script myscript.tcl