next up previous contents index
Next: Script Menus: User-Defined Sub-Menus Up: xicmanual Previous: The Jobs page   Contents   Index

The User Menu: User Commands and Xic Scripts

The User Menu contains built-in commands listed in the table below.

User Menu
Label Name Pop-up Function
Debugger debug Script Debugger Debug scripts
Rehash hash none Rebuild User Menu
others -- -- User scripts and menus

Other buttons which appear in the User Menu execute user-generated scripts, or pop up menus of user-generated scripts. Xic provides a powerful native language, from which the user can automate various tasks. The User Menu is the primary means to execute scripts, though the !exec command provides a non-graphical alternative.

The default system-wide location for scripts is in the directory
/usr/local/xictools/xic/scripts, however this can be reset with the XIC_SCR_PATH environment variable, or defined in the technology file with the ScriptPath keyword. The syntax is the same as for other Xic search paths, for example:

ScriptPath ( directory directory1... )

This path can also be set with the ScriptPath variable using the !set command. A script path set with the ScriptPath variable takes precedence over a script path defined in the environment using the XIC_SCR_PATH environment variable. If no script path is specified in the technology file, the effective path used will consist of the single default directory.

Each directory in the search path is expected to contain script files, which must have an extension ``.scr'', function libraries which are named ``library'', and script menu files, which will produce a drop-down sub-menu in the User Menu. Xic provides a library capability which allows code to be shared between scripts. Script menu files must have an extension ``.scm''. In addition, auxiliary files such a images, data, or documentation files may also be present, for use in certain scripts. These will be ignored when searching for scripts.

The default button label in the User Menu for a script found in the search path is the base name of the script file, i.e., the file name with the .scr stripped off. However, if the first non-blank line of the script file is of the form

#menulabel label

then the User Menu button will use the text in label. If the label text contains white space, it must be quoted. This text can contain punctuation, though some characters may be stripped or replaced internally. The label text must be unique in the top level of the User Menu, duplicate entries will not be added.

Scripts can also be included in the technology file itself. These scripts will also appear as buttons in the User Menu, as with other scripts. This can be useful for including simple technology-specific commands, such as those that create special extraction layers. However, scripts defined in the technology file can not be loaded into the debugger.

The !script command is yet another means by which scripts can be placed into the User Menu. This command associates a label, which will appear on the menu button, with an arbitrary path to a script file. Commands registered in this way can also be removed with the !script command.

Each command button label in the User Menu is unique in the menu or sub-menu where it resides. If a duplicate label is found during the search along the search path, that script will not be added to the menu, and the existing entry will be retained. However, scripts added from the technology file and with the !script command are stored somewhat differently, so label text clashes can occur. The following priority is observed in this case.

  1. Scripts defined with the !script command.
  2. Scripts found in the script search path and menus.
  3. Scripts found in the technology file.

An encryption capability for scripts is provided. This allows the content of scripts to be hidden from users.

next up previous contents index
Next: Script Menus: User-Defined Sub-Menus Up: xicmanual Previous: The Jobs page   Contents   Index
Stephen R. Whiteley 2017-03-22