1MAGIC(1)                    General Commands Manual                   MAGIC(1)
2
3
4

NAME

6       magic - VLSI layout editor
7

SYNOPSIS

9       magic  [  -T   technology ] [ -d  device_type ] [ -g  graphics_port ] [
10       -m  monitor_type ] [ -D ] [ file ]
11
12

DESCRIPTION

14       Magic is an interactive editor for VLSI layouts  that  runs  under  all
15       variants  of  UNIX,  including Mac OS-X and Cygwin.  This man page is a
16       reference manual;  if you are a first-time user,  you  should  use  the
17       Magic  tutorials  to  get  acquainted  with  the system (see the online
18       resources links below).
19
20       Magic uses two windows: one for text and a separate window for display‐
21       ing  layouts.  Magic runs under the window system X11 (use under Cygwin
22       requires the presence of an X11 server in  Windows;   the  server  that
23       comes  packaged  with Cygwin works well).  The command line switch "-d"
24       can be used to tell Magic  which  kind  of  display  you  are  running.
25       Specifically,  this  is  useful  to  tell  magic to use OpenGL graphics
26       instead of plain X11 ("-d OGL"),  or  to  use  24  bit  plane  graphics
27       instead  of 8 bit planes ("-d 24BITS") if both are available on a video
28       card with overlay support.
29
30       Here are the options accepted by Magic:
31
32       -T     The next argument is the name of a technology.  The tile  types,
33              display  information,  and  design rules for this technology are
34              read by Magic from a technology file when  it  starts  up.   The
35              technology defaults to ``scmos''.
36
37       -d     The next argument is the type of workstation or graphics display
38              being used.  Magic supports these types:
39
40              NULL   A null device for running Magic without using a  graphics
41                     display, such as a batch job.  Note that the special case
42                     "-dnull" (lowercase, no space)  has  a  more  streamlined
43                     startup specifically for batch processing.
44
45              X11    X-windows,  version  11.  The is the preferred interface.
46                     Magic acts as a client to the X window server and  inter‐
47                     faces  to  all  graphics  terminals  supported  by  the X
48                     server.
49
50              OGL    OpenGL graphics running under X11.  This is the preferred
51                     interface   on  systems  having  hardware-accelerated  3D
52                     graphics video cards and drivers.
53
54                     Addition information on  Magic's  X11  driver,  including
55                     options  for  .Xdefaults  files,  may be found in ``Magic
56                     Maintainer's Manual #4:  Using Magic Under X Windows''.
57
58              XWIND  Simply another name for the X11 driver.
59       If no device is specified, Magic tries to guess which driver is  appro‐
60       priate  (by  checking the environment variables and by poking around in
61       /dev).
62
63       When   Magic   starts   up   it   looks   for   a   command   file   in
64       ${CAD_ROOT}/magic/sys/.magicrc  and  processes  it  if it exists.  Then
65       Magic looks for a file with the name ``.magicrc'' in the home directory
66       and  processes  it  if  it exists.  Finally, Magic looks for a .magicrc
67       file in the current directory and reads it as  a  command  file  if  it
68       exists.   The  .magicrc  file format is described under the source com‐
69       mand.  If magic is compiled with Tcl/Tk  support,  then  any  magic  or
70       Tcl/Tk  commands may be used inside the startup file.  The startup file
71       name was changed to ".magicrc" to avoid conflicts with a common  system
72       file named ".magic".  However, the name ".magic" will be searched after
73       ".magicrc" for backward compatibility.
74
75

COMMANDS -- GENERAL INFORMATION

77       Magics uses types of commands:  Key  macros  and  long  commands.   The
78       first  form  consists  of  single-key  (or button) abbreviations called
79       ``macros''; macros are invoked by pressing a single key or  mouse  but‐
80       ton.     Certain    macros    are    predefined   in   the   systemwide
81       ${CAD_ROOT}/magic/sys/.magicrc file, but you can override them and  add
82       your own macros using the macro command (described below under COMMANDS
83       FOR ALL WINDOWS).  The special macro "." is reserved to  mean  "execute
84       the last typed long command".
85
86       You  can  enter  long  commands  in the terminal console at the console
87       prompt, or from the layout window by typing a : or ; key, which are the
88       two other reserved macros meaning "switch keyboard focus to the console
89       window".  After typing the : or ; key, type the text  of  the  command,
90       which will be written to the terminal window.  Multiple commands may be
91       specified on one line by separating them with semicolons.
92
93
94       Most commands deal with the window underneath the cursor, so if a  com‐
95       mand  doesn't do what you expect make sure that you are pointing to the
96       correct place on the screen.  There are several different kinds of win‐
97       dows in Magic (layout, color, and netlist); each window has a different
98       command set, described in a separate section below.
99
100

MOUSE BUTTONS FOR LAYOUT WINDOWS

102       Magic uses a three button mouse.  The buttons are interpreted in a  way
103       that depends on the current tool, as indicated by the shape of the cur‐
104       sor (see the tool command).  The various  tools  are  described  below.
105       The  initial  tool is box.  These interpretations apply only when mouse
106       buttons are pressed in the interior of a layout window.
107
108       Box Tool
109              This is the default tool, and is indicated by a  crosshair  cur‐
110              sor.  It is used to position the box and to paint and erase:
111
112              left   This  button  is  used to move the box by one of its cor‐
113                     ners.  Normally, this button picks  up  the  box  by  its
114                     lower-left  corner.   To  pick  the box up by a different
115                     corner, click the right button while the left  button  is
116                     down.   This  switches  the  pick-up  point to the corner
117                     nearest the cursor.  When the button is released, the box
118                     is  moved  to position the corner at the cursor location.
119                     If the box has been set to snap to the window's grid (see
120                     the  :snap  command), then the box corner is left aligned
121                     with the grid that the user has  chosen  for  the  window
122                     with the :grid command, even if that grid is not visible.
123
124              right  Change  the  size  of the box by moving one corner.  Nor‐
125                     mally this button moves the  upper-right  corner  of  the
126                     box.   To  move a different corner, click the left button
127                     while the right button is down.  This switches the corner
128                     to the one nearest the cursor.  When you release the but‐
129                     ton, three corners of the box move in order to place  the
130                     selected  corner at the cursor location (the corner oppo‐
131                     site the one you picked up remains fixed).   Snapping  to
132                     the window's grid is handled as for the left button.
133
134              middle (bottom)
135                     Used  to paint or erase.  If the crosshair is over paint,
136                     then the area of the box is  painted  with  the  layer(s)
137                     underneath the crosshair.  If the crosshair is over white
138                     space, then the area of the box is erased.
139
140       Wiring Tool
141              The wiring tool, indicated by an arrow cursor, is used  to  pro‐
142              vide an efficient interface to the wiring commands:
143
144              left   Same as the long command wire type.
145
146              right  Same as the long command wire leg.
147
148              middle (bottom)
149                     Same as the long command wire switch.
150
151       Netlist Tool
152              This  tool  is used to edit netlists interactively.  It is indi‐
153              cated by a thick box cursor.
154
155              left   Select the net associated with the terminal  nearest  the
156                     cursor.
157
158              right  Find  the terminal nearest the cursor, and toggle it into
159                     the current net (if it wasn't already in the current net)
160                     or  out  of  the current net (if it was previously in the
161                     net).
162
163              middle (bottom)
164                     Find the terminal nearest the cursor, and  join  its  net
165                     with the current net.
166
167       Rsim Tool
168              Used  when  running the IRSIM simulator under Magic.  A pointing
169              hand is used as the cursor.
170
171              left   Moves the box just like the box tool.
172
173              right  Moves the box just like the box tool.
174
175              middle (bottom)
176                     Displays the Rsim node values of the selected paint.
177

LONG COMMANDS FOR LAYOUT WINDOWS

179       These commands work if you are pointing to the  interior  of  a  layout
180       window.   Commands  are invoked by typing a colon (``:'') or semi-colon
181       (``;''), followed by a line containing a command name and zero or  more
182       parameters.   In  addition,  macros may be used to invoke commands with
183       single keystrokes.  Useful default macros are set in the global  .magi‐
184       crc file (in ${CAD_ROOT}/magic/sys, normally /usr/local/lib/magic/sys).
185       You can list all current macros with the macro command, described under
186       ``LONG COMMANDS FOR ALL WINDOWS''.  Unique abbreviations are acceptable
187       for all keywords in commands.  The commands are:
188
189       addpath searchpath
190              Add more directories to the end of  Magic's  cell  search  path.
191              See the documentation for the path command for an explanation of
192              the search path.
193
194       array xsize ysize
195              Make  many  copies  of  the  selection.   There  will  be  xsize
196              instances in the x-direction and ysize instances in the y-direc‐
197              tion.  Paint and labels are arrayed by copying  them.   Subcells
198              are  not  copied,  but  instead  each instance is turned into an
199              array instance with elements numbered from 0 to xsize-1  in  the
200              x-direction,  and  from  0  to  ysize-1 in the y-direction.  The
201              spacing between elements of the array is determined by  the  box
202              x- and y-dimensions.
203
204       array xlo ylo xhi yhi
205              Identical  to  the form of array above, except that the elements
206              of arrayed cells are numbered left-to-right from xlo to xhi  and
207              bottom-to-top  from  ylo  to  yhi.   It  is  legal for xlo to be
208              greater than xhi, and also for ylo to be greater than yhi.
209
210       box [args]
211              Used to change the size of the box or  to  find  out  its  size.
212              There  are  several sorts of arguments that may be given to this
213              command:
214
215              (No arguments.)
216                     Show the box size and its location in the edit  cell,  or
217                     root  cell  of  its window if the edit cell isn't in that
218                     window.
219
220              direction [distance]
221                     Move the box distance units in direction,  which  may  be
222                     one  of  left,  right, up, or down.  Distance defaults to
223                     the width of the box if direction is right or  left,  and
224                     to the height of the box if direction is up or down.
225
226              width [size]
227
228              height [size]
229                     Set the box to the width or height indicated.  If size is
230                     not specified the width or height is reported.
231
232              x1 y1 x2 y2
233                     Move the box to the coordinates specified (these  are  in
234                     edit  cell  coordinates if the edit cell is in the window
235                     under the cursor;  otherwise these are in the root  coor‐
236                     dinates  of the window). x1 and y1 are the coordinates of
237                     the lower left corner of the box, while x2 and y2 are the
238                     upper  right  corner.   The coordinates must all be inte‐
239                     gers.
240
241       calma [option] [args]
242              This command is used to read and write files  in  Calma  GDS  II
243              Stream  format  (version  3.0,  corresponding  to GDS II Release
244              5.1).  This format is like CIF, in that  it  describes  physical
245              mask  layers  instead  of Magic layers.  In fact, the technology
246              file specifies a correspondence between CIF  and  Calma  layers.
247              The current CIF output style (see cif ostyle) controls how Calma
248              stream layers are generated from Magic layers.  If no  arguments
249              are  given,  the calma command generates a Calma stream file for
250              the layout in the window beneath the cursor in file.strm,  where
251              file  is  the name of the root cell.  This stream file describes
252              the entire cell hierarchy  in  the  window.   The  name  of  the
253              library  is  the  same as the name of the root cell.  Option and
254              args may be used to invoke one of several additional operations:
255
256              calma flatten
257                     Ordinarily, Magic arrays are output using the Calma ARRAY
258                     construct.  After a calma flatten command, though, arrays
259                     will be output instead as a collection of individual cell
260                     uses, as occurs when writing CIF.
261
262              calma help
263                     Print  a  short  synopsis  of  all  of  the calma command
264                     options.
265
266              calma labels
267                     Output labels whenever writing a Calma output file.
268
269              calma lower
270                     Allow both upper and lower case to be  output  for  label
271                     text.  This is the default behavior; calma nolower causes
272                     lower case to be converted to upper case on output.
273
274              calma noflatten
275                     Undoes the effect of a prior :calma flatten command,  re-
276                     enabling the output of Magic arrays using the Calma ARRAY
277                     construct.
278
279              calma nolabels
280                     Don't output labels when writing a Calma output file.
281
282              calma nolower
283                     Convert lower to upper case when outputting labels.
284
285              calma read file
286                     The file file.strm is read in Calma format and  converted
287                     to  a  collection  of Magic cells.  The current CIF input
288                     style determines how the Calma layers  are  converted  to
289                     Magic  layers.   The new cells are marked for design-rule
290                     checking.  Calma format doesn't identify the root of  the
291                     collection  of  cells  read in, so none of the cells read
292                     will appear on the display; use load to make  them  visi‐
293                     ble.   If the Calma file had been produced by Magic, then
294                     the name of the root cell is the same as the library name
295                     printed by the :calma read command.
296
297              calma write fileName
298                     Writes  a  stream  file  just as if no arguments had been
299                     entered, except that the output  is  written  into  file‐
300                     Name.strm  instead  of  using  the root cell name for the
301                     file name.
302
303       channels
304              This command will run just the channel decomposition part of the
305              Magic router, deriving channels for the area under the box.  The
306              channels will be displayed as outlined feedback areas  over  the
307              edit cell.
308
309       cif [option] [args]
310              Read  or  write files in Caltech Intermediate Form (CIF).  If no
311              arguments are given, this command generates a CIF file  for  the
312              window beneath the cursor in file.cif, where file is the name of
313              the root cell.  The CIF file describes the entire cell hierarchy
314              in  the  window.   Option  and args may be used to invoke one of
315              several additional CIF operations:
316
317              cif arealabels [yes | no]
318                     Enables/disables  the  cif  area-label   extension.    If
319                     enabled,  area  labels  are written via the 95 cif exten‐
320                     sion.  If disabled, labels are collapsed to  points  when
321                     writing  cif  and  the  94  cif construct is used.  Area-
322                     labels are  disabled  by  default  (many  programs  don't
323                     understand cif area-labels).
324
325              cif help
326                     Print a short synopsis of all of the cif command options.
327
328              cif istyle [style]
329                     Select  the  style to be used for CIF input.  If no style
330                     argument is provided, then Magic prints the names of  all
331                     CIF input styles defined in the technology file and iden‐
332                     tifies the current style.  If style is  provided,  it  is
333                     made the current style.
334
335              cif ostyle [style]
336                     Select  the style to be used for CIF output.  If no style
337                     argument is provided, then Magic prints the names of  all
338                     CIF  output  styles  defined  in  the technology file and
339                     identifies the current style.  If style is  provided,  it
340                     is made the current style.
341
342              cif read file
343                     The  file file.cif is read in CIF format and converted to
344                     a collection of Magic cells.   The  current  input  style
345                     determines how the CIF layers are converted to Magic lay‐
346                     ers.  The new cells are marked for design-rule  checking.
347                     Any  information in the top-level CIF cell is copied into
348                     the edit cell.  Note: this command is not  undo-able  (it
349                     would  waste  too much space and time to save information
350                     for undoing).
351
352              cif see layer
353                     In this command layer must be the CIF name for a layer in
354                     the  current  output  style.   Magic  will display on the
355                     screen all the CIF for that layer that  falls  under  the
356                     box,  using  stippled feedback areas.  It's a bad idea to
357                     look at  CIF  over  a  large  area,  since  this  command
358                     requires  the  area  under  the  box  to be flattened and
359                     therefore is slow.
360
361              cif statistics
362                     Prints out statistics gathered by the CIF generator as it
363                     operates.   This  is probably not useful to anyone except
364                     system maintainers.
365
366              cif write fileName
367                     Writes out CIF just as if no arguments had been  entered,
368                     except  that the CIF is written into fileName.cif instead
369                     of using the root cell name for the file name.  The  cur‐
370                     rent  output  style controls how CIF layers are generated
371                     from Magic layers.
372
373              cif flat fileName
374                     Writes out CIF as in the cif write command, but  flattens
375                     the  design  first (e.g. creates an internal version with
376                     the cell hierarchy  removed).   This  is  useful  if  one
377                     wishes  to  use  the  and-not  feature  of the CIF output
378                     styles, but is having problems with interactions of over‐
379                     lapping cells.
380
381       clockwise [degrees]
382              Rotate the selection by 90, 180 or 270 degrees.  After the rota‐
383              tion, the lower-left corner of the selection's bounding box will
384              be  in  the  same place as the lower-left corner of the bounding
385              box before the rotation.  Degrees defaults to 90.  If the box is
386              in  the  same  window as the selection, it is rotated too.  Only
387              material in the edit cell is affected.
388
389       copy [direction [amount]]
390
391       copy to x y
392              If no arguments are given, a copy of the selection is picking up
393              at  the  point  lying  underneath the box lower-left corner, and
394              placed so that this point  lies  at  the  cursor  position.   If
395              direction  is  given,  it  must  be  a Manhattan direction (e.g.
396              north, see the ``DIRECTIONS'' section below).  The copy  of  the
397              selection  is  moved in that direction by amount.  If the box is
398              in the same window as the selection, it is  moved  too.   Amount
399              defaults to 1.  The second form of the command behaves as though
400              the cursor were pointing to (x, y) in the edit cell; a  copy  of
401              the  selection  is picked up by the point beneath the lower-left
402              corner of the box and placed so that this point lies at (x, y).
403
404       corner direction1 direction2 [layers]
405              This command is similar to fill, except  that  it  generates  L-
406              shaped  wires that travel across the box first in direction1 and
407              then in direction2.  For example, corner north  east  finds  all
408              paint  under the bottom edge of the box and extends it up to the
409              top of the box and then across to the right  side  of  the  box,
410              generating  neat  corners at the top of the box.  The box should
411              be at least as tall as it is wide for this command to work  cor‐
412              rectly.   Direction1 and direction2 must be Manhattan directions
413              (see the section DIRECTIONS below) and  must  be  orthogonal  to
414              each  other.   If layers is specified then only those layers are
415              used;  otherwise all layers are considered.
416
417       delete Delete all the information in the current selection that  is  in
418              the edit cell.  When cells are deleted, only the selected use(s)
419              of the cell is (are) deleted:  other uses  of  the  cell  remain
420              intact,  as  does  the  disk file containing the cell.  Selected
421              material outside the edit cell is not deleted.
422
423       drc option [args]
424              This command is used to interact with the design  rule  checker.
425              Option  and args (if needed) are used to invoke a drc command in
426              one of the following ways:
427
428              drc catchup
429                     Let the checker process all the areas that need  recheck‐
430                     ing.   This  command  will  not  return until design-rule
431                     checking is complete  or  an  interrupt  is  typed.   The
432                     checker  will run even if the background checker has been
433                     disabled with drc off.
434
435              drc check
436                     Mark the area under the box for rechecking in  all  cells
437                     that  intersect the box.  The recheck will occur in back‐
438                     ground after the command completes.  This command is  not
439                     normally  necessary,  since Magic automatically remembers
440                     which areas need to be  rechecked.   It  should  only  be
441                     needed if the design rules are changed.
442
443              drc count
444                     Print  the  number  of errors in each cell under the box.
445                     Cells with no errors are skipped.
446
447              drc find [nth]
448                     Place the box over the nth error  area  in  the  selected
449                     cell  or  edit  cell, and print out information about the
450                     error just as if drc why had been typed.   If  nth  isn't
451                     given  (or is less than 1), the command moves to the next
452                     error area.  Successive invocations  of  drc  find  cycle
453                     through  all  the  error  tiles in the cell.  If multiple
454                     cells are selected, this command uses the  upper-leftmost
455                     one.   If  no  cells  are selected, this command uses the
456                     edit cell.
457
458              drc help
459                     Print a short synopsis of all the drc command options.
460
461              drc off
462                     Turn off the background checker.  From now on, Magic will
463                     not  recheck  design rules immediately after each command
464                     (but it will record the areas that need to be  rechecked;
465                     the command drc on can be used to restart the checker).
466
467              drc on Turn  on  the background checker.  The checker will check
468                     whatever modifications have  not  already  been  checked.
469                     From  now on, the checker will reverify modified areas as
470                     they result from commands.  The checker  is  run  in  the
471                     background,  not  synchronously  with commands, so it may
472                     get temporarily behind if massive changes are made.
473
474              drc printrules [file]
475                     Print out the compiled rule set in file, or on  the  text
476                     terminal  if  file  isn't  given.  For system maintenance
477                     only.
478
479              drc rulestats
480                     Print out summary statistics about the compiled rule set.
481                     This is primarily for use in writing technology files.
482
483              drc statistics
484                     Print  out  statistics  kept  by the design-rule checker.
485                     For each statistic, two values are  printed:   the  count
486                     since  the  last time drc statistics was invoked, and the
487                     total count in this editing  session.   This  command  is
488                     intended primarily for system maintenance purposes.
489
490              drc why
491                     Recheck  the  area  underneath  the box and print out the
492                     reason for each  violation  found.   Since  this  command
493                     causes  a  recheck,  the  box  should  normally be placed
494                     around a small area (such as an error area).
495
496       dump cellName [child refPointC] [parent refPointP]
497              Copy the contents of cell cellName into the edit  cell  so  that
498              refPointC  in  the child is positioned at point refPointP in the
499              edit cell.  The reference points can either be  the  name  of  a
500              label, in which case the lower-left corner of the label's box is
501              used as the reference point, or as a pair of numbers giving  the
502              (x, y)  coordinates  of a point explicitly.  If refPointC is not
503              specified, the lower-left corner of cellName cell is  used.   If
504              refPointP  is  not  specified,  the lower-left corner of the box
505              tool is used (the box must be in a window  on  the  edit  cell).
506              After this command completes, the new information is selected.
507
508       edit   Make  the  selected  cell the edit cell, and edit it in context.
509              The edit cell is normally  displayed  in  brighter  colors  than
510              other  cells (see the see command to change this).  If more than
511              one cell is selected, or if the selected cell is an  array,  the
512              cursor  position is used to select one of those cells as the new
513              edit cell.  Generally, Magic commands modify  only  the  current
514              edit cell.
515
516       erase [layers]
517              For  the  area  enclosed  by the box, erase all paint in layers.
518              (See the ``LAYERS'' section for the syntax of layer lists).   If
519              layers  is omitted it defaults to *,labels.  See your technology
520              manual, or use the layers command, to find out about the  avail‐
521              able layer names.
522
523       expand [toggle]
524              If  the  keyword  toggle  is supplied, all of the selected cells
525              that are unexpanded are expanded, and all of the selected  cells
526              that  are  expanded  are unexpanded.  If toggle isn't specified,
527              then all of the cells underneath the  box  are  expanded  recur‐
528              sively until there is nothing but paint under the box.
529
530       extract option [args]
531              Extract  a layout, producing one or more hierarchical .ext files
532              that describe the electrical circuit implemented by the  layout.
533              The  current  extraction  style (see extract style below) deter‐
534              mines the parameters for parasitic resistance, capacitance, etc.
535              that  will  be  used.   The  extract  command with no parameters
536              checks timestamps and re-extracts as needed to  bring  all  .ext
537              files  up-to-date  for  the  cell  in  the  window  beneath  the
538              crosshair, and all cells beneath it.  Magic displays any  errors
539              encountered  during  circuit  extraction using stippled feedback
540              areas over the area of the error, along with a message  describ‐
541              ing  the type of error.  Option and args are used in the follow‐
542              ing ways:
543
544              extract all
545                     All cells in  the  window  beneath  the  cursor  are  re-
546                     extracted  regardless  of whether they have changed since
547                     last being extracted.
548
549              extract cell name
550                     Extract only the currently  selected  cell,  placing  the
551                     output  in  the  file  name.   If  more  than one cell is
552                     selected, this command uses the upper-leftmost one.
553
554              extract do [ option ]
555
556              extract no option
557                     Enable or  disable  various  options  governing  how  the
558                     extractor  will  work.  Use :extract do with no arguments
559                     to print a list of available options  and  their  current
560                     settings.  When the adjust option is enabled, the extrac‐
561                     tor will compute compensating capacitance and  resistance
562                     whenever  cells overlap or abut; if disabled, the extrac‐
563                     tor will not  compute  these  adjustments  but  will  run
564                     faster.   If capacitance is enabled, node capacitances to
565                     substrate (perimeter and area) are  computed;  otherwise,
566                     all node capacitances are set to zero.  Similarly, resis‐
567                     tance governs whether or not node  resistances  are  com‐
568                     puted.   The  coupling  option  controls whether coupling
569                     capacitances are  computed  or  not;  if  disabled,  flat
570                     extraction  is  significantly  faster  than  if  coupling
571                     capacitance computation is enabled.  Finally, the  length
572                     option  determines whether or not pathlengths in the root
573                     cell are computed (see extract length below).
574
575              extract help
576                     Prints a  short  synopsis  of  all  the  extract  command
577                     options.
578
579              extract length [ option args ]
580                     Provides  several options for controlling which point-to-
581                     point path lengths are extracted explicitly.  The extrac‐
582                     tor  maintains  two  internal  tables, one of drivers, or
583                     places where a signal is generated, and one of receivers,
584                     or places where a signal is sent.  The components of each
585                     table are hierarchical label names, defined by  means  of
586                     the  two commands extract length driver name1 [name2 ...]
587                     and  extract  length  receiver  name1  [name2  ...].   If
588                     extraction  of  pathlengths  is  enabled  (``:extract  do
589                     length''), then when the root cell in an extract  command
590                     is being extracted, the extractor will compute the short‐
591                     est  and  longest  path  between  each  driver  and  each
592                     receiver on the same electrical net, and output it to the
593                     .ext file for the root cell.  Normally, one should create
594                     a  file  of  these Magic commands for the circuit drivers
595                     and receivers of interest, and use source to read  it  in
596                     prior   to  circuit  extraction.   Extract  length  clear
597                     removes all the entries from both the driver and receiver
598                     tables.
599
600              extract parents
601                     Extract  the  currently selected cell and all of its par‐
602                     ents.  All of its parents must be  loaded  in  order  for
603                     this  to  work  correctly.   If  more  than  one  cell is
604                     selected, this command uses the upper-leftmost one.
605
606              extract showparents
607                     Like extract parents, but only print the cells that would
608                     be extracted; don't actually extract them.
609
610              extract style [style]
611                     Select  the  style  to be used for extraction parameters.
612                     If no style argument is provided, then Magic  prints  the
613                     names  of  all extraction parameter styles defined in the
614                     technology file and identifies  the  current  style.   If
615                     style is provided, it is made the current style.
616
617              extract unique [#]
618                     For  each cell in the window beneath the cursor, check to
619                     insure that no label is attached to more than  one  node.
620                     If  the  # keyword was not specified, whenever a label is
621                     attached to more than one node, the labels in all but one
622                     of the nodes are changed by appending a numeric suffix to
623                     make them unique.  If the # keyword  is  specified,  only
624                     names  that  end  in  a  ``#'' are made unique; any other
625                     duplicate nodenames  that  don't  end  in  a  ``!''   are
626                     reported  by  leaving a warning feedback area.  This com‐
627                     mand is provided for converting  old  designs  that  were
628                     intended for extraction with Mextra, which would automat‐
629                     ically append unique suffixes to  node  names  when  they
630                     appeared more than once.
631
632              extract warn [ [no] option | [no] all ]
633                     The  extractor always reports fatal errors.  This command
634                     controls the types of warnings that are reported.  Option
635                     may  be  one  of the following: dup, to warn about two or
636                     more unconnected nodes in the same  cell  that  have  the
637                     same  name,  fets,  to  warn about transistors with fewer
638                     than the minimum number of terminals, and labels, to warn
639                     when  nodes  are not labeled in the area of cell overlap.
640                     In addition, all may be used to refer  to  all  warnings.
641                     If  a warning is preceded by no, it is disabled.  To dis‐
642                     able all warnings, use ``extract warn no all''.   To  see
643                     which  warning  options  are  in  effect,  use  ``extract
644                     warn''.
645
646       extresist [cell [threshold] ]
647              Postprocessor for improving on the resistance  calculation  per‐
648              formed by the circuit extractor.  To use this command, you first
649              have to extract the design rooted at  cell  with  :extract cell,
650              and  then  flatten  the  design  using ext2sim(1), producing the
651              files cell.sim and cell.nodes.  Then run :extresist cell to pro‐
652              duce  a  file,  cell.res.ext, containing differences between the
653              network described by the .ext  files  produced  the  first  time
654              around,  and  a new network that incorporates explicit two-point
655              resistors where appropriate  (see  below).   This  file  may  be
656              appended  to cell.ext, and then ext2simrun for a second time, to
657              produce a new network with explicit  resistors.   The  threshold
658              parameter  is used to control which nodes are turned into resis‐
659              tor networks: any node whose total resistance exceeds  threshold
660              times  the smallest on-resistance of any transistor connected to
661              that node will be approximated as a resistor network.
662
663       feedback option [args]
664              Examine feedback information that is created by several  of  the
665              Magic  commands  to  report problems or highlight certain things
666              for users.  Option and args are used in the following ways:
667
668              feedback add text [style]
669                     Used to create a feedback area manually at  the  location
670                     of the box.  This is intended as a way for other programs
671                     like Crystal to highlight things on a layout.   They  can
672                     generate  a  command  file consisting of a feedback clear
673                     command, and a sequence of box and feedback add commands.
674                     Text  is associated with the feedback (it will be printed
675                     by feedback why and feedback find).  Style tells  how  to
676                     display  the feedback, and is one of dotted, medium, out‐
677                     line, pale, and solid (if unspecified, style defaults  to
678                     pale).
679
680              feedback clear
681                     Clears all existing feedback information from the screen.
682
683              feedback count
684                     Prints  out  a  count  of  the current number of feedback
685                     areas.
686
687              feedback find [nth]
688                     Used to locate a particular feedback  area.   If  nth  is
689                     specified,  the  box  is moved to the location of the nth
690                     feedback area.  If nth isn't specified, then the  box  is
691                     moved to the next sequential feedback area after the last
692                     one located with feedback find.   In  either  event,  the
693                     explanation associated with the feedback area is printed.
694
695              feedback help
696                     Prints  a  short  synopsis  of  all  the feedback command
697                     options.
698
699              feedback save file
700                     This option will  save  information  about  all  existing
701                     feedback  areas  in file.  The information is stored as a
702                     collection of Magic commands, so that it can be recovered
703                     with the command source file.
704
705              feedback why
706                     Prints  out the explanations associated with all feedback
707                     areas underneath the box.
708
709       fill direction [layers]
710              Direction is a Manhattan direction (see the  section  DIRECTIONS
711              below).  The paint visible under one edge of the box is sampled.
712              Everywhere that the edge touches paint, the paint is extended in
713              the  given direction to the opposite side of the box.  For exam‐
714              ple, if direction is north, then paint is sampled under the bot‐
715              tom  edge of the box and extended to the top edge.  If layers is
716              specified, then only the given layers are considered;  if layers
717              isn't specified, then all layers are considered.
718
719       findbox [zoom]
720              Center  the  view  on the box.  If the optional zoom argument is
721              present, zoom into the area specified by the box.  This  command
722              will  complain  if the box is not in the window you are pointing
723              to.
724
725       flush [cellname]
726              Cell cellname is reloaded from disk.  All changes  made  to  the
727              cell  since it was last saved are discarded.  If cellname is not
728              given, the edit cell is flushed.
729
730       garoute option [args]
731              This command, with no option or arg, is like the route  command:
732              it generates routing in the edit cell to make connections speci‐
733              fied in the current netlist.  (See the route command for further
734              information).    Unlike  the  route  command,  this  command  is
735              intended to be used for routing types of circuits, such as gate-
736              arrays, whose routing channels can be determined in advance, and
737              which require the ability to  river-route  across  the  tops  of
738              cells.    The   channels   must   have   been  predefined  using
739              garoute channel commands prior to this  command  being  invoked.
740              Unlike  the  route  command, where the box indicates the routing
741              area, this command ignores the box entirely.  The new wires  are
742              placed  in  the edit cell.  The netlist used is that selected by
743              the route netlist command, or the current netlist  being  edited
744              in  a netlist window if no route netlist command has been given.
745              Options and args have the following effects:
746
747              garoute channel [type]
748
749              garoute channel xlo ylo xhi yhi [type]
750                     Define a channel.  If xlo, ylo, xhi,  and  yhi  are  pro‐
751                     vided,  they  are  interpreted  as the coordinates of the
752                     lower-left and upper-right of the bounding  box  for  the
753                     channel  respectively.  Otherwise, the coordinates of the
754                     box are used.  The boundary of each channel  is  adjusted
755                     inward  to  lie  halfway between routing grid lines if it
756                     does not lie there already; if the channel is adjusted, a
757                     warning  message  is  printed.  The channel defined is an
758                     ordinary routing channel if type is not  specified;  such
759                     channels are identical to those used by the router of the
760                     route command.  If type is given, it must be either h  or
761                     v.   The  channel thereby created will be a river-routing
762                     channel inside which only left-to-right routes are possi‐
763                     ble  (``h'')  or  top-to-bottom (``v'').  Unlike a normal
764                     channel, a river-routing channel may contain terminals in
765                     its interior.
766
767              garoute generate type [file]
768                     Provides  a  primitive  form of channel decomposition for
769                     regular structures such as  gate-array  or  standard-cell
770                     layouts.   Generates a collection of garoute channel com‐
771                     mands, either to the standard output, or to file  if  the
772                     latter is specified.  The type parameter must be either h
773                     or v.  The entire area contained within the box is turned
774                     into  routing  channels.   Each cell inside this area has
775                     its bounding box computed  for  purposes  of  routing  by
776                     looking  only  at  those layers considered to be ``obsta‐
777                     cles'' to routing (see ``Tutorial #7: Netlists and  Rout‐
778                     ing''  for  details).   The bounding box just computed is
779                     then extended all the way to the sides of the area of the
780                     box tool, vertically if type is h or horizontally if type
781                     is v.  This extended area is then marked as belonging  to
782                     a  river-routing  channel of type type; adjacent channels
783                     of this type are merged into a single channel.  After all
784                     cells are processed, the areas not marked as being river-
785                     routing channels are output as normal channels.
786
787              garoute help
788                     Print  a  short  synopsis  of  all  the  garoute  command
789                     options.
790
791              garoute nowarn
792                     If a given terminal appears in more than one place inside
793                     a cell, the router can leave feedback if it is not possi‐
794                     ble  to  route  to  all  of the places where the terminal
795                     appears.  The garoute nowarn command instructs the router
796                     to  leave feedback only if it is not possible to route to
797                     any of the locations of a terminal.  (This is the default
798                     behavior of garoute router).
799
800              garoute route [netlist]
801                     Route  the  edit  cell.  If netlist is not specified, the
802                     netlist used is the same as when garoute is given with no
803                     options.  If netlist is given, then it is used instead.
804
805              garoute reset
806                     Clear all channels defined by garoute channel in prepara‐
807                     tion for redefining a new set of channels.
808
809              garoute warn
810                     The opposite of garoute nowarn,  this  command  instructs
811                     the  router  to  leave  feedback if it is not possible to
812                     route to all of the places where a terminal appears  when
813                     a terminal has more than one location, even if not all of
814                     those locations are actually selected for routing by  the
815                     global router.
816
817       getcell cellName [child refPointC] [parent refPointP]
818              This  command  adds a child cell instance to the edit cell.  The
819              instance refers to the cell cellName;  it is positioned so  that
820              refPointC  in  the child is at point refPointP in the edit cell.
821              The reference points can either be the name of a label, in which
822              case  the  lower-left  corner  of the label's box is used as the
823              reference point, or as a pair of numbers giving the (x, y) coor‐
824              dinates  of  a point explicitly.  If refPointC is not specified,
825              the lower-left corner of cellName cell is used.  If refPointP is
826              not  specified,  the  lower-left  corner of the box tool is used
827              (the box must be in a window on the edit cell).  The new subcell
828              is  selected.   The  difference between this command and dump is
829              that dump copies the contents of the cell, while getcell  simply
830              makes  a  reference  to the original cell.  Cellname must not be
831              the edit cell or one of its ancestors.
832
833       getnode [alias on | alias off]
834
835       getnode [abort [str]]
836              Getnode prints out the node names (used by  the  extractor)  for
837              all  selected  paint.  If aliasing turned on, getnode prints all
838              the names it finds for a given node.  It  may  not  print  every
839              name  that exists, however.  When turned off, it just prints one
840              name.  The abort option allows the user to tell getnode that  it
841              is  not  important  to completely search nodes that have certain
842              names.  For example, getnode abort Vdd will tell getnode not  to
843              continue  searching  the  node  if it determines that one of its
844              names is Vdd.  A getnode abort, without a string argument,  will
845              erase  the  list  of names previously created by calling getnode
846              abort with string arguments.  Getnode can be safely  aborted  at
847              any  time  by  typing  the interrupt character, usually ^C.  See
848              Tutorial #11:  Using IRSIM and RSIM with Magic for more informa‐
849              tion on this command.
850
851       grid [xSpacing [ySpacing [xOrigin yOrigin]]]
852
853       grid off
854              If  no arguments are given, a one-unit grid is toggled on or off
855              in the window underneath the cursor.  Grid off always turns  the
856              grid off, regardless of whether it was on or off previously.  If
857              numerical arguments are given, the arguments determine the  grid
858              spacing and origin for the window under the cursor.  In its most
859              general form, grid takes four integer  arguments.   XOrigin  and
860              yOrigin specify an origin for the grid:  horizontal and vertical
861              grid lines will pass through this point.  XSpacing and  ySpacing
862              determine  the  number of units between adjacent grid lines.  If
863              xOrigin and yOrigin are omitted, they default to 0.  If ySpacing
864              is  also  omitted, the xSpacing value is used for both spacings.
865              Grid parameters will be retained for a window  until  explicitly
866              changed  by another grid command.  When the grid is displayed, a
867              solid box is drawn to show the origin of the edit cell.
868
869       identify instance_id
870              Set  the  instance  identifier  of  the  selected  cell  use  to
871              instance_id.   Instance_id  must  be  unique  among all instance
872              identifiers in the parent  of  the  selected  cell.   Initially,
873              Magic  guarantees  uniqueness of identifiers by giving each cell
874              an initial identifier consisting of  the  cell  definition  name
875              followed by an underscore and a small integer.
876
877       iroute subcommand [args]
878              This  command  provides  an  interactive  interface to the Magic
879              maze-router.  Routing is done one connection at a  time.   Three
880              internal  hint layers, magnet, fence, and rotate, allow the user
881              to guide routing graphically.  Routes are chosen close  to  mag‐
882              nets (if possible), routing does not cross fence boundaries, and
883              rotate areas reverse the preferred routing directions  for  each
884              layer.   The  maze-router  seeks  to  find  a  lowest-cost path.
885              Parameters specifying costs for horizontal and vertical  routing
886              on  each  layer,  cost for jogs and contacts, and cost (per unit
887              area) for distance between a path and  magnets,  help  determine
888              the nature of the routes.  Several search parameters permit tun‐
889              ing to achieve acceptable routes in as short a time as possible.
890              Routing  can  always be interrupted with ^C.  The iroute subcom‐
891              mands are as follows:
892
893              iroute Routes from cursor to inside box.
894
895              iroute contact [type] [parameter] [value1] ... [valuen]
896                     An asterisk, *, can be used for type and parameter.  This
897                     command  is  for setting and examining parameters related
898                     to contacts.
899
900              iroute help [subcommand]
901                     Summarizes irouter commands.  If a subcommand  is  given,
902                     usage information for that subcommand is printed.
903
904              iroute layers [type] [parameter] [value1] ... [valuen]
905                     An asterisk, *, can be used for type and parameter.  This
906                     command is for setting and examining  parameters  related
907                     to route layers.
908
909              iroute route [options]
910                     Invokes the router.  Options are as follows:
911                          -sLayers layers = layers route may start on
912                          -sCursor = start route at cursor (DEFAULT)
913                          -sLabel name = start route at label of given name
914                          -sPoint x y = start route at given coordinates
915                          -dLayers layers = layers route may end on
916                          -dBox = route to box (DEFAULT)
917                          -dLabel name = route to label of given name
918                          -dRect xbot ybot xtop ytop = route to rectangle of given coordinates
919                          -dSelection = route to selection
920
921              iroute saveParameters <filename>
922                     Saves all current irouter parameter settings.  The param‐
923                     eters can be restored to these values  with  the  command
924                     ``source filename''.
925
926              iroute search [searchParameter] [value]
927                     Allows  parameters controlling the search to be modified.
928                     If routing is too  slow  try  increasing  rate.   If  the
929                     router  is producing bad results, try reducing rate.  Its
930                     a good idea to make width at least twice as big as rate.
931
932              iroute spacings [route-type] [type] [spacing] ...  [typen  spac‐
933              ingn]
934                     Default  minimum  spacings between a route-type placed by
935                     the router and other types are derived from the drc  sec‐
936                     tion  of  the technology file.  The defaults can be over‐
937                     ridden by this command.  The special type SUBCELL is used
938                     to specify minimum spacing to unexpanded subcells.
939
940              iroute verbosity [level]
941                     Controls the number of messages printed during routing:
942                          0 = errors and warnings only,
943                          1 = brief,
944                          2 = lots of statistics.
945
946              iroute version
947                     Prints irouter version information.
948
949              iroute wizard [wizardparameter] [value]
950                     Used  to  examine and set miscellaneous parameters.  Most
951                     of these are best left alone by the unadventurous user.
952
953       label string [pos [layer]]
954              A label with text string is  positioned  at  the  box  location.
955              Labels  may  cover  points,  lines, or areas, and are associated
956              with specific layers.  Normally the box is collapsed to either a
957              point  or  to  a  line  (when labeling terminals on the edges of
958              cells).  Normally also, the area under the box is occupied by  a
959              single layer.  If no layer argument is specified, then the label
960              is attached to the layer under the box, or  space  if  no  layer
961              covers  the  entire  area of the box.  If layer is specified but
962              layer doesn't cover the entire area of the box, the  label  will
963              be  moved  to  another layer or space.  Labels attached to space
964              will be considered by CIF processing programs to be attached  to
965              all  layers overlapping the area of the label.  Pos is optional,
966              and specifies where the label text is to be  displayed  relative
967              to  the  box  (e.g.  ``north'').  If pos isn't given, Magic will
968              pick a position to ensure that the label text doesn't stick  out
969              past the edge of the cell.
970
971       layers Prints  out  the names of all the layers defined for the current
972              technology.
973
974       load [file]
975              Load the cell hierarchy  rooted  at  file.mag  into  the  window
976              underneath  the  cursor.   If no file is supplied, a new unnamed
977              cell is created.  The root cell of the  hierarchy  is  made  the
978              edit  cell  unless  there is already an edit cell in a different
979              window.
980
981       move [direction [amount]]
982
983       move to x y
984              If no arguments are given, the selection is  picked  up  by  the
985              point  underneath  the lower-left corner of the box and moved so
986              that this point lies at the cursor location.   If  direction  is
987              given,  it  must  be  a  Manhattan  direction (e.g. north).  The
988              selection is moved in that direction by amount.  If the  box  is
989              in  the  same  window as the selection, it is moved too.  Amount
990              defaults to 1.  Selected material that is not in the edit  cell,
991              is  not  affected.   The second form of the command is as though
992              the cursor were pointing to (x, y) in the edit cell; the  selec‐
993              tion  is picked up by the point beneath the lower-left corner of
994              the box and moved so that this point lies at (x, y).
995
996       paint layers
997              The area underneath the box is painted in layers.
998
999       path [searchpath]
1000              This command tells Magic where to look  for  cells.   Searchpath
1001              contains a list of directories separated by colons or spaces (if
1002              spaces are used, then searchpath must be surrounded by  quotes).
1003              When  looking for a cell, Magic will check each directory in the
1004              path in order, until the cell is found.   If  the  cell  is  not
1005              found  anywhere  in  the  path,  Magic  will  look in the system
1006              library for it.  If the path command is invoked  with  no  argu‐
1007              ments, the current search path is printed.
1008
1009       plot option [args]
1010              Used  to generate hardcopy plots direct from Magic.  Options and
1011              args are used in the following ways:
1012
1013              plot gremlin file [layers]
1014                     Generate a Gremlin-format description of everything under
1015                     the  box,  and  write the description in file.  If layers
1016                     isn't specified, paint, labels, and  unexpanded  subcells
1017                     are  all included in the Gremlin file just as they appear
1018                     on the screen.  If layers is  specified,  then  just  the
1019                     indicated  layers are output in the Gremlin file.  Layers
1020                     may include the special layers labels and  subcell.   The
1021                     Gremlin  file  is scaled to have a total size between 256
1022                     and 512 units; you should use the width and/or height Grn
1023                     commands  to  ensure that the printed version is the size
1024                     you want.  Use the mg stipples in Grn.  No  plot  parame‐
1025                     ters are used in Gremlin plotting.
1026
1027              plot help
1028                     Print a short synopsis of all the plot command options.
1029
1030              plot parameters [name value]
1031                     If  plot  parameters  is invoked with no additional argu‐
1032                     ments, the values for all  of  the  plot  parameters  are
1033                     printed.   If  name  and value are provided, then name is
1034                     the name of a plot parameter and value is a new value for
1035                     it.   Plot parameters are used to control various aspects
1036                     of plotting;  all of  them  have  ``reasonable''  initial
1037                     values.  Most of the parameters available now are used to
1038                     control Versatec-style plotting.  They are:
1039
1040                     cellIdFont
1041                            The name of the font to use for cell instance  ids
1042                            in  Versatec  plots.  This must be a file in Vfont
1043                            format.
1044
1045                     cellNameFont
1046                            The name of the font to use for cell names in Ver‐
1047                            satec plots.  This must be a file in Vfont format.
1048
1049                     color  If this is set to true, the :plot versatec command
1050                            will generate output  suitable  for  a  four-color
1051                            Versatec  plotter, using the styles defined in the
1052                            colorversatec style of the  plot  section  of  the
1053                            technology file.  If color is false (the default),
1054                            then :plot versatec  generates  normal  black-and-
1055                            white plots.
1056
1057                     directory
1058                            The  name  of  the  directory  in  which to create
1059                            raster files for the Versatec.  The  raster  files
1060                            have  names  of  the  form  magicPlotXXXXXX, where
1061                            XXXXXX is a process-specific identifier.
1062
1063                     dotsPerInch
1064                            Indicates how many dots per inch there are on  the
1065                            Versatec printer.  This parameter is used only for
1066                            computing the scale factor for plotting.  Must  be
1067                            an integer greater than zero.
1068
1069                     labelFont
1070                            The name of the font to use for labels in Versatec
1071                            plots.  This must be a file in Vfont format.
1072
1073                     printer
1074                            The name of the printer to which to spool Versatec
1075                            raster files.
1076
1077                     showcellnames
1078                            If  ``true''  (the  default)  then  the  name  and
1079                            instance-identifier of each unexpanded subcell  is
1080                            displayed inside its bounding box.  If this param‐
1081                            eter is ``false'' then only the  bounding  box  of
1082                            the cell is displayed.
1083
1084                     spoolCommand
1085                            The  command  used to spool Versatec raster files.
1086                            This must be a text string containing  two  ``%s''
1087                            formatting  fields.   The  first  ``%s''  will  be
1088                            replaced with the printer name, and the second one
1089                            will be replaced with the name of the raster file.
1090
1091                     swathHeight
1092                            How many raster lines of Versatec output to gener‐
1093                            ate in memory at one time.   The  raster  file  is
1094                            generated  in  swaths  in order to keep the memory
1095                            requirements reasonable.   This  parameter  deter‐
1096                            mines the size of the swaths.  It must be an inte‐
1097                            ger greater than zero, and should be a multiple of
1098                            16  in order to avoid misalignment of stipple pat‐
1099                            terns.
1100
1101                     width  The number of pixels across the Versatec  printer.
1102                            Must  be an integer greater than 0, and must be an
1103                            even multiple of 32.
1104
1105              plot versatec [size [layers]]
1106                     Generate a raster file describing all the the information
1107                     underneath  the  box in a format suitable for printing on
1108                     Versatec black-and-white or color printers, and spool the
1109                     file  for  printing.   See  the plot parameters above for
1110                     information about the parameters that are used to control
1111                     Versatec  plotting.  Size  is  used to scale the plot:  a
1112                     scalefactor is chosen so that the area of the box is size
1113                     inches  across on the printed page.  Size defaults to the
1114                     width  of  the  printer.   Layers  selects  which  layers
1115                     (including  labels and subcells) to plot;  it defaults to
1116                     everything visible on the screen.
1117
1118       plow direction [layers]
1119
1120       plow option [args]
1121              The first form of this command invokes the plowing operation  to
1122              stretch  and/or compact a cell.  Direction is a Manhattan direc‐
1123              tion.  Layers is an optional collection of  mask  layers,  which
1124              defaults to *.  One of the edges of the box is treated as a plow
1125              and dragged to the opposite edge of the box (e.g. the left  edge
1126              is  used  as the plow when plow right is invoked).  All edges on
1127              layers that lie in the plow's path are pushed ahead of  it,  and
1128              they  push  other  edges ahead of them to maintain design rules,
1129              connectivity, and transistor and contact  sizes.   Subcells  are
1130              moved  in their entirety without being modified internally.  Any
1131              mask information overlapping a subcell moved by plowing is  also
1132              moved  by the same amount.  Option and args are used in the fol‐
1133              lowing ways:
1134
1135              plow boundary
1136                     The box specifies the area that may be modified by  plow‐
1137                     ing.   This  area is highlighted with a pale stipple out‐
1138                     line.  Subsequent plows are not  allowed  to  modify  any
1139                     area  outside  that specified by the box; if they do, the
1140                     distance the plow moves is reduced by  an  amount  suffi‐
1141                     cient  to  insure  that  no geometry outside the boundary
1142                     gets affected.
1143
1144              plow help
1145                     Prints a short synopsis of all the plow command options.
1146
1147              plow horizon n
1148
1149              plow horizon
1150                     The first form sets the plowing jog horizon to  n  units.
1151                     The  second form simply prints the value of the jog hori‐
1152                     zon.  Every time plowing considers introducing a jog in a
1153                     piece  of  material,  it  looks up and down that piece of
1154                     material for a distance equal to the jog horizon.  If  it
1155                     finds  an  existing jog within this distance, it uses it.
1156                     Only if no jog is found within the jog horizon does plow‐
1157                     ing  introduce  one  of  its  own.  A jog horizon of zero
1158                     means that plowing will always introduce new  jogs  where
1159                     needed.   A  jog  horizon of infinity (plow nojogs) means
1160                     that plowing will not introduce any new jogs of its own.
1161
1162              plow jogs
1163                     Re-enable jog insertion with a horizon of 0.   This  com‐
1164                     mand is equivalent to plow horizon 0.
1165
1166              plow noboundary
1167                     Remove any boundary specified with a previous plow bound‐
1168                     ary command.
1169
1170              plow nojogs
1171                     Sets the jog horizon to infinity.  This means that  plow‐
1172                     ing  will not introduce any jogs of its own; it will only
1173                     use existing ones.
1174
1175              plow nostraighten
1176                     Don't straighten jogs automatically after each plow oper‐
1177                     ation.
1178
1179              plow selection [direction [distance]]
1180                     Like  the  move  or  stretch commands, this moves all the
1181                     material in the selection that belongs to the edit  cell.
1182                     However,  any material not in the selection is pushed out
1183                     of its way, just as though each piece  of  the  selection
1184                     were plowed individually.  If no arguments are given, the
1185                     selection is picked up by the point underneath the lower-
1186                     left corner of the box and plowed so that this point lies
1187                     at the cursor location.  The box is moved along with  the
1188                     selection.  If direction is given, it must be a Manhattan
1189                     direction (e.g. north).  The selection is moved  in  that
1190                     direction by amount.  If the box is in the same window as
1191                     the selection, it is moved too.  Amount  defaults  to  1.
1192                     If  there  is  selected  material  that isn't in the edit
1193                     cell, it is ignored (note that  this  is  different  from
1194                     select  and move).  If direction isn't given and the cur‐
1195                     sor isn't exactly left, right, up, or down from  the  box
1196                     corner,  then  Magic first rounds the cursor position off
1197                     to a position that is one of those  (whichever  is  clos‐
1198                     est).
1199
1200              plow straighten
1201                     Straighten  jogs automatically after each plow operation.
1202                     The effect will be as though the straighten command  were
1203                     invoked  after  each plow operation, with the same direc‐
1204                     tion, and over the area changed by plowing.
1205
1206       resist cell [tolerance]
1207              This command  is  similar  to  extresist  above,  but  used  for
1208              extracting  resistance  networks for individual nodes.  Only the
1209              node underneath the box is processed.  The network for this node
1210              is  output  to  the  file cell.res.ext.  See the description for
1211              extresist for an explanation of tolerance.
1212
1213       route option [args]
1214              This command, with no option or arg, is used to generate routing
1215              using  the  Magic  router  in  the edit cell to make connections
1216              specified in the current netlist.  The box is used  to  indicate
1217              the routing area:  no routing will be placed outside the area of
1218              the box.  The new wires are placed in the  edit  cell.   Options
1219              and args have the following effects:
1220
1221              route end [real]
1222                     Print  the  value of the channel end constant used by the
1223                     channel router.  If a value is supplied, the channel  end
1224                     constant  is set to that value.  The channel end constant
1225                     is a dimensionless multiplier used  to  compute  how  far
1226                     from  the  end of a channel to begin preparations to make
1227                     end connections.
1228
1229              route help
1230                     Print a short synopsis of all the route command options.
1231
1232              route jog [int]
1233                     Print the value of the minimum jog  length  used  by  the
1234                     channel  router.  If a value is supplied, the minimum jog
1235                     length is set to that value.  The channel router makes no
1236                     vertical  jogs  shorter than the minimum jog length, mea‐
1237                     sured in router grid units.  Higher values for this  con‐
1238                     stant  may improve the quality of the routing by removing
1239                     unnecessary jogs; however,  prohibiting  short  jogs  may
1240                     make some channels unroutable.
1241
1242              route metal
1243                     Toggle  metal  maximization on or off.  The route command
1244                     routes the preferred  routing  layer  (termed  ``metal'')
1245                     horizontally  and the alternate routing layer vertically.
1246                     By default wires on the alternate routing layer are  then
1247                     converted,  as  much  as possible, to the preferred layer
1248                     before being painted into  the  layout.   Enabling  metal
1249                     maximization  improves the quality of the resulting rout‐
1250                     ing, since the preferred routing layer generally has bet‐
1251                     ter  electrical characteristics; however, designers wish‐
1252                     ing to do hand routing after automatic routing  may  find
1253                     it  easier  to disable metal maximization and deal with a
1254                     layer-per-direction layout.
1255
1256              route netlist [file]
1257                     Print the name of the current netlist.  If a file name is
1258                     specified,  it is opened if possible, and the new netlist
1259                     is loaded.  This option is provided primarily as a conve‐
1260                     nience so you need not open the netlist menu before rout‐
1261                     ing.
1262
1263              route obstacle [real]
1264                     Print the obstacle constant used by the  channel  router.
1265                     If  a  value is supplied, set the channel router obstacle
1266                     constant to that  value.   The  obstacle  constant  is  a
1267                     dimensionless  multiplier  used  in  deciding  how far in
1268                     front of an obstacle the channel router should begin jog‐
1269                     ging  nets  out of the way.  Larger values mean that nets
1270                     will jog out of the way earlier; however, if nets jog out
1271                     of the way too early routing area is wasted.
1272
1273              route origin [x y]
1274                     Print the x- and y-coordinates of the origin of the rout‐
1275                     ing grid.  By  default,  the  routing  grid  starts  from
1276                     (0,0).   However,  by  supplying an x and y coordinate to
1277                     the route origin command, the origin can be  set  to  any
1278                     other value.  This command is primarily useful when rout‐
1279                     ing a chip that has been designed  with  routing  on  the
1280                     same pitch as the router will use, but where the left and
1281                     bottom edges of the pre-existing routing  don't  line  up
1282                     with  the routing grid lines (for example, the pre-exist‐
1283                     ing routing might have  been  centered  on  routing  grid
1284                     lines).  The alternative to specifying a different origin
1285                     for the routing grid would be to translate all the  mate‐
1286                     rial in the cell to be routed so that the prewiring lined
1287                     up properly with routing grid lines.
1288
1289              route settings
1290                     Print the values of all router parameters.
1291
1292              route steady [int]
1293                     Print the value of the channel router's steady  net  con‐
1294                     stant.   If  a value is supplied, set the steady net con‐
1295                     stant to the value.  The steady net constant, measured in
1296                     router grid units, specifies how far beyond the next ter‐
1297                     minal the channel router should look  for  a  conflicting
1298                     terminal before deciding that a net is rising or falling.
1299                     Larger values mean that the  net  rises  and  falls  less
1300                     often.
1301
1302              route tech
1303                     Print  the  router technology information.  This includes
1304                     information such as the names of the preferred and alter‐
1305                     nate  routing  layers, their wire widths, the router grid
1306                     spacing, and the contact size.
1307
1308              route viamin
1309                     Minimize vias in (previously) routed netlist.  This  sub‐
1310                     command  removes unnecessary layer changes in all nets in
1311                     the current netlist to minimize via count.  The preferred
1312                     routing  layer, layer1 in the router section of the tech‐
1313                     nology file, is favored  by  the  algorithm.   Note  that
1314                     ``route  viamin'' is an independent routing postpass that
1315                     can be applied even if the routing was not  generated  by
1316                     the  route  command, provided the layers and widths agree
1317                     with the router section of the technology file.
1318
1319              route vias [int]
1320                     Print the value of the metal maximization  via  constant.
1321                     If  a  value  is  supplied,  set  the via constant to the
1322                     value.  The via constant, measured in router grid  units,
1323                     represents  the  tradeoff  between metal maximization and
1324                     the via count.  In many cases it is possible  to  convert
1325                     wiring on the alternate routing layer into routing on the
1326                     preferred routing layer (``metal'')  at  the  expense  of
1327                     introducing  one or two vias.  The via constant specifies
1328                     the amount of converted wiring that makes  it  worthwhile
1329                     to add vias to the routing.
1330
1331       rsim [options] [filename]
1332              Runs  rsim under Magic.  See Tutorial #11:  Using IRSIM and RSIM
1333              with Magic for more information on what options  and  files  are
1334              required by rsim.  Normally, IRSIM requires a parameter file for
1335              the technology and a .sim file describing the circuit.
1336
1337              The rsim command without any options can  be  used  to  interact
1338              with  a previously-started rsim.  Type rsim and you will see the
1339              rsim prompt.  To get back to magic, type q.
1340
1341       save [name]
1342              Save the edit cell on disk.  If the edit cell is  currently  the
1343              ``(UNNAMED)''  cell,  name  must  be specified; in this case the
1344              edit cell is renamed to name as well as being saved in the  file
1345              name.mag.   Otherwise, name is optional.  If specified, the edit
1346              cell is saved in the file name.mag; otherwise, it  is  saved  in
1347              the file from which it was originally read.
1348
1349       see option
1350              This command is used to control which layers are to be displayed
1351              in the window under the cursor.  It has several forms:
1352
1353              see no layers
1354                     Do not display the given layers in the window  under  the
1355                     cursor.   If  labels is given as a layer name, don't dis‐
1356                     play labels in that window either.  If errors is given as
1357                     a layer, no design-rule violations will be displayed (the
1358                     checker will continue to  run,  though).   If  layers  is
1359                     given  as  "*",  all  mask  layers  will be disabled, but
1360                     errors and labels will still be shown.  See the  "LAYERS"
1361                     section at the end of this manual page for an explanation
1362                     of layer naming in Magic.
1363
1364              see layers
1365                     Reenable display of the  given  layers.   Note  that  "*"
1366                     expands  to  all  mask  layers,  but does not include the
1367                     label or error layers.  See the "LAYERS" section  at  the
1368                     end of this manual page for details.
1369
1370              see no Don't  display  any  mask layers or labels.  Only subcell
1371                     bounding boxes will be displayed.
1372
1373              see    Reenable display of all mask layers, labels, and errors.
1374
1375              see allSame
1376                     Display all cells the same way.  This disables the facil‐
1377                     ity where the edit cell is displayed in bright colors and
1378                     non-edit cells are in paler colors.  After  see  allSame,
1379                     all mask information will be displayed in bright colors.
1380
1381              see no allSame
1382                     Reenable  the  facility where non-edit cells are drawn in
1383                     paler colors.
1384
1385       select option
1386              This command is used  to  select  paint,  labels,  and  subcells
1387              before  operating  on  them with commands like move and copy and
1388              delete.  It has several forms:
1389
1390              select If the cursor is over empty space, then this  command  is
1391                     identical  to select cell.  Otherwise, paint is selected.
1392                     The first time the command is invoked, a chunk  of  paint
1393                     is  selected: the largest rectangular area of material of
1394                     the same type visible underneath the cursor.  If the com‐
1395                     mand  is  invoked  again  without  moving the cursor, the
1396                     selection is extended to include all material of the same
1397                     type,  regardless  of shape.  If the command is invoked a
1398                     third time, the selection is extended  again  to  include
1399                     all  material  that is visible and electrically connected
1400                     to the point underneath the cursor.
1401
1402              select more
1403                     This command is  identical  to  select  except  that  the
1404                     selection is not first cleared.  The result is to add the
1405                     newly-selected material to what is already in the  selec‐
1406                     tion.
1407
1408              select less
1409                     This  chooses material just as select does, but the mate‐
1410                     rial is removed from the selection, rather than added  to
1411                     it.  The result is to deselect the chosen material.
1412
1413              select [more | less] area layers
1414                     Select  material  by  area.  If layers are not specified,
1415                     then all paint, labels, and unexpanded  subcells  visible
1416                     underneath the box are selected.  If layers is specified,
1417                     then only those layers are selected.  If more  is  speci‐
1418                     fied,  the new material is added to the current selection
1419                     rather than replacing it.  If less is specified, the  new
1420                     material is removed from the selection (deselected).
1421
1422              select [more | less] cell name
1423                     Select  a  subcell.   If  name  isn't given, this command
1424                     finds a subcell that is visible underneath the cursor and
1425                     selects  it.   If  the command is repeated without moving
1426                     the cursor then it will step  through  all  the  subcells
1427                     under  the  cursor.  If name is given, it is treated as a
1428                     hierarchical instance identifier starting from  the  root
1429                     of  the  window underneath the cursor.  The named cell is
1430                     selected.  If more is specified, the new subcell is added
1431                     to  the  current  selection  instead of replacing it.  If
1432                     less is specified, the new subcell is  removed  from  the
1433                     selection (deselected).
1434
1435              select clear
1436                     Clear  out  the selection.  This does not affect the lay‐
1437                     out;  it merely deselects everything.
1438
1439              select help
1440                     Print a short synopsis of the selection commands.
1441
1442              select save cell
1443                     Save all the information in the selection as a Magic cell
1444                     on disk.  The selection will be saved in file cell.mag.
1445
1446              select and the see command
1447                     Select  interacts  with  the see command.  When selecting
1448                     individual pieces of material, only  visible  layers  are
1449                     candidates for selection.  When selecting an entire area,
1450                     however,  both  visible  and  non-visible   material   is
1451                     selected.   This  behavior allows entire regions of mate‐
1452                     rial to be moved, even if see has been used to  turn  off
1453                     the display of some of the layers.
1454
1455       sideways
1456              Flip  the  selection left-to-right about a vertical axis running
1457              through the center of the selection's area.  If the  box  is  in
1458              the  same  window as the selection, it is flipped too.  Selected
1459              material not in the edit cell is not affected.
1460
1461       simcmd cmd
1462              Sends the command cmd to rsim for execution.  See Tutorial  #11:
1463              Using IRSIM and RSIM with Magic for more information.
1464
1465       snap [on]
1466
1467       snap [off]
1468              Control  whether  the  box  and  point  are  snapped to the grid
1469              selected for the windows in which they appear (the grid was  set
1470              by  the grid command), or to the standard 1x1 grid.  The default
1471              is for snapping to be off, i.e., snapping to a 1x1  grid.   With
1472              no arguments, snap prints whether snapping is enabled or not.
1473
1474       startrsim [options] [filename]
1475              Similar  to the rsim command, except it returns to Magic as soon
1476              as rsim is started.  See Tutorial #11:   Using  IRSIM  and  RSIM
1477              with Magic for more information.
1478
1479       straighten direction
1480              Straighten  jogs  in wires underneath the box by pulling them in
1481              direction.  Jogs are only straightened if doing so will cause no
1482              additional geometry to move.
1483
1484       stretch [direction [amount]]
1485              This  command is identical to move except that simple stretching
1486              occurs as the selection is moved.  Each piece of  paint  in  the
1487              selection  causes the area through which it's moved to be erased
1488              in that layer.  Also, each piece of paint in the selection  that
1489              touches  unselected  material  along  its back side causes extra
1490              material to be painted to fill in the gap left by the move.   If
1491              direction  isn't given and the cursor isn't exactly left, right,
1492              up, or down from the box corner, then  Magic  first  rounds  the
1493              cursor  position  off to a position that is one of those (which‐
1494              ever is closest).
1495
1496       tool [name | info]
1497              Change the current tool.  The result is that the cursor shape is
1498              different and the mouse buttons mean different things.  The com‐
1499              mand tool info prints out the meanings of the  buttons  for  the
1500              current tool.  Tool name changes the current tool to name, where
1501              name is one of box, wiring, or netlist.  If tool is invoked with
1502              no  arguments, it picks a new tool in circular sequence:  multi‐
1503              ple invocations will cycle through all of the available tools.
1504
1505       unexpand
1506              Unexpand all cells that touch the box but don't completely  con‐
1507              tain it.
1508
1509       upsidedown
1510              Flip  the  selection upside down about a horizontal axis running
1511              through the center of the selection's area.  If the  box  is  in
1512              the  same  window  as  the  selection  then  it  is flipped too.
1513              Selected material that is not in the edit cell is not changed.
1514
1515       what   Print out information about all the things that are selected.
1516
1517       wire option [args]
1518              This command provides a centerline-wiring style user  interface.
1519              Option and args specify a particular wiring option, as described
1520              below.  Some of the options can be  invoked  via  mouse  buttons
1521              when the wiring tool is active.
1522
1523              wire help
1524                     Print out a synopsis of the various wiring commands.
1525
1526              wire horizontal
1527                     Just  like wire leg except that the new segment is forced
1528                     to be horizontal.
1529
1530              wire leg
1531                     Paint a horizontal or vertical segment of wire  from  one
1532                     side  of  the  box  over to the cursor's x- or y-location
1533                     (respectively).  The direction (horizontal  or  vertical)
1534                     is  chosen so as to produce the longest possible segment.
1535                     The segment is painted in the current wiring material and
1536                     thickness.   The  new segment is selected, and the box is
1537                     placed at its tip.
1538
1539              wire switch [layer width]
1540                     Switch routing layers and place  a  contact  at  the  box
1541                     location.   The contact type is chosen to connect the old
1542                     and new routing materials.  The  box  is  placed  at  the
1543                     position of the contact, and the contact is selected.  If
1544                     layer and width are specified, they are used as  the  new
1545                     routing  material  and  width, respectively.  If they are
1546                     not specified, the new material and width are  chosen  to
1547                     correspond to the material underneath the cursor.
1548
1549              wire type [layer width]
1550                     Pick a material and width for wiring.  If layer and width
1551                     are not given, then they are  chosen  from  the  material
1552                     underneath  the  cursor,  a  square  chunk of material is
1553                     selected to indicate the layer and width that  were  cho‐
1554                     sen, and the box is placed over this chunk.  If layer and
1555                     width are given, then this command does  not  modify  the
1556                     box position.
1557
1558              wire vertical
1559                     Just  like wire leg except that the new segment is forced
1560                     to be vertical.
1561
1562       writeall [force]
1563              This command steps through all the cells that have been modified
1564              in  this  edit session and gives you a chance to write them out.
1565              If the force option is specified,  then  ``autowrite''  mode  is
1566              used:  all modified cells are automatically written without ask‐
1567              ing for permission.
1568
1569

COMMANDS FOR ALL WINDOWS

1571       These commands are not used for layout, but are instead used for  over‐
1572       all, housekeeping functions.  They are valid in all windows.
1573
1574       closewindow
1575              The  window under the cursor is closed.  That area of the screen
1576              will now show other windows or the background.
1577
1578       echo [-n] str1 str2 ... strN
1579              Prints str1 str2 ... strN in the text window, separated by  spa‐
1580              ces  and  followed  by a newline.  If the -n switch is given, no
1581              newline is output after the command.
1582
1583       help [pattern]
1584              Displays a synopsis of commands that apply to the window you are
1585              pointing to.  If pattern is given then only command descriptions
1586              containing the pattern are printed.  Pattern may contain '*' and
1587              '?'  characters, which match a string of non-blank characters or
1588              a single non-blank character (respectively).
1589
1590       logcommands [file [update]]]
1591              If file is given, all further commands are logged to that  file.
1592              If  no  arguments  are given, command logging is terminated.  If
1593              the keyword update is present, commands are output to  the  file
1594              to  cause  the  screen to be updated after each command when the
1595              command file is read back in.
1596
1597       macro [char [command]]
1598              Command is associated with char such that  typing  char  on  the
1599              keyboard  is equivalent to typing ``:'' followed by command.  If
1600              command is omitted, the current macro for char is  printed.   If
1601              char  is  also omitted, then all current macros are printed.  If
1602              command contains spaces, tabs, or semicolons  then  it  must  be
1603              placed  in  quotes.   The  semicolon acts as a command separator
1604              allowing multiple commands to be combined in a single macro.
1605
1606       openwindow [cell]
1607              Open a new, empty window at  the  cursor  position.   Placement,
1608              sizing,  and  methods of manipulation are determined by the con‐
1609              ventions of the window system in use.   If  cell  is  specified,
1610              then  that  cell  is displayed in the new window.  Otherwise the
1611              area of the box will be displayed in the new window.
1612
1613       pushbutton button action
1614              Simulates a button push.  Button  should  be  left,  middle,  or
1615              right.   Action is one of up, or down.  This command is normally
1616              invoked only from command scripts produced  by  the  logcommands
1617              command.
1618
1619       quit   Exit Magic and return to the shell.  If any cells, colormaps, or
1620              netlists have changed since they were last saved  on  disk,  you
1621              are given a chance to abort the command and continue in Magic.
1622
1623       redo [n]
1624              Redo  the  last  n  commands  that  were  undone using undo (see
1625              below).  The number of commands to redo defaults to 1  if  n  is
1626              not specified.
1627
1628       redraw Redraw the graphics screen.
1629
1630       scroll direction [amount]
1631              The  window  under  the cursor is moved by amount screenfulls in
1632              direction relative to the circuit.  If  amount  is  omitted,  it
1633              defaults to 0.5.
1634
1635       send type command
1636              Send  a  command to the window client named by type.  The result
1637              is just as if command had been typed in a window of  type  type.
1638              See specialopen, below, for the allowable types of windows.
1639
1640       setpoint [x y [windowID]]
1641              Fakes  the location of the cursor up until after the next inter‐
1642              active command.  Without arguments, just prints out the  current
1643              point location.  This command is normally invoked only from com‐
1644              mand scripts.
1645
1646              If windowID is given, then the point is assumed to  be  in  that
1647              window's  screen  coordinate  system rather than absolute screen
1648              coordinates.
1649
1650       sleep n
1651              Causes Magic to go to sleep for n seconds.
1652
1653       source filename
1654              Each line of filename is read and processed as one command.  Any
1655              line  whose last character is backslash is joined to the follow‐
1656              ing line.  The commands setpoint, pushbutton, echo,  sleep,  and
1657              updatedisplay are useful in command files, and seldom used else‐
1658              where.
1659
1660       specialopen [x1 y1 x2 y2] type [args]
1661              Open a window of type type.  If the optional x1 y1 x2 y2 coordi‐
1662              nates  are  given,  then the new window will have its lower left
1663              corner at screen coordinates (x1, y1) and its upper right corner
1664              at  screen  coordinates (x2, y2).  The args arguments are inter‐
1665              preted differently depending upon the type of the window.  These
1666              types are known:
1667
1668              layout This  type  of  window  is used to edit a VLSI cell.  The
1669                     command takes a single argument which is used as the name
1670                     of a cell to be loaded.  The command
1671                                           open filename
1672                     is a shorthand for the command
1673                                   specialopen layout filename.
1674
1675              color  This  type  of  window allows the color map to be edited.
1676                     See the section COMMANDS FOR COLORMAP EDITING below.
1677
1678              netlist
1679                     This type of window presents a menu that can be  used  to
1680                     place  labels,  and  to generate and edit net-lists.  See
1681                     the section COMMANDS FOR NETLIST EDITING below.
1682
1683       underneath
1684              Move the window pointed at so that it lies underneath  the  rest
1685              of the windows.
1686
1687       undo [count]
1688              Undoes  the  last  count commands.  Almost all commands in Magic
1689              are now undo-able.  The  only  holdouts  left  are  cell  expan‐
1690              sion/unexpansion,  and  window  modifications  (change  of size,
1691              zooming, etc.).  If count is unspecified, it defaults to 1.
1692
1693       updatedisplay
1694              Update the display.  This command is normally invoked only  from
1695              command  scripts.   Scripts  that  do  not  contain this command
1696              update the screen only at the end of the script.
1697
1698       view   Choose a view for the  window  underneath  the  cursor  so  that
1699              everything in the window is visible.
1700
1701       windscrollbars [on|off]
1702              Set  the  flag  that  determines if new windows will have scroll
1703              bars.
1704
1705       windowpositions [file]
1706              Write out the positions of the windows in a format suitable  for
1707              the  source command.  If file is specified, then write it out to
1708              that file instead of to the terminal.
1709
1710       zoom [factor]
1711              Zoom the view in the window underneath the cursor by factor.  If
1712              factor is less than 1, we zoom in; if it is greater than one, we
1713              zoom out.
1714
1715

MOUSE BUTTONS FOR NETLIST WINDOWS

1717       When the  netlist menu is opened using the command special  netlist,  a
1718       menu  appears  on  the  screen.   The  colored areas on the menu can be
1719       clicked with various mouse buttons to perform various actions, such  as
1720       placing  labels  and  editing  netlists.  For details on how to use the
1721       menu, see ``Magic Tutorial #7: Netlists and Routing''.  The  menu  but‐
1722       tons  all correspond to commands that could be typed in netlist or lay‐
1723       out windows.
1724
1725

COMMANDS FOR NETLIST WINDOWS

1727       The commands described below work if you are pointing to  the  interior
1728       of the netlist menu.  They may also be invoked when you are pointing at
1729       another window by using the send netlist command.   Terminal  names  in
1730       all  of the commands below are hierarchical names consisting of zero or
1731       more cell use ids separated by slashes, followed  by  the  label  name,
1732       e.g.  toplatch/shiftcell_1/in.  When processing the terminal paths, the
1733       search always starts in the edit cell.
1734
1735       add term1 term2
1736              Add the terminal named term1  to  the  net  containing  terminal
1737              term2.   If  term2 isn't in a net yet, make a new net containing
1738              just term1 and term2.
1739
1740       cleanup
1741              Check the netlist to make sure that for every terminal named  in
1742              the  list there is at least one label in the design.  Also check
1743              to make sure that every net contains at least two distinct  ter‐
1744              minals,  or  one  terminal with several labels by the same name.
1745              When errors are found, give the user an  opportunity  to  delete
1746              offending  terminals and nets.  This command can also be invoked
1747              by clicking the ``Cleanup'' menu button.
1748
1749       cull   Examine the current netlist and the routing in  the  edit  cell,
1750              and  remove those nets from the netlist that are already routed.
1751              This command is often used after pre-routing nets  by  hand,  so
1752              the router won't try to implement them again.
1753
1754       dnet name name ...
1755              For  each  name  given, delete the net containing that terminal.
1756              If no name is given, delete the currently-selected net, just  as
1757              happens when the ``No Net'' menu button is clicked.
1758
1759       dterm name name ...
1760              For each name given, delete that terminal from its net.
1761
1762       extract
1763              Pick  a piece of paint in the edit cell that lies under the box.
1764              Starting from this, trace  out  all  the  electrically-connected
1765              material  in  the  edit  cell.  Where this material touches sub‐
1766              cells, find any terminals in the subcells and  make  a  new  net
1767              containing  those terminals.  Note:  this is a different command
1768              from the extract command in layout windows.
1769
1770       find pattern [layers]
1771              Search the area beneath the box  for  labels  matching  pattern,
1772              which may contain the regular-expression characters ``*'' ``?'',
1773              ``['', ``]'', and ``\'' (as matched by csh(1); see the  descrip‐
1774              tion  of  the  find  button in ``Magic Tutorial #7: Netlists and
1775              Routing'').  For each label found, leave feedback whose text  is
1776              the  layer  on which the label appears, followed by a semicolon,
1777              followed by the full hierarchical pathname of  the  label.   The
1778              feedback  surrounds  the  area  of  the label by one unit on all
1779              sides.  (The reason for the one-unit extension is that  feedback
1780              rectangles  must  have positive area, while labels may have zero
1781              width or height).  If layers are given, only labels attached  to
1782              those layers are considered.
1783
1784       flush [netlist]
1785              The  netlist  named  netlist  is  reloaded  from  the  disk file
1786              netlist.net.  Any changes made to the  netlist  since  the  last
1787              time  it was written are discarded.  If netlist isn't given, the
1788              current netlist is flushed.
1789
1790       join term1 term2
1791              Join together the nets containing  terminals  term1  and  term2.
1792              The  result  is  a  single net containing all the terminals from
1793              both the old nets.
1794
1795       netlist [name]
1796              Select a netlist to work on.  If name is provided, read name.net
1797              (if  it hasn't already been read before) and make it the current
1798              netlist.  If name isn't provided, use the name of the edit  cell
1799              instead.
1800
1801       print [name]
1802              Print the names of all the terminals in the net containing name.
1803              If name isn't provided, print the terminals in the current  net.
1804              This  command  has  the same effect as clicking on the ``Print''
1805              menu button.
1806
1807       ripup [netlist]
1808              This command has two forms.  If netlist isn't typed as an  argu‐
1809              ment, then find a piece of paint in the edit cell under the box.
1810              Trace out all paint in the edit cell that is  electrically  con‐
1811              nected  to the starting piece, and delete all of this paint.  If
1812              netlist is typed, find all paint in the edit cell that is  elec‐
1813              trically  connected  to  any  of  the  terminals  in the current
1814              netlist, and delete all of this paint.
1815
1816       savenetlist [file]
1817              Save the current netlist on disk.  If file is given,  write  the
1818              netlist  in  file.net.  Otherwise, write the netlist back to the
1819              place from which it was read.
1820
1821       shownet
1822              Find a piece of paint in any cell underneath the box.   Starting
1823              from  this paint, trace out all paint in all cells that is elec‐
1824              trically connected to the  starting  piece  and  highlight  this
1825              paint on the screen.  To make the highlights go away, invoke the
1826              command with the box over empty space.   This  command  has  the
1827              same effect as clicking on the ``Show'' menu button.
1828
1829       showterms
1830              Find  the  labels  corresponding to each of the terminals in the
1831              current netlist, and generate a feedback area over  each.   This
1832              command  has  the  same effect as clicking on the ``Terms'' menu
1833              button.
1834
1835       trace [name]
1836              This command is similar to shownet except that instead of start‐
1837              ing  from a piece of paint under the box, it starts from each of
1838              the terminals in the net containing name (or the current net  if
1839              no  name  is  given).  All connected paint in all cells is high‐
1840              lighted.
1841
1842       verify Compare the current netlist against the wiring in the edit  cell
1843              to  make sure that the nets are implemented exactly as specified
1844              in the netlist.  If there are discrepancies, feedback areas  are
1845              created  to  describe them.  This command can also be invoked by
1846              clicking the ``Verify'' menu button.
1847
1848       writeall
1849              Scan through all the netlists that have been  read  during  this
1850              editing  session.   If  any  have  been  modified,  ask the user
1851              whether or not to write them out.
1852
1853

MOUSE BUTTONS FOR COLORMAP WINDOWS

1855       Color windows display two sets of colored bars  and  a  swatch  of  the
1856       color  being edited.  The left set of color bars is labeled Red, Green,
1857       and Blue;  these correspond to the proportion of red, green,  and  blue
1858       in the color being edited.  The right set of bars is labeled Hue, Satu‐
1859       ration, and Value;  these correspond to the same color but in  a  space
1860       whose  axes  are  hue (spectral color), saturation (spectral purity vs.
1861       dilution with white), and value (light vs. dark).
1862
1863       The value of a color is changed by pointing inside the  region  spanned
1864       by  one of the color bars and clicking any mouse button.  The color bar
1865       will change so that it extends to the point selected by  the  crosshair
1866       when the button was pressed.  The color can also be changed by clicking
1867       a button over one of the ``pumps'' next to a color bar.  A  left-button
1868       click makes a 1% increment or decrement, and a right-button click makes
1869       a 5% change.
1870
1871       The color being edited can be changed by pressing the left button  over
1872       the  current color box in the editing window, then moving the mouse and
1873       releasing the button over a point on the screen that contains the color
1874       to  be  edited.   A color value can be copied from an existing color to
1875       the current color by pressing the right mouse button over  the  current
1876       color  box, then releasing the button when the cursor is over the color
1877       whose value is to be copied into the current color.
1878
1879

COMMANDS FOR COLORMAP WINDOWS

1881       These commands work if you are pointing to the interior of  a  colormap
1882       window.  The commands are:
1883
1884       color [number]
1885              Load  number  as  the  color being edited in the window.  Number
1886              must be an octal number between 0 and 377; it corresponds to the
1887              entry  in  the  color map that is to be edited.  If no number is
1888              given, this command prints out the value of the color  currently
1889              being edited.
1890
1891       load [techStyle displayStyle monitorType]
1892              Load  a new color map.  If no arguments are specified, the color
1893              map for the current technology style (e.g, mos),  display  style
1894              (e.g,  7bit),  and monitor type (e.g, std) is re-loaded.  Other‐
1895              wise, the  color  map  is  read  from  the  file  techStyle.dis‐
1896              playStyle.monitorType.cmap  in  the  current directory or in the
1897              system library directory.
1898
1899       save [techStyle displayStyle monitorType]
1900              Save the current color map.  If no arguments are specified, save
1901              the  color  map  in  a file determined by the current technology
1902              style, display style, and monitor  type  as  above.   Otherwise,
1903              save  it  in the file techStyle.displayStyle.monitorType.cmap in
1904              the current directory or in the system library directory.
1905
1906

DIRECTIONS

1908       Many of the commands take a direction as an argument.  The valid direc‐
1909       tion  names  are north, south, east, west, top, bottom, up, down, left,
1910       right, northeast, ne, southeast, se, northwest, nw, southwest, sw,  and
1911       center.   In some cases, only Manhattan directions are permitted, which
1912       means only north, south, east, west, and their synonyms, are allowed.
1913
1914

LAYERS

1916       The mask layers are different for each technology, and are described in
1917       the  technology manuals.  The layers below are defined in all technolo‐
1918       gies:
1919
1920       *      All mask layers.  Does not include special layers like the label
1921              layer and the error layer (see below).
1922
1923       $      All layers underneath the cursor.
1924
1925       errors Design-rule violations (useful primarily in the see command).
1926
1927       labels Label layer.
1928
1929       subcell
1930              Subcell layer.
1931
1932       Layer  masks  may  be  formed  by constructing comma-separated lists of
1933       individual layer names.  The individual layer names may be abbreviated,
1934       as  long  as  the  abbreviations  are unique.  For example, to indicate
1935       polysilicon and n-diffusion, use poly,ndiff or ndiff,poly.  The special
1936       character  -  causes  all  subsequent  layers to be subtracted from the
1937       layer mask.  For example, *-p means  ``all  layers  but  polysilicon''.
1938       The special character + reverses the effect of a previous -; all subse‐
1939       quent layers are once again added to the layer mask.
1940
1941

SEE ALSO

1943       ext2sim(1),   ext2spice(1),   cmap(5),   dstyle(5),   ext(5),   sim(5),
1944       glyphs(5), magic(5), displays(5), net(5)
1945
1946       Online documentation can be found at the following URLs:
1947       http://opencircuitdesign.com/magic/
1948       http://vlsi.cornell.edu/magic/
1949       The  OpenCircuitDesign  website contains HTML versions of all the docu‐
1950       mentation found in the Magic "doc" subdirectory,  including  tutorials,
1951       technology file manual; download, compile and install instructions, and
1952       command reference.
1953
1954

FILES

1956       ${CAD_ROOT}/magic/sys/.magicstartup file to create default macros
1957       ~/.magic            user-specific startup command file
1958       ${CAD_ROOT}/magic/nmos/*some standard nmos cells
1959       ${CAD_ROOT}/magic/scmos/*some standard scmos cells
1960       ${CAD_ROOT}/magic/sys/*.cmapcolormap files, see CMAP(5) man page
1961       ${CAD_ROOT}/magic/sys/*.dstyledisplay style files, see DSTYLE(5) man page
1962       ${CAD_ROOT}/magic/sys/*.glyphscursor and window bitmap files, see GLYPH(5) man page
1963       ${CAD_ROOT}/magic/sys/*.techtechnology files, see ``Maintainer's Manual
1964                           #2: The Technology File''
1965       ${CAD_ROOT}/displaysconfiguration file for Magic serial-line displays
1966
1967       CAD_ROOT variable.  If the shell environment variable CAD_ROOT is  set,
1968       Magic   uses   that   location   instead   of  the  installed  location
1969       (/usr/local/lib, by default).  Normally one  would  change  the  search
1970       path (see below) rather than redirect the entire CAD_ROOT location.
1971
1972       Search  path.   Magic's  system  and  library files, such as technology
1973       files  and  display-style   files,   normally   are   placed   in   the
1974       ${CAD_ROOT}/magic area.  However, Magic first tries to find them in the
1975       user's current directory.  This makes it easier for an individual  user
1976       to  override installed system files.  The search path is defined by the
1977       Magic command path,
1978
1979

AUTHORS

1981       Original:  Gordon Hamachi, Robert Mayo, John Ousterhout, Walter  Scott,
1982       George Taylor
1983
1984       Contributors:   Michael Arnold (Magic maze-router and Irouter command),
1985       Don Stark (new contact scheme, X11 interface,  various  other  things),
1986       Mike Chow (Rsim interface).  The X11 driver is the work of several peo‐
1987       ple, including Don Stark, Walter Scott, and Doug Pan.
1988
1989       Developers:  Ongoing development (magic version 6.5  and  higher)  made
1990       possible by Stefanos Sidiropolous, Tim Edwards, Rajit Manohar, Philippe
1991       Pouliquen, Michael Godfrey, and others.
1992
1993       Many other people have contributed to Magic, but it  is  impossible  to
1994       list them all here.  We appreciate their help!
1995

BUGS

1997       If  Magic  gets  stuck for some reason, first try typing Control-C into
1998       the terminal window (in the Tcl/Tk version, this is the original termi‐
1999       nal,  not  the  Tk  console  window).  Most of Magic's lengthy database
2000       searches are interruptible.  If this doesn't work,  kill  the  process.
2001       The  Tcl/Tk  version automatically creates periodic backups that may be
2002       recovered with "magic -r".
2003
2004       Report bugs to magic-dev@csl.cornell.edu.  Please be specific: tell  us
2005       exactly what you did to cause the problem, what you expected to happen,
2006       and what happened instead.  If possible send along small files that  we
2007       can  use  to reproduce the bug.  A list of known bugs and fixes is also
2008       available from the above address.  Tell us which version of  magic  you
2009       are running.
2010
2011
2012
20134th Berkeley Distribution                                             MAGIC(1)
Impressum