| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <html> |
| <head> |
|
|
| |
| <meta name="Description" content="KLayout layout viewer and editor project page" /> |
| <meta name="Keywords" content="KLayout OASIS GDS2 viewer editor layout semiconductor mask chip design" /> |
| <meta name="abstract" content="KLayout is a free layout viewer and editor for several formats commonly used in the semiconductor industry to transfer layout data" /> |
| <meta name="URL" content="https://www.klayout.de/" /> |
| <meta name="Author" content="Matthias Koefferlein" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|
|
| <title>KLayout Layout Viewer And Editor</title> |
|
|
| |
| <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.klayout.de/news.xml"/> |
| <link rel="stylesheet" type="text/css" href="https://www.klayout.de/format.css?v2.0"/> |
| <link rel="shortcut icon" href="https://www.klayout.de/favicon.ico"/> |
|
|
| |
| <link rel="stylesheet" type="text/css" href="https://www.klayout.de/fonts.css"/> |
|
|
| |
| <script src="https://www.klayout.de/jquery-3.4.1.min.js"></script> |
|
|
| |
| <link href="https://www.klayout.de/bootstrap-4.3.1-dist/css/bootstrap.min.css" rel="stylesheet"> |
| <script src="https://www.klayout.de/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script> |
|
|
| |
|
|
| </head> |
|
|
| <body> |
|
|
| <div class="klayout-header"> |
|
|
| <div class="container mb-5"> |
|
|
| <nav class="navbar navbar-dark navbar-expand-lg"> |
|
|
| <a class="navbar-brand" href="https://www.klayout.de"><img src="https://www.klayout.de/klayout.png" srcset="https://www.klayout.de/klayout-x2.png 2x" alt="KLayout"></a> |
|
|
| <div class="collapse navbar-collapse" id="navbarToggleExternalContent"> |
|
|
| <ul class="navbar-nav ml-auto mr-auto"> |
|
|
| <li class="nav-item dropdown active mr-4"> |
| <a class="nav-link dropdown-toggle klayout-menu" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| About |
| </a> |
| <div class="dropdown-menu" aria-labelledby="navbarDropdown"> |
| <a class="dropdown-item" href="https://www.klayout.de/intro.html">KLayout Project</a> |
| <a class="dropdown-item" href="https://www.klayout.de/doc.html">Documentation</a> |
| <a class="dropdown-item" href="https://www.klayout.de/galleries.html">Galleries</a> |
| <a class="dropdown-item" href="https://www.klayout.de/credits.html">Credits</a> |
| <div class="dropdown-divider"></div> |
| <a class="dropdown-item" href="https://www.klayout.de/contact.html">Contact</a> |
| <a class="dropdown-item" href="https://www.klayout.de/impressum.html">Impressum / Imprint</a> |
| <a class="dropdown-item" href="https://www.klayout.de/privacy_policy.html">Datenschutz / Privacy Policy</a> |
| </div> |
| </li> |
| <li class="nav-item active mr-4"> |
| <a class="nav-link klayout-menu" href="https://www.klayout.de/build.html">Get KLayout</a> |
| </li> |
| <li class="nav-item active mr-4"> |
| <a class="nav-link klayout-menu" href="https://sami.klayout.org">Package Index</a> |
| </li> |
| <li class="nav-item active mr-5"> |
| <a class="nav-link klayout-menu" href="https://www.klayout.de/forum">Forum</a> |
| </li> |
| <li class="nav-item active"> |
| <span class="nav-link klayout-menu"> |
| <a href="https://f-si.org"><img src="https://www.klayout.de/f-si_logo_32h_w.png" border="0" title="Free Silicon Foundation" alt="F-Si"/></a> |
| <a class="ml-4" href="https://github.com/KLayout"><img src="https://www.klayout.de/GitHub-Mark-32px-white.png" border="0" title="KLayout on GitHub" alt="GitHub"/></a> |
| </span> |
| </li> |
|
|
| </ul> |
|
|
| </div> |
|
|
| |
| <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation"> |
| <span class="navbar-toggler-icon"></span> |
| </button> |
|
|
| </nav> |
|
|
| </div> |
|
|
| </div> |
|
|
| <div class="container"> |
| <h1>Command-Line Arguments of KLayout</h1> |
|
|
| <p> |
| KLayout's command line basically looks like this: |
| </p> |
|
|
| <pre> |
| klayout [<options>] [<file>] .. |
| </pre> |
|
|
| <p> |
| Options start with a hyphen ("-") and can be mixed with file names. Files given on the command line without an option are |
| treated as layout files (GDS, OASIS, ...). Each option must be specified separately, i.e. "-ne" is <em>not</em> option "n" and "e". |
| Option arguments must be separated by a space from the option itself. For example: |
| </p> |
|
|
| <pre> |
| klayout -s file1.gds file2.gds -l layers.lyp |
| </pre> |
|
|
| <p> |
| This command will open "file1.gds" and "file2.gds" in the same view (option "-s") and use the layer properties file "layers.lyp". |
| </p> |
|
|
| <p> |
| The following is a description of KLayout's command-line options. |
| </p> |
|
|
| <h2>General Options</h2> |
| <table width="90%"> |
| <tr> |
| <td width="20%"><tt>-b</tt></td> |
| <td>Batch mode (same as <tt>-zz -nc -rx</tt>). |
| </td> |
| </tr> |
| <tr> |
| <td><tt>-c</tt> <config file></td> |
| <td>Use the specified configuration file (reading it on start and writing it on exit) instead of the default configuration file. |
| This option allows to switch between different configurations.</td> |
| </tr> |
| <tr> |
| <td><tt>-nc</tt></td> |
| <td>Don't use a configuration file (implies <tt>-t</tt>). |
| </td> |
| </tr> |
| <tr> |
| <td><tt>-d</tt> <debug level></td> |
| <td>Controls the verbosity of the log output. Values are: 0 (silent), 10 (basic info), 11 (basic info plus basic timing), 20 (detailed info), 21 (detailed info plus detailed timing) to |
| 40 or 41 for noisy log output and timing respectively. |
| </td> |
| </tr> |
| <tr> |
| <td><tt>-e</tt></td> |
| <td>Enter edit mode even if non-edit mode was specified in the configuration as default mode.</td> |
| </tr> |
| <tr> |
| <td><tt>-ne</tt></td> |
| <td>Enter viewer mode even if edit mode was specified in the configuration as default mode. If neither <tt>-e</tt> or <tt>-ne</tt> is specified, the default mode from the configuration will be used.</td> |
| </tr> |
| <tr> |
| <td><tt>-i</tt></td> |
| <td>Disable undo buffering (less memory requirements).</td> |
| </tr> |
| <tr> |
| <td><tt>-ni</tt></td> |
| <td>Enable undo buffering. This is the default. This option overrides previously set "<tt>-i</tt>" options.</td> |
| </tr> |
| <tr> |
| <td><tt>-j</tt> <path></td> |
| <td>Add the given path to the macro project paths.</td> |
| </tr> |
| <tr> |
| <td><tt>-l</tt> <lyp file></td> |
| <td>Use the specified layer properties file instead of the default layer properties.</td> |
| </tr> |
| <tr> |
| <td><tt>-lx</tt></td> |
| <td>Used with "<tt>-l</tt>": add other layers to the layer properties even if they are not defined in the properties file.</td> |
| </tr> |
| <tr> |
| <td><tt>-lf</tt></td> |
| <td>Used with "<tt>-l</tt>": use the ".lyp" file as it is (no expansion to multiple layouts).</td> |
| </tr> |
| <tr> |
| <td><tt>-m</tt> <database file></td> |
| <td>Load the given report database together with the previously defined layout. This option must <em>follow</em> a layout file argument.</td> |
| </tr> |
| <tr> |
| <td><tt>-mn</tt> <database file></td> |
| <td>Load the given L2N oder LVS database together with the previously defined layout. This option must <em>follow</em> a layout file argument.</td> |
| </tr> |
| <tr> |
| <td><tt>-n</tt> <technology></td> |
| <td>Technology to use for <em>next</em> layout(s) on command line.</td> |
| </tr> |
| <tr> |
| <td><tt>-nn</tt> <tech file></td> |
| <td>Technology file (".lyt") to use for next layout(s) on command line.</td> |
| </tr> |
| <tr> |
| <td><tt>-p</tt> <plugin></td> |
| <td>Load the plugin (a shared object). This option can be used multiple times.</td> |
| </tr> |
| <tr> |
| <td><tt>-r</tt> <script></td> |
| <td>Run the given script in interpreter mode. The script file can be either a raw Ruby or Python script, a generic ".lym" script or |
| a domain specific language script such as a DRC script (.drc).<br/> |
| In "-r" mode, KLayout will exit after the script is executed. |
| To start the KLayout application, the script must contain a "Application.exec" method call. The script is executed after all |
| other requisites from the command line have been loaded (files, plugins etc.)<br/> |
| This option can be combined with "<tt>-z</tt>" (no GUI) or "<tt>-zz</tt>" (no GUI at all). |
| That way, KLayout is converted into a Ruby or Python interpreter.</td> |
| </tr> |
| <tr> |
| <td><tt>-rr</tt> <script></td> |
| <td>Like "-r", but does not exit after executing the script.</td> |
| </tr> |
| <tr> |
| <td><tt>-rm</tt> <script></td> |
| <td>Run the given script before KLayout starts the user interface. In contrast to "<tt>-r</tt>", KLayout continues |
| normal execution after the script is executed successfully. This is the preferred way to install user interface |
| add-ons ("Modules"). In addition to the modules specified by "<tt>-rm</tt>", KLayout collects script files |
| from various places, i.e. the place specified with <tt>$KLAYOUTPATH</tt> or the installation folder.</td> |
| </tr> |
| <tr> |
| <td><tt>-rd</tt> <name>=<value></td> |
| <td>Define the variable in the Ruby or Python context with the given string value. In Ruby, the variable will be accessible as "<tt>$name</tt>". |
| </td> |
| </tr> |
| <tr> |
| <td><tt>-rx</tt></td> |
| <td>Ignore all implicit macros ("*.rbm", "rbainit", "*.lym"). This is a "safe" or "fast" mode since errors in those script cannot spoil the |
| application and starting will be faster.</td> |
| </tr> |
| <tr> |
| <td><tt>-s</tt></td> |
| <td>Load files into same view.</td> |
| </tr> |
| <tr> |
| <td><tt>-t</tt></td> |
| <td>Don't update the configuration file on exit (amnesia mode).</td> |
| </tr> |
| <tr> |
| <td><tt>-nt</tt></td> |
| <td>Update the configuration file on exit (default, overrides previous <tt>-t</tt> option).</td> |
| </tr> |
| <tr> |
| <td><tt>-u</tt> <file name></td> |
| <td>Restore the session from the given session file.</td> |
| </tr> |
| <tr> |
| <td><tt>-v</tt></td> |
| <td>Print program version and exit.</td> |
| </tr> |
| <tr> |
| <td><tt>-wd</tt> <name>=<value></td> |
| <td>Define a variable for use within expressions. |
| </td> |
| </tr> |
| <tr> |
| <td><tt>-x</tt></td> |
| <td>Synchronous drawing mode (non-threaded). This mode can be useful if scripts are run which produce screen snapshots. By using |
| this option is made sure that all drawing operations have finished before the snapshot method returns.</td> |
| </tr> |
| <tr> |
| <td><tt>-y</tt> <package></td> |
| <td>Automatic package installation mode. If used, will install the requested package and exit. |
| Can be used more than once. 'package' is a name or an URL and optionally a version in round |
| brackets. Plain '-y' will only install the given package. Use '-yd' to automatically |
| include dependencies in the installation.</td> |
| </tr> |
| <tr> |
| <td><tt>-yd</tt></td> |
| <td>Used together with '-y': automatically include dependencies in the installation.</td> |
| </tr> |
| <tr> |
| <td><tt>-z</tt></td> |
| <td>Non-GUI mode. KLayout will not bring up the user interface. See the "<tt>-r"</tt> option for useful applications of this option. |
| Please note that on Linux, this mode still requires a display connection.</td> |
| </tr> |
| <tr> |
| <td><tt>-zz</tt></td> |
| <td>Non-GUI mode. In that mode, the GUI is disabled completely. On Linux, this mode allows to |
| use KLayout as a script interpreter for Ruby scripts without a display connection. However, |
| some Ruby objects are not available (i.e. MainWindow). |
| </td> |
| </tr> |
| </table> |
|
|
| <h2>Special Options</h2> |
| <table width="90%"> |
| <tr> |
| <td width="20%"><tt>-gr</tt> <file name></td> |
| <td>Record GUI actions in the given file for test purposes.</td> |
| </tr> |
| <tr> |
| <td><tt>-gp</tt> <file name></td> |
| <td>Replay the GUI actions from the given file for test purposes.</td> |
| </tr> |
| <tr> |
| <td><tt>-gb</tt> <line number></td> |
| <td>Stop replaying GUI actions at the given line for test purposes.</td> |
| </tr> |
| <tr> |
| <td><tt>-gx</tt> <milliseconds></td> |
| <td>Replay rate for GUI test file for test purposes.</td> |
| </tr> |
| <tr> |
| <td><tt>-gi</tt></td> |
| <td>Incremental logs on the GUI record file (crash safe logging).</td> |
| </tr> |
| <tr> |
| <td><tt>-y</tt> <package name></td> |
| <td>Package installation: install package(s) and exit - can be used more than once |
| ('package' is a name, an URL and optionally a version in round brackets)</td> |
| </tr> |
| <tr> |
| <td><tt>-yd</tt></td> |
| <td>With -y: include dependencies.</td> |
| </tr> |
| </table> |
|
|
| <h2>Environment variables</h2> |
|
|
| <p> |
| KLayout reads the following environment variables: |
| </p> |
|
|
| <ul> |
| <li> |
| <tt>$KLAYOUT_PATH</tt>: contains a series of search locations separated by a ":" on Linux or ";" on Windows. |
| These are the locations searched for macros, libraries, plugins, ruby modules etc. |
| The first entry of that path will be the one where the configuration is stored when KLayout exits. |
| The installation site (where the KLayout executable resides) is always part of the search path. It cannot be disabled. |
| </li> |
| <li> |
| <tt>$KLAYOUT_HOME</tt>: This is the place where KLayout keeps the configuration files, local macros and |
| technology files. By default, this place is "~/.klayout" on Linux and "%HOME%/KLayout" on Windows. |
| </li> |
| <li> |
| <tt>$KLAYOUT_SALT_MINE</tt>: Contains the URL the package manager ("Salt Mine") will pull the package list from. |
| By default, the global package index is used. This environment variable can be used to provide a local package |
| index. |
| </li> |
| <li> |
| <tt>$KLAYOUT_PYTHONPATH</tt>: Used by the Python interpreter instead of "PYTHONHOME". This path can be used |
| to establish a Python search path. |
| </li> |
| </ul> |
|
|
|
|
| </div> |
| </body> |
| </html> |
|
|
|
|