File size: 14,477 Bytes
703f5e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

  <!-- Meta -->
  <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>

  <!-- General -->
  <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"/>

  <!-- Fonts -->
  <link rel="stylesheet" type="text/css" href="https://www.klayout.de/fonts.css"/>

  <!-- jQuery -->
  <script src="https://www.klayout.de/jquery-3.4.1.min.js"></script>

  <!-- bootstrap -->
  <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>

      <!-- collapse button -->
      <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 [&lt;options&gt;] [&lt;file&gt;] ..
</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> &lt;config&nbsp;file&gt;</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> &lt;debug&nbsp;level&gt;</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> &lt;path&gt;</td>
    <td>Add the given path to the macro project paths.</td>
  </tr>
  <tr>
    <td><tt>-l</tt> &lt;lyp&nbsp;file&gt;</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> &lt;database&nbsp;file&gt;</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> &lt;database&nbsp;file&gt;</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> &lt;technology&gt;</td>
    <td>Technology to use for <em>next</em> layout(s) on command line.</td>
  </tr>
  <tr>
    <td><tt>-nn</tt> &lt;tech file&gt;</td>
    <td>Technology file (".lyt") to use for next layout(s) on command line.</td>
  </tr>
  <tr>
    <td><tt>-p</tt> &lt;plugin&gt;</td>
    <td>Load the plugin (a shared object). This option can be used multiple times.</td>
  </tr>
  <tr>
    <td><tt>-r</tt> &lt;script&gt;</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> &lt;script&gt;</td>
    <td>Like "-r", but does not exit after executing the script.</td>
  </tr>
  <tr>
    <td><tt>-rm</tt> &lt;script&gt;</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> &lt;name&gt;=&lt;value&gt;</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> &lt;file&nbsp;name&gt;</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> &lt;name&gt;=&lt;value&gt;</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> &lt;package&gt;</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> &lt;file&nbsp;name&gt;</td>
    <td>Record GUI actions in the given file for test purposes.</td>
  </tr>
  <tr>
    <td><tt>-gp</tt> &lt;file&nbsp;name&gt;</td>
    <td>Replay the GUI actions from the given file for test purposes.</td>
  </tr>
  <tr>
    <td><tt>-gb</tt> &lt;line&nbsp;number&gt;</td>
    <td>Stop replaying GUI actions at the given line for test purposes.</td>
  </tr>
  <tr>
    <td><tt>-gx</tt> &lt;milliseconds&gt;</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> &lt;package&nbsp;name&gt;</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>