A device template is a device block with special syntax that allows text substitution. The Template line in a device block will read the referenced template while performing the substitutions. A template can be used to save common keywords associated with a class of device, for example MOS transistors, that may have several styles in a process,
The substitution text replaces forms like ``$(_N)'', where N is a positive integer. This indicates that the text of the N'th argument in the Template line will replace this form. Any macros or technology file variables found in the line will also be expanded at this time.
The first line of a device template consists of the keyword DeviceTemplate, followed by a name for the template. The template name can be just about any text word, and is used to reference the template. The final line of the template contains the keyword End. Intervening lines are the same as device block lines, with substitution sequences where needed. The Device keyword need not appear.
Device templates can bo defined in the technology file, or in a file named ``device_templates'' found in the current directory or library path. A default device_templates file is provided in the startup directory in the installation area. This contains two example templates: NmosTemplate and PmosTemplate. These provide generic recognition of MOS transistors. When a technology file is written with the Save Tech button in the Attributes Menu, only the device templates originally read from the technology file will be included. Device blocks will be written with the Template lines expanded.
Here's part of a device template definition.
Here's a device block in the technology file.
Template mostmpl nmos active_layer&poly_layer
Here's the post-substitution device block.