#

## select

Select or unselect portions of the layout according to the options, or create a new cell definition from a selection.

### Shortcuts:

> Key macro , (comma) implements the command select clear.
> Key macro s implements the command select.
> Key macro S implements the command select more.
> Key macro Control-S implements the command select less.
> Key macro a implements the command select visible.
> Key macro A implements the command select more visible.
> Key macro Control-A implements the command select less visible.
> Key macro i implements the command select cell.
> Key macro I implements the command select more cell.
> Key macro Control-I implements the command select less cell.

### Usage:

> select option

> > where option may be one of the following:
> > [more | less] [layers] [at x y]
> >   [De]select material under cursor or indicated position, or [de]select a subcell if the cursor or indicated position is over space.
> > nocycle [layers] [at x y]
> >   Select material without cycling through different tile types when "select" is called from the same cursor position or indicated coordinate more than once.
> > [do | no | simple] labels
> >   Set policy for copying labels during a network selection.
> > [more | less] area [layers] [pattern]
> >   [De]select all material under box in layers layers. The optional glob-style matching pattern pattern will select or deselect any labels according to the pattern.
> > [more | less] visible [layers]
> >   [De]select all visible material under box in layers layers.
> > [more | less] box [layers]
> >   [De]select material specified by the boundary of the cursor box
> > [more | less] chunk [layers]
> >   [De]select a network chunk (largest rectangle) specified by the lower left corner of the cursor box
> > [more | less] region [layers]
> >   [De]select a network region specified by the lower left corner of the cursor box
> > [more | less] net [layers]
> >   [De]select an entire electrical network specified by the lower left corner of the cursor box
> > [more | less] cell [name]
> >   [De]select the cell under cursor, or the cell use (instance) named name.
> > top cell
> >   Select the topmost cell in the window, which does not have an instance name and therefore cannot be selected with the select cell command.
> > save cell
> >   Save selection as cell named cell, which is also saved to disk as cell`.mag`.
> > intersect [~]layer
> >   Keep only the selected paint that intersects with layer. Used with "~" or "!" in front of the layer, keep only the selected paint that does not intersect with layer.
> > clear
> >   Clear selection
> > pick
> >   Remove the selection from the layout, but retain the selection buffer for interactive processing.
> > flat
> >   Flatten the contents of the selection buffer.
> > keep
> >   Copy the selection from the layout into the selection buffer, and keep the selection buffer for interactive processing.
> > move [ x y ]
> >   Move the selection buffer to position x y, relative to the cell definition origin. If x and y are not given, the move the selection buffer so that its lower left corner is at the current pointer position.
> > bbox
> >   Return the bounding box of the selection.
> > feedback [ style [ text ]]
> >   (From Magic version 8.1.35) Copy the selection into a feedback area for permanent display (until removed using "feedback clear"). The selection will be displayed in style "style", which is one of the styles defined in the graphics style file (e.g, colors like "orange", "white"; layout styles like "pwell"; or technical styles like "vert_highlights"). The text is attached to the highlight for querying using the "feedback why" command.
> > short label1 label2
> >   (From Magic version 8.0.105) Find the path that electrically connects (shorts) the nodes labeled "label1" and "label2". Note that this is a simple tile-based search, so the highlighted path may show only parts of wires, and may extend past points where the path turns, but it will find a valid path if one exists.
> > help
> >   Print help information

### Summary:

> The select command changes what material is in the current selection. magic maintains a separate cell definition that represents the current selection. Without the options more or less, the selection is cleared prior to executing the new selection command. Otherwise, more adds to the existing selection and less subtracts from it.

> Network selection differs from other types of selection in that magic uses a sophisticated algorithm to determine what is electrically connected together throughout the layout. A chunk is the largest rectangle containing a single layer type. A region is the largest network area containing a single layer type. The region stops where the net connects to a different layer type. The net is the entire electrical network.

> The select labels option sets the policy for the selection of labels when doing a region or network selection. The options are select do labels, which is the default behavior, select no labels, and select simple labels. The default behavior is to copy all labels into the selection, but create hierarchical names for any labels found in subcells by prepending the subcell instance name in front with a slash ("/") character separator, in the same way as hierarchical net names are generated in flattened SPICE output. This allows a network selection to be copied without causing name collisions among labels in subcells, and is the "safe" option. However, such labels are often long and clutter up the layout. The no labels option selects a network without selecting any labels at all. The simple labels selects labels in subcells but does not expand them into hierarchical names.

> The select save option differs from the rest in that it does not alter the current selection, but creates a new cell definition from the current selection. Note that this cell is created as a top-level cell, and does not replace the current selection as a use in the edit cell. To do that requires "select save cell" followed by "delete" and "getcell child 0 0 parent 0 0". The last command syntax is used because the bounds of the selection may differ from the cursor box.

> The select intersect function allows the manipulation of the selection using boolean operators that are much like the ones used in reading and generating GDS files. select intersect layer computes the value of the selection AND layer and replaces the selection with the result. select intersect ~layer computes the value of the selection AND-NOT layer and replaces the selection with the result.

> The select short function finds an electrical connection between two labeled points. It works by starting a "select net" net search at the first label, continuing until it reaches the second label, and then pruning back any branches of the search not directly connecting the two points.

> The select bbox function is useful when some command that only operates on the contents of the cursor box needs to be applied to the area of a selection. It returns the coordinates of the bounding box of the selection. The cursor can be set to this using the Tcl command box values {*}[select bbox]. select bbox returns values in internal coordinates, so be sure to set the snap spacing to snap internal before doing this.

> The remaining options such as pick, clear, and flat all operate on the selection buffer without clearing the contents of the buffer. They are used primarily by the "pick tool" for interactive copy and paste functions. The following command sequence creates a new cell from the selection and replaces the selected material with the new cell:

> > select pick
> > select save cellname
> > getcell cellname

> The following sequence flattens cells within a layout. This differs from both the "flatten" and "dump" commands by being able to flatten a group of cell uses, and being able to directly replace the existing cell with the flattened paint. In effect, it is the reverse of the operation above.

> > select pick
> > select flat
> > select keep

### Implementation Notes:

> select is implemented as a built-in command in magic. The select keep, select move, and select pick are interactive functions used by the "pick" tool.

### See Also:

> flatten
> dump
> tool (Tcl script version)

### Bugs:

> To be consistent, select save should be a separate command, since like other commands it operates on the selection rather than alter what is in the selection.

Return to command index

Last updated: October 9, 2021 at 1:59pm