Magic-7.3 Command Reference

#

## port

Declare a label to be a subcircuit port, or manipulate port parameters.

### Usage:

> port option

> > where option may be one of the following:
> > index directions
> >   Declare a label to be a port with order number index and with allowed connection directions specified by the list directions. This is equivalent to the make option, except that the index and direction must be specified.
> > class [type]
> >   Get [set] port class type (see Summary, below).
> > use [type]
> >   Get [set] port use type (see Summary, below).
> > index [number]
> >   Get [set] port number
> > equivalent [number]
> >   Make the port equivalent to the (other) port numbered number.
> > connections [directions]
> >   Get [set] port connection directions
> > make [index] [directions]
> >   Declare a label to be a port with order number index and with allowed connection directions specified by the list directions. If not specified, the index is set to the first unused number, starting with 1, and the direction defaults to the direction of the label text. That is, if the label text is drawn to the right of the port, then connections are allowed to the right side of the port.
> > remove
> >   Turn a port back into an ordinary label, removing all of its port properties.
> > help
> >   Print help information

### Summary:

> The port command turns labels into ports and manipulates the properties of those ports. The port command gives magic some understanding of "standard cells". A cell definition that contains declared ports is treated specially by the extract, ext2spice, lef, and def commands. All other commands interpret ports as ordinary labels. ext2spice only interprets ports specially if the option ext2spice subcircuits on is enabled. Cells that contain port labels are assumed in these cases to be standard cells, that is, cells which are pre-characterized, and for which the layout is not to be interpreted as a physical circuit. When writing SPICE output, a cell containing port labels that is a descendent cell of the top-level layout is written as a subcircuit call, that is, an "X" record. If the top-level cell in the layout contains ports, then the SPICE output is written as a subcircuit definition, that is, wrapped in a ".subckt . . . .ends" pair. For LEF files, a cell that contains ports is written as a macro cell, and the ports are the declared PINs of the macro. For DEF files, a cell that contains ports is written as a COMPONENT.

> The "index" property of the port is used only when the cell is written into a SPICE deck as a subcircuit entry, when the ext2spice subcircuit on option is enabled (which it is by default). In that case, the subcircuit call parameters (nodes) are written in the order of the port indices, which are then assumed to match the definition for the subcircuit. Likewise, if the circuit is written as a subcircuit to a SPICE file, the order of parameters in the subcircuit definition will match the order of the port indices. Note that the actual port numbers are ignored; the port values will be written in ascending order starting with the lowest numbered port and ending with the highest numbered port.

> The "direction" property of the port has no particular meaning to magic but may be used by other programs to control the allowed direction of routes into a standard cell.

> The "class" and "use" properties of the port have no internal meaning to magic but are used by the LEF and DEF format read and write routines, and match the LEF/DEF CLASS and USE properties for macro cell pins. Valid classes are: default, input, output, tristate, bidirectional, inout, feedthrough, and feedthru. Valid uses are: default, analog, signal, digital, power, ground, and clock.

### Implementation Notes:

> port is implemented as a built-in command in magic.

### See Also:

> label
> lef

Return to command index

Last updated: October 16, 2004 at 2:10pm