Devices can be either primitive devices as used by SPICE, or subcircuit macros. If the device represents a subcircuit macro, the name of the subcircuit is given as a model property, and that subcircuit must exist in one of the model library files. For example, a device named ``opamp'' could be added to the device library file. Then the user would set the model property to something like ``ua741'' which would have a subcircuit definition somewhere in the model library files (perhaps in a directory containing SPICE models obtained from a semiconductor manufacturer).
There are four classes of device that may appear in the device library file. The first class consists of basic elements such as resistors, capacitors, and semiconductor devices which have physical implementations in a layout and are known elements in SPICE. The second class consists of voltage and current sources, which are known elements in SPICE but do not have physical equivalents in a layout. The third class applies to macros, which expand to a subcircuit in SPICE. These may or may not have an actual physical embodyment. The fourth class are terminals, which are used in the electrical schematic to provide connections. These are not used in SPICE, but are used to establish connectivity when producing SPICE input. They have no direct physical implementation, but imply physical connections.
The first line of the file must be in the form
(Library filename);This is the signature used in all library files.
Comment lines, which are ignored when the file is parsed, begin with the `#' character, and can appear anywhere outside of the device definitions except on the first line. Lines containing only white space are ignored.