Basics

A schematic is a graphical display of an electrical circuit. It is designed in a way that it is easy understandable with the human eyes. It is not designed to be easy readable for machines and computer software. Most electrical simulator cannot work with graphical schematics and need a text based netlist as input. A netlist concentrates all relevant information of a schematic as simple text. A wide range of different netlist formats exist. There is not a general standard format supported by all tools. But most simulators support a handful different netlist formats.

Using defined Netlist Formats

A text based netlist can be automatically created from a graphical schematic. Once the setup is done, netlist generation from a schematic can be simply done by using the SaveAs feature. Alternatively the generated netlist can be displayed in the included TextEditor by calling the related menu entry. The SchematicEditor comes with a setup for some common netlist formats. While it's possible for a netlist to be generated without any setup, some smaller adjustments are often required. To perform these adjustments you need to understand the way the netlist is generated.

Generating Netlists - Concept

A netlist concentrates all relevant information of a schematic. This includes a description of its components and how the components are connected. Netlists for simulations also include information about what and how to simulate the circuit. The first step for a netlist generation is the extraction of a list of all components and its connections. This information will be added to a netlist template in a formal way. All existing templates for different netlist formats can be viewed and edited via the SetupDialog. New formats can be easily added. A typical netlist template looks like this:

*spice $filename export from LayoutEditor

$groundnode(0)

*start of netlist
$netlist(spice)
*end of netlist

*required models
$model(spice)

The formal netlist generation works this way: Any expression starting with '$' from the template definition is evaluated and passed to the resulting netlist. For example, $filename will be replaced by the actual filename from which the netlist was extracted. $netlist(type) will be replaced by a list of all components in the schematic. The output formatting specified by type is used for each component. Expression containing a '$' in that component output will be replaced as well. So that the above shown definition may result in a netlist like this:

*spice layout/example/doubler/doubler.les export from LayoutEditor

*start of netlist
XU3 VSS VDD 2 4 INV_X1
XU2 VSS VDD 3 2 INV_X1
XU1 VSS VDD IN 3 INV_X1
XU4 VSS VDD IN 4 OUT AND2_X1
*end of netlist

*required models
.include layout/library/openCellLibrary/spicemodel.sp

The component specific netlist information is stored with each component. With the Edit Component feature you can define unlimited different netlist information for any component. The information is split into the pure netlist information which is listed once for each component in the schematic and a model information which is listed once for each type of the component. Exporting the netlist is done via the save as feature in the schematic or can be viewed via the utilities menu. The netlist body is defined in the setup dialog of the LayoutEditor as explained in the previous section.

Generating Netlists - Reference

An overview of all supported expression in a netlist:

Global Expressions
Expression Meaning
$groundnode(name) how the ground node will be named. If not defined, 0 is used
$model(type) all models of the current sheet for type, which will be generated from the data of all used components. The source for this data can be set with the EditComponent feature. Identical models in the component data will only be added once. If the model section in the component data for this type is empty no data will be added to the netlist.
$netlist(type) netlist of the current sheet for type, which will be generated from the data of all used components. The source for this data can be set with the EditComponent feature. Data is added for each component placement. If the netlist section in the component data for this type is empty no data will be added to the netlist.
$filename filename
$notEmpty(expression;value) value is printed, if expression is not empty
$empty(expression;value) value is printed, if expression is empty
$LTSpiceLib The path to the shipped LTspice library folder on the current system is displayed. An empty string is returned when the library is not found.
Sheet Expressions
Expression Meaning
$nodes(format[;separator]) outputs all nodes of this sheet. The optional separator is added in between.
$internalnodes(format[;separator]) outputs all nodes of this sheet, which are not connected with a port. The seperator is optional.
$ports(format[;separator]) outputs non global ports of this sheet.The seperator is optional.
$allports(format[;separator]) outputs all ports of this sheet. The seperator is optional.
$globalports(format[;separator]) outputs all global ports of this sheet. The seperator is optional.
$sheetname name of the sheet
Port/Node specific Expressions
Expression Meaning
$nodeName the name of the node
$nodeNum unique node number
$portType type of the port
$portTypeVHDL type of the port in VHDL notation
$portTypeVerilog type of the port in Verilog notation
Component specific Expressions
Expression Meaning
$parameters(format) output all component parameters in that format $parametername and $parametervalue can be used
$node(port) node name which is connected with port
$devicename devicename
$name_of_the_parameter value of "name_of_the_parameter"
$parametername_num name of the parameter in position 'num'
$librarypath path of the library the component belongs to
$sci(name_of_parameter) scientific notation of the parameter, units will be removed e.g. a 1.1MOhm will output a 1.1E6
$eng(name_of_parameter) engineering notation of the parameter, units will be remove e.g. a 1.1e6Ohm will output 1.1M
$addspace(name_of_parameter) add a space after any number, e.g 1.1M will replace by 1.1 M (introduced with version 20120824)
Commands
Expression Meaning
$commandChar(port) set the command character, changes the $
$parameterStartChar changes the parameter start character
$parameterEndChar changes the parameter end character
$parameterSeparationChar changes the parameter seraration character

Example for changing command characters:

$commandChar(@)
@parameterStartChar({)
@parameterEndChar{})
@parameterSeparationChar{:}

*new command will look
@netlist{spice}
*no longer working: $netlist(spice)