The device library file handles ``global properties''. These properties appear at the beginning of the file, after the initial line but before the definitions. The syntax is
Property identifier stringwhere Property appears literally, identifier is a keyword or equivalent integer as described below, and the rest of the line constitutes the string. There can be any number of these lines.
The following properties are recognized:
The string consists of a SPICE key letter for a device (such as `R' for a resistor), followed by the name of a parameter known to SPICE for that device. While a SPICE deck is being created, and if this property was given, each device in the circuit that is keyed by that letter will trigger the addition of a line in the SPICE file in the form
.save @name[param]The name is the name of the device, and the param is the parameter name given in the property. This construct forms a vector name which the directive ensures will be saved during simulation, and thus be available for output. This is the means by which device parameter data are made available by default in SPICE runs initiated from SPICE output generated by Xic. WRspice and other SPICE3-derivative simulators will recognize this form, however only WRspice will actually save the vector in interactive mode. SPICE3 ignores .save lines, except in batch mode.
This property is used in the supplied device.lib file, for current sources and the ``c'' (current) parameter. The branch property for current sources references ``@name[c]'', so that it is important to ensure that this vector is saved. Thus, the appropriate global property is
Property SpiceDotSave I cThis will produce lines in the SPICE output like
Property 20 I c
.save @isource[c]for a current source named isource.
This property is used for providing a default node name for the last node listed in a SPICE output device line. This allows the use of a three-node MOS device, with the substrate node connected automatically. The feature is enabled by adding the following property line at the top of the device library file:
Property DefaultNode device_name num_nodes node_name
Property 21 device_name num_nodes node_name
The parameters are:
device_name: name of device (e.g., nmos) num_nodes: number of nodes expected by SPICE node_name: name of node to be added
Property 21 nmos 4 NSUB
A Property line should be added for each device which has a default node. The respective device descriptions in the device library file should also be modified to remove the substrate mode. The supplied device.lib file contains MOS models with this feature included, and also standard models.
Using the example above, a SPICE output deck will contain lines like
M1 1 2 3 NSUB ...Also, there will be a line added at the top of the deck:
.global NSUBThis line tells WRspice to not modify this node name during subcircuit expansion. The user must explicitly add a connection to the global node, usually to a voltage source. This can be accomplished in Xic by placing a terminal device, and modifying the terminal name to the node name (NSUB).
Although still recognized, this property is obsolete and should not be used. The DeviceKeyV2 property syould be used instead.
There is an internal table of mappings from letters to devices, in accordance with the definitions and traditions of SPICE. For example, `r' (case insensitive) maps to a resistor device. It is possible to define new device keys, overriding the defaults. It is also possible to define multi-letter keys.
These keys apply when Xic reads a SPICE file and maps devices to those found in the device.lib file.
The format for the property specification is
Property DeviceKey prefix opt val nnodes nname pname
Property 22 prefix opt val nnodes nname pname
This is an extended version of the now-obsolete DeviceKey property that supports current-controlled sources and switch, and will allow any number of optional nodes. The older format is still recognized, but can not be used to create standard keys for these devices.
The format for the property specification is
Property DeviceKeyV2 prefix min max devs val nname pname
Property 23 prefix min max devs val nname pname
The internal table provides the following defaults.
The user working with MOS technology may need to understand and set this property for ``m'' (MOS) devices. For LVS, is is required that the electrical and physical MOS devices assume the same number of nodes. The device library provides a choice of three-terminal (nmos, pmos) and four-terminal (nmos1, pmos1) devices. Although either type of device can be placed in a schematic that is used for simulation, for comparison to the physical layout consistency is required with the MOS device extraction templates defined in the technology file Device blocks (see 16.8.1).
For consistency, there are two choices:
Three and four terminal devices of the same sex can not be mixed in physical extraction, however they can be different for p and n devices. For example, in a process where only the pmos devices reside in a defined ``tub'', it might be convenient to use three-terminal nmos devices, and four terminal pmos devices. In this case, the technology file should define extraction devices for a three-terminal ``nmos'', and four terminal ``pmos1''. The standard device.lib file should include the line
Property DeviceKeyV2 m 4 4 0 false nmos pmos1
and the user should remember to use the three-terminal nmos and four-terminal pmos1 library devices exclusively in schematics that will be used with physical data.
The !devkeys command dumps the current keys to the console window, which can be useful for debugging this capability.