EXT2SPICE(1)

NAME
ext2spice - convert from .ext format to .spice format

SYNOPSIS
ext2spice [ - d defs ] [ -mnNs ] [ -c cmin ] extfile DESCRIPTION

ext2spice reads a file in .ext format and creates a new file in .spice format. The output consists of a list of subcircuits, containing capacitors and transistors. Each .ext file is transformed into a spice subcircuit. The transistor specifications include areas and perimeters of source and drain regions (AS AD PS and PD spice parameters). In order to obtain accurate areas and perimeters, the user may have to alter the extract section of the magic technology file (see below).

Any node name ending in the character '!' is assumed to be universal. Thus, ext2spice will electrically connect the node 'Vdd!' in one cell to the node 'Vdd!' in all other cells, whether or not they are physically connected. Identically named nodes that do not end in '!' will only be shorted together if they are present in the same instance of the same cell.

The user can control what identification number ext2spice gives to any particular transistor. The program looks to see if the gate argument is of the form Mx[xx..] where x's are integers. If that is the case, then in the .spice file, the fet will be identified by Mx[xx..]. In order to get magic to place a gate argument in the .ext file, a label must be placed within the channel region of the fet, and the label must end with the character '^'. For example, the label 'M12^' would cause the attached transistor to be identified as 'M12'. A transistor whose identification number is not specified will be issued one by ext2spice.

The user can also specify which terminal of the transistor is the source, and which one is the drain. In this case, at least one terminal attribute must be 'S' or 'D'. Both terminals may be labeled, but one is sufficient. In order for magic to place terminal attributes in the .ext file, the label 'S$' or 'D$' must be placed on the junction between the channel and the diffusion.

When merging parallel transistors (see -m below) it is sufficient to label only one of the transistors in order to specify the identification number and source-drain orientation of the merged transistor. However, both Mx and S or D labels should be placed on the same transistor. S or D labels on transistors other than the one(s) with Mx labels may be lost during the merging process.

The possible options are:

-m  Merge parallel transistors (if they have the same gate length) into an equivalent, wider transistor.

-n  Print all of the node names with their node numbers at the end of each subckt definition.

-N  Print all of the node names with their node numbers into a separate .names file. (-n and -N are mutually exclusive).

-s  Use the string (alphanumeric) nodenames generated by magic instead of using node numbers. This option overrides node numbers defined in the "defs" file.

-c  Do not output capacitors that are less than cmin femptoFarads. Default cmin is 1.0 femptoFarads.

-d  "defs" is a definitions file. Within the defs file, the user may place the following commands, on separate lines:

The path command:

    path directorypath

Tells ext2spice in which directories to look for .ext files. ext2spice will look through each directory in the listed order, until it finds the .ext file. Directory names MUST BE SEPARATED BY BLANK CHARACTERS. Eg:

    path . ~burstein/magic ~burstein/magic/comp ~burstein/magic/opamp

The set command:

    set nodename number

causes the node with the label nodename to have the nodenumber "number" in the spice file. For example:

    set GND! 0

    set input 7

would set the node with the label 'GND!' to 0, and the node with the label 'input' to 7. In cmos, there are two special nodes, defined in the magic technology file which represent the bulk (substrate) connection of the transistors. (NMOS and PMOS are commonly used names). Generally, the user should SET THESE NODES TO THE SAME NODE as GND and Vdd.

The def command:

    def exttrans spicetrans flavor

specifies spice model name and flavor (n or p) for a fet.

For example:

    def pfet PMOS p

    def nfet NMOS n

would cause the transistors identified as 'pfet' in the .ext file to have model name 'PMOS' is the .spice file. Likewise, 'nfet' transistors get the The user must specify the actual model. It is necessary to specify the flavor so the program knows which type of diffusion to include in the source and drain area and perimeter calculations.

Two other commands - nrclass and prclass - tell ext2spice which resistance classes (as specified by the magic technology file) correspond to layers which contain pdiffusion and ndiffusion. (They are called resistance classes because magic thinks it is extracting areas and perimeters to calculate resistance. Instead, ext2spice uses it as part of the spice transistor description.) These commands have the form:

    parea k

    narea k

where k is an integer specifying the first or second or third ... resistance class. The default for narea is 1; for parea, 2.

Thus, if you use the defaults, the resist section of the extract section of the magic technology file should start with:

    resist ndiff,ndc/active xxxxxx

    resist pdiff,pdc/active xxxxxx

where xxxxxx is some resistance value (which is irrelevant to ext2spice since it ignores resistance).

IMPORTANT NOTE:
Since spice will be modeling the gate capacitance and the source and drain area and perimeter capacitances, it would be redundant to include them as lumped capacitances . Therefore, it is best to set the ndc, ndiff, ntrans, pdc, pdiff, and ptrans area and perimeter capacitances to 0 in the magic technology file.

SEE ALSO
magic(1) spice(1) ext(5)

AUTHOR
Andy Burstein burstein@zabriskie.berkeley.edu

BUGS
Diffusion areas that overlap between cells might not be measured correctly. Report bugs to burstein@eros