Working with a SPICE Netlist
The SPICE netlist is a textual representation of the circuit. It must include all necessary components with parameters, component models, connections, and types of analysis. It is the SPICE netlist that is processed by the simulation engine. The graphical representation of the schematic is used to simplify the creation of the netlist from the user's work when simulating. Because the netlist is created automatically when designing the schematic, there is no need to create it manually, and that simplifies the process and reduces potential errors.
The specification of components and connections requires a special syntax to describe the circuit. Despite the complexity of the method, it has its advantages – it allows you to work directly with and simulate from a netlist, as well as from a schematic.
Creating a Netlist
To generate the simulation netlist from your current schematic, select Simulate » Generate Netlist from the menus. To create a new, empty netlist, select the File » New » Mixed-Signal Simulation » AdvancedSim Netlist command from the menus.
To understand the content, consider an example netlist shown below that matches the schematic shown beneath it.
- Lines with an asterisk
*
at the beginning are comments, used as an auxiliary text CC11 0 NetC11_2 100nF
is the component description, where:CC11
component designation0 NetC11_2
– nets that the component's pins are connected to; in this example, the first pin of the capacitor is connected to theGND (0)
circuit, the second toNetC11_2
100nF
– component value
VV6 NetC14_2 0 DC 0 PULSE(0 5 100n 10n 10n 400n 1u) AC 1mV 0
– signal source description:VV6
– component designationNetC14_2 0
– component connection pinsDC 0 / AC 1mV / 0
– signal source parameters: DC, AC, phasePULSE(0 5 100n 10n 10n 400n 1u)
– output signal parameters: Initial Value, Pulsed Value, Time Delay, Rise Time, Fall Time, Pulse Width, Period
.PRINT =1 NetC13_1 NetC14_2
– command to show signals in the form of a plot*Selected Circuit Analyses
:.TRAN 1 10u 0 1
– selected type of calculation (transient calculation) and calculation parameters (start time, end time, step)
*Models and Subcircuits
:.model PMOSFET_Level1 pmos (Level=1)
– link to the transistor model used
.END
– end of the document
To run a simulation directly from an open netlist, select the Simulate » Run command from the main menus (shortcut: F9).
Areas of SPICE User Code
Areas of user SPICE-code is a mechanism for transferring Mixed Sim simulator commands from the circuit to the netlist. This mechanism is used to quickly prototype sections of the circuit, which enables whole SPICE code sections to be defined directly on the circuit, such as model definitions, parameters, and simulator instructions for calculations.
To define the area of user SPICE code:
- Add a Text Frame object on the schematic.
- Add the
.nsx
text as the first line in the text frame. - Below the
.nsx
line, write SPICE code according to SPICE syntax requirements.
When generating a netlist, an area will appear containing text from the custom SPICE code section.
Within a schematic sheet, you can define as many areas of the user SPICE code as needed. All areas will be combined into a single block in the netlist.