============== Netlist Syntax ============== ------------- Netlist lines ------------- Like with SPICE, a netlist description is organized in lines. The syntax for the symbolic simulator is SPICE compatible. Since there exist various SPICE dialects, and since symbolic simulation requires a more complex handling of parameters in sub circuits and models, the correct SLiCAP netlist syntax has been described in the following sub sections. Breaking long lines ------------------- Long input lines can be split into a multiple of shorter lines. Lines starting with a plus sign ``+`` will be added to the previous line; without the plus sign itself. Leading and trailing white space characters of netlist lines are ignored. Comment ------- Any line starting with an asterix: ``*`` is considered as comment and will not be processed by the netlist parser. Any input following a semicolon ``;`` is also considered as comment and ignored. Numbers ------- Numeric values can be given in scientific notation: ``0.001 = 1E-3 = 1e-3`` or use metric prefixes: ``2.2k = 2200``. The following metric prefixes can be used: .. csv-table:: SLiCAP metric prefixes :header: "name", "Symbol", "Base 10 value" :widths: 50, 10, 20 "peta", "P", :math:`10^{15}` "tera", "T", :math:`10^{12}` "giga", "G", :math:`10^{9}` "mega", "M", :math:`10^{6}` "kilo", "k", :math:`10^{3}` "mili", "m", :math:`10^{-3}` "micro", "u", :math:`10^{-6}` "nano", "n", :math:`10^{-9}` "pico", "p", :math:`10^{-12}` "femto", "f", :math:`10^{-15}` "atto", "a", :math:`10^{-18}` Please noitice these prefixes are case sentitive, and ``MEG`` and ``meg`` are not recognized as metric prefixes. This differs from the standard SPICE syntax. From version 0.4 build 1350 the expression syntax checker can handle parameter names identical to metric prefixes. Expressions ----------- As with SPICE, expressions should be placed between curly brackets: ``{< myExpression >}``. Metric prefixes as well as white space characters and line break characters: ``+``, can be included in expressions. .. _title: Title line ---------- The title definitions differs from SPICE: **The first word or double quoted string of an uncommented line of the netlist file is considered the title of the main circuit.** If a title comprises several words separated by white space characters it should be placed between double quotation marks: ``"``. Examples are listed below. .. code-block:: text * myCircuit ; a comment, not interpreted as title. * Lines with elements or directives .. code-block:: text myCircuit ; a title without spaces * Lines with elements or directives .. code-block:: text "My first circuit" ; a tittle including spaces * Lines with elements or directives .include line ------------- Library files containing model definitions and/or sub circuit definitions need to be included in the search path with the aid of the ``.include`` instruction. Multiple library definitions can be included in one ``.include`` line. Library files containing white space characters should be places between double quotation marks: ``"``. The search path for the library file is specified by the MuPAD global variable ``LIBRARYPATH`` in the ``SLiCAPini.mu`` file. Library definitions should be declared before called. A call to a library occurs if a model name or sub circuit name occurs in an element definition while that model or sub circuit is not specified by a ``.model`` or a ``.subckt`` definition in the netlist itself. Valid library specifications look like: .. code-block:: text .include myLibrary.lib "my very own circuits.lib" .. _subckt: .subckt ... .ends lines ----------------------- Although SLiCAP is intended for the design and the analysis of rather small circuits, it allows you to use an unlimited hierarchy. It also checks for hierarchical loops. The structure of a sub circuit definition is as follows: .. code-block:: text .subckt < name > + < node1 > < node2 > ( < node3 > ... ) + ( < param1 = value1 | {expr1} param2 = value2 | {expr2} > ...) * circuit lines .ends The input field ``name`` and a number of fields with the node names ``node1 node2 ...`` are required. Each parameter definition consists of a parameter name followed by an equal sign and a value or an expression. Parameter definitions should **not** be placed between brackets ``()``. Passing sub circuit parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Parameters specified in the ``.subckt`` definition line are passed to the parent circuit. Other parameters used in element expressions and in parameter definitions between the ``.subckt`` and its corresponding ``.ends`` input lines remain local. Parameter values can be numerical or may be expressions comprising other parameters. Expressions need to be placed between curly brackets: ``{< myExpression >}``. Input lines between the ``.subckt`` and its corresponding ``.ends`` instruction can be of any type. Hence, nesting of sub circuits is allowed. Below an example of a netlist file with a sub circuit definition and a call to this sub circuit. The netlist file with the name ``subckt.cir`` is stored in the project directory. Please notice that this file only demonstrates the use of sub circuits with parameters. It is not at all a complete circuit description. .. code-block:: text testCircuit .subckt myOpamp in+ in- out GND A_0 = {A_1} tau={t} R_o = 0.5k E1 1 GND in+ in- {A_0/(1+s*tau)} R1 1 out {R_o} C1 in+ in- {C_i} .param C_i=10p R_o=100 .ends X1 1 2 3 0 myOpamp tau = {t_a} R_o = 200 .param A_1 = {g_m*Z_t} t_a = 1m g_m=10m Z_t=100M .end Parameters given in the ``.subckt`` line are passed to the parent circuit. They can be redefined in the sub circuit call. Hence, ``A_0``, ``tau`` and ``R_o`` become parameters in the parent circuit. They can been assigned new values in the sub circuit call, in this example, this is the line: .. code-block:: text X1 1 2 3 0 myOpamp tau = {t_a} R_o = 200 or in parameter definition lines. In this example this is the line: .. code-block:: text .param A_1 = {g_m*Z_t} t_a = 1m g_m=10m Z_t=100M All other parameters in expressions and in parameter definitions of the sub circuit remain local. This will be done by adding the device name of the calling device as suffix to the parameter name: - For nodes a dot ``.`` will be placed between the node name and the device name. - For parameters the subscript sign ``_`` will be placed between the parameter name and the device name. All nodes except the connecting nodes and the ground node ``"0"`` are local. The results of the expansion of the above circuit can be viewed with the script below. It shows the elements and the parameters of the expanded circuit. .. code-block:: matlab clear all; initProject('passParams', mfilename); checkCircuit('subckt'); htmlPage('Circuit data'); netlist2html('subckt'); elementData2html(); params2html(); stophtml(); % This closes the circuit index page stophtml(); % This closes the project index page The HTML output shows the circuit expansion: .. figure:: /img/subCKTdata.svg :alt: Circuit data .model line ----------- Models can be defined in a line starting with the keyword ``.model`` (not case sensitive). The syntax for a ``.model`` line is: .. code-block:: text .model < modelName > < modelType > + ( < param1 = value1 | {expr1} > < param2 = value2 | {expr2} > ...) The fields ``modelName`` and ``modelType`` are required. Parameter definition fields are optional. If no parameter definitions are given, defaults values are assumed. A model name should not start with a number. This would result in misinterpretation by the netlist parser. Hence, a model name like ``2n3904`` could be interpreted as ``2e-9`` followed by ``3904`` which yields a syntax error in a value. Such errors can be prevented using a letter as first character in a model name, e.g. ``Q2n3904``. This is common practice in SPICE. Parameter definitions should not be placed between brackets ``()``. This may differ from some SPICE dialects. Passing model parameters ~~~~~~~~~~~~~~~~~~~~~~~~ Passing model parameters tworks similar as passing sub circuit parameters. This is elucidated in the example below. Consider hereto the following netlist file with a model definition: .. code-block:: text modelTest I1 0 b 1u R1 c 0 1k Q1 c b 0 0 Q2N3904 gm={I_c*q_e/(k_B*T_A)} gpi={I_c*q_e/(k_B*T_A)/beta_AC} .param I_c=2m beta_AC={beta_DC} beta_DC=100 .model Q2N3904 QV .end The model ``QV`` is that of a 4-terminal vertical bipolar transistor. It can be used for a three terminal transistor by connecting the last two terminals (emitter and substrate) to the same circuit node. The built-in model for this device has the following parameters with their default values: ``cpi = 0``, ``cbc = 0``, ``cbx = 0``, ``cs = 0``, ``gpi = 400e-6``, ``gm = 40e-3``, ``go =0``, ``rb = 0``, ``gbc = 0`` The above model definition for the ``Q2N3904`` overrides the values of ``gpi`` and ``gm``, all other parameters obtain their default value. The input resistance and the transconductance of this transistor have been redefined as a function of the collector current ``I_c``. This current has been defined in the line: ``.param I_c=2m beta_AC=beta_DC beta_DC=100`` The following code displays the circuit data on an HTML page. .. code-block:: matlab clear all; initProject('modelTest', mfilename); checkCircuit('modelTest'); htmlPage('Circuit data'); netlist2html('modelTest'); elementData2html(); params2html(); stophtml(); % This closes the circuit index page stophtml(); % This closes the project index page The HTML output below shows the netlist and the circuit expansion: .. figure:: /img/modelData.svg :alt: Model data Please notice the use of the built-in parameters ``T``, ``k`` and ``q``. .param line ----------- Parameter definition lines are used to assign numerical values or expressions to circuit parameters. At least one parameter definition should be given in a parameter definition line. The syntax for a parameter definition line is: .. code-block:: text .param < param1 = value1 | {expr1} > ( < param2 = value2 | {expr2} ... ) Parameters defined in parameter definition lines in sub circuits are local for that sub circuit unless these parameters are passed to the parent circuit. Device definition lines ----------------------- The actual circuit is specified by the device definition lines. The syntax for these lines is: .. code-block:: text < deviceID > < node1 | ref1 > < node2 | ref2 > ( < node3 > ...) > + < value | {expr} | modelName > + ( < param1 = value1 | {expr1} > < param2 = value2 | {expr2} > ...) A device definition line starts with the device identifier field: ``< deviceID >`` . The first character of name is interpreted as the device type identifier. The device type identifier is not case sensitive. An overview of device types can be found in section LINK. Other required fields are: at least two fields with node names or deviceIDs of other devices. If no ``< value | {expr} | modelName >`` field is specified, a default model with default parameter valuess is assumed. Node names and model names are case sensitive character strings. A model name is a character string that cannot be interpreted as a number. Expressions need to be placed between curly brackets: ``{}``. A coupling factor device has two references to inductors instead of two nodes. Parameter definitions can only be given in combination with a model name. If no model parameters are specified, values from a ``.model`` line are assumed. If such a line does not exist, default parameter values are assumed. .end line --------- A line starting with ``.end`` concludes the netlist input. Lines following this line are ignored. .. _devicemodels: --------------------------- Devices and built-in models --------------------------- This section gives an overview of the devices and their built-in models with their parameters. SLiCAP distinguishes two kinds of models: 1. Models that have an associated matrix stamp. 2. Models that will be expanded into models with an associated matrix stamp. Model data will be listed in tables. The fields in these tables have the following meaning: 1. ``name``: the name of the model. This name is associated with the implementation type: 2. ``type``: the implementation type of the model: a ``stamp``: a matrix stamp is associated with the model b ``expansion``: the model is expanded into elements with models that have associated matrix stamps 3. ``Ii``: ``TRUE`` if a dependent variable for an input current is added to the vector with dependent variables else: ``FALSE``. This field applies only for models with ``type=stamp``. The name of this current is the concatenation of two strings: a ``"Ii_"`` and the device name for two-port elements with model type ``H`` and ``HZ`` b ``"I_"`` and the device name for twoport elements with model type ``F`` 4. ``Io``: ``TRUE`` if an output current is added to the vector with dependent variables, else: ``FALSE``. This field applies only for models with ``type=stamp``. The name of this current is the concatenation of two strings: a ``"Io_"`` and the device name for two-port elements that have model type ``E``, ``EZ``, ``G``, ``H``, ``HZ`` or ``N`` b ``"I_"`` and the device name for one port elements with model type ``L``, ``r``, ``V`` and ``Z`` Valid model parameters and their default values are listed in the subsequent rows of the table: 1. ``param``: the name of the parameter (case sensitive) 2. ``value | {expression}``: the default value or expression for the model parameter 3. ``Laplace``: a boolean ``TRUE | FALSE`` indicating if the Laplace variable ``s`` is allowed in the device expression 4. ``description``: a description of the parameter C: Capacitor ------------ Below the syntax and the symbol for a capacitor and the matrix stamp for model C_. .. _C: Model C ~~~~~~~ .. figure:: /img/stampC.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a capacitor Figure C: Syntax, symbol and matrix stamp of a capacitor. +-------+------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================+=======+=======+=======+ | C | Linear capacitor | stamp | FALSE | FALSE | +-------+------------------+-------+-------+-------+ Parameters model C ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | capacitance | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text C1 nodeP nodeN 100n ; Capacitor of 100n between nodeP and nodeN .. code-block:: text C1 nodeP nodeN C value = 100n ; Same as above .. code-block:: text C1 nodeP nodeN {1/tau/R} ; Capacitance as an expression .. code-block:: text C1 nodeP nodeN C value = {1/tau/R} ; Same as above .. code-block:: text C1 nodeP nodeN myCap ; Same as above with a .model line .model myCap C value={1/tau/R} D: Diode -------- Below the syntax, the symbol and the small-signal model expansion for the a diode: model D_. .. _D: Model D ~~~~~~~ .. figure:: /img/modelD.svg :width: 800 :alt: Syntax, symbol and small-signal model expansion for a diode Figure D: Syntax, symbol and small-signal model expansion for a diode. +-------+--------------------------+-----------+ | name | description | type | +=======+==========================+===========+ | D | Small-signal model diode | expansion | +-------+--------------------------+-----------+ Parameters model D ~~~~~~~~~~~~~~~~~~ +-------+--------------------------+---------+---------+ | name | description | default | Laplace | +=======+==========================+=========+=========+ | gd | conductance | 1 | FALSE | +-------+--------------------------+---------+---------+ | cd | capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | rs | series resistance | 0 | FALSE | +-------+--------------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text D1 nodeA nodeC D ; Diode anode connected to nodeA cathode to nodeC and default parameters. .. code-block:: text D1 nodeA nodeC D1N4148 + gd = {q_e*I_D/K_b/T_A} + cd = {q_e*I_D/K_b/T_A/2/PI/tau_F} + rs = 25 .model D1N4148 D .param tau_F = 4n I_D = 1m E: Voltage-controlled voltage source ------------------------------------ SLiCAP has two models for voltage-controlled voltage sources: model E_ and model EZ_. The later one includes a series output impedance but has a compact matrix stamp. Models ~~~~~~ +-------+--------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+====================+=======+=======+=======+ | E | VCVS | stamp | FALSE | TRUE | +-------+--------------------+-------+-------+-------+ | EZ | VCVS with Z-series | stamp | FALSE | TRUE | +-------+--------------------+-------+-------+-------+ .. _E: Model E ~~~~~~~ .. figure:: /img/stampE.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a VCVS: model E Syntax, symbol and matrix stamp of a VCVS model E Parameters model E ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | voltage gain | 1 | TRUE | +-------+------------------+---------+---------+ .. _EZ: Model EZ ~~~~~~~~ .. figure:: /img/stampEZ.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a VCVS with series impedance: model EZ Syntax, symbol and matrix stamp of a VCVS with series impedance: model EZ Parameters model EZ ~~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | voltage gain | 1 | TRUE | +-------+------------------+---------+---------+ | zs | series impedance | 1 | TRUE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text E1 outP outN inP inN 1M .. code-block:: text E1 outP outN inP inN {1M/(1 + s/2/PI/f_-3dB)} .. code-block:: text E1 outP outN inP inN EZ + value = {A_0/(1 + s*tau)} + zs = {R_out*(1 + s*L_out/R_out} .. code-block:: text E2 outP outN inP inN simpleOpamp .model simpleOpamp EZ + value = {A_0/(1 + s*tau)} + zs = {R_out*(1 + s*L_out/R_out} F: Current-controlled current source ------------------------------------ Below the syntax, the symbol and the matrix stamp for a CCCS: model F_. .. _F: Model F ~~~~~~~ .. figure:: /img/stampF.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a CCCS: model F Syntax, symbol and matrix stamp of a CCCS model F Please notice the independent variable :math:`I_{Fx}` which is added to the vector of independent variables equals the product of the denominator of the current gain :math:`Df_s` and the input current :math:`Ii_{Fx}`, rather than the input current. +-------+------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================+=======+=======+=======+ | F | VCVS | stamp | TRUE | FALSE | +-------+------------------+-------+-------+-------+ Parameters model F ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | current gain | 1 | TRUE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text F1 outP outN inP inN 20 .. code-block:: text F1 outP outN inP inN {100/(1 + s/2/PI/f_-3dB)} .. code-block:: text F1 outP outN inP inN F value={A_i/(1 + s*tau)} .. code-block:: text F2 outP outN inP inN myCCCS .model myCCCS F value = {A_i/(1 + s*tau)} G: Voltage-controlled current source ------------------------------------ SLiCAP has two models for voltage-controlled current sources, model 'G' for a complex_ transfer and model 'g' for a real_ transfer. Model 'G' can be used for sources that need to be selected as loop gain reference variable according to the asymptotic-gain model. The transadmittance can be a function of the Laplace variable 's'. Model 'g' is intended to be used as conductance or transconductance and cannot be selected a loop gain reference variable. Models ~~~~~~ +-------+------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================+=======+=======+=======+ | G | VCGS | stamp | FALSE | TRUE | +-------+------------------+-------+-------+-------+ | g | VCGS | stamp | FALSE | FALSE | +-------+------------------+-------+-------+-------+ .. _complex: Model G ~~~~~~~ .. figure:: /img/stampG.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a VCCS: model G Syntax, symbol and matrix stamp of a VCCS: model G Parameters model G ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | transadmittance | 1 | TRUE | +-------+------------------+---------+---------+ .. _real: Model g ~~~~~~~ .. figure:: /img/stampGm.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a VCCS: model g Syntax, symbol and matrix stamp of a VCCS: model g Parameters model g ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | transconductance | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text G1 outP outN inP inN 20m .. code-block:: text G1 outP outN inP inN {1m/(1 + s/2/PI/f_-3dB)} .. code-block:: text G1 outP outN inP inN G value = {A_y/(1 + s*tau)} .. code-block:: text G2 outP outN inP inN myVCCS .model myVCCS G valu e= {A_y/(1 + s*tau)} .. code-block:: text G3 outP outN inP inN g value = 1m .. code-block:: text G3 outP outN inP inN g value = {q*I_c/k/T} H: Current-controlled voltage source ------------------------------------ SLiCAP has two models for current-controlled voltage sources: model H_ and model HZ_. The later one includes a series output impedance but has a compact matrix stamp. Models ~~~~~~ +-------+--------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+====================+=======+=======+=======+ | H | CCVS | stamp | TRUE | TRUE | +-------+--------------------+-------+-------+-------+ | HZ | CCVS with Z-series | stamp | FALSE | TRUE | +-------+--------------------+-------+-------+-------+ .. _H: Model H ~~~~~~~ .. figure:: /img/stampH.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a CCVS: model H Syntax, symbol and matrix stamp of a CCVS model H Parameters model H ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | transimpedance | 1 | TRUE | +-------+------------------+---------+---------+ .. _HZ: Model HZ ~~~~~~~~ .. figure:: /img/stampHZ.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a CCVS with series impedance: model HZ Syntax, symbol and matrix stamp of a CCVS with series impedance: model HZ Parameters model HZ ~~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | transimpedance | 1 | TRUE | +-------+------------------+---------+---------+ | zs | series impedance | 1 | TRUE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text H1 outP outN inP inN 1M .. code-block:: text H1 outP outN inP inN {1M/(1 + s/2/PI/f_-3dB)} .. code-block:: text H1 outP outN inP inN HZ + value = {R_T/(1 + s*tau)} + zs = {R_out*(1 + s*L_out/R_out} .. code-block:: text H2 outP outN inP inN simpleTransimpedanceAmp .model simpleTransimpedanceAmp HZ + value = {R_T/(1 + s*tau)} + zs = {R_out*(1 + s*L_out/R_out} I: Independent current source ----------------------------- Below the syntax, the symbol and the matrix stamp for an independent current source: model I_. .. _I: Model I ~~~~~~~ .. figure:: /img/stampI.svg :width: 800px :alt: Syntax, symbol and matrix stamp of an independent current source: model I Syntax, symbol and matrix stamp of an independent current source: model I +-------+----------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+============================+=======+=======+=======+ | I | Independent current source | stamp | FALSE | FALSE | +-------+----------------------------+-------+-------+-------+ Parameters model I ~~~~~~~~~~~~~~~~~~ +-------+--------------------------------+---------+---------+ | name | description | default | Laplace | +=======+================================+=========+=========+ | value | Current (Laplace transform) | 0 | TRUE | +-------+--------------------------------+---------+---------+ | dc | DC value [A] | 0 | TRUE | +-------+--------------------------------+---------+---------+ | dcvar | Variance of DC value [A^2] | 0 | TRUE | +-------+--------------------------------+---------+---------+ | noise | Noise current density [A^2/Hz] | 0 | TRUE | +-------+--------------------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text * Both definitions are equivalent: I1 n1 n2 1m I1 n1 n2 I value = 1m .. code-block:: text Iin 0 input I value = {I_s} noise = 1e-24 dc=10n dcvar = 4e-18 .param I_s = {1m/s}; Step of 1mA starting at t=0 J: Junction FET --------------- Like the PN diode, the JFET model J_ is expanded into network elements that have a matrix stamp. .. _J: Model J ~~~~~~~ .. figure:: /img/modelJ.svg :width: 800 :alt: Syntax, symbol and network expansion of a junction FET: model J Syntax, symbol and network expansion of a junction FET: model J +-------+--------------------------+-----------+ | name | description | type | +=======+==========================+===========+ | J | Small-signal model JFET | expansion | +-------+--------------------------+-----------+ Parameters model J ~~~~~~~~~~~~~~~~~~ +-------+--------------------------+---------+---------+ | name | description | default | Laplace | +=======+==========================+=========+=========+ | cgs | contactance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cdg | capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | gm | forward transconductance | 1E-3 | FALSE | +-------+--------------------------+---------+---------+ | go | output conductance | 0 | FALSE | +-------+--------------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text J1 nodeD nodeG nodeS myJFET .model myJFET J cgs=20p cdg=1p gm=15m go=500u K: Coupling factor ------------------ Below the syntax, the symbol and the matrix stamp for a coupling between two inductors: model K_. .. _K: Model K ~~~~~~~ .. figure:: /img/stampK.svg :width: 800px :alt: Syntax, symbol and matrix stamp of a coupling between two inductors: model K Syntax, symbol and matrix stamp of a coupling between two inductors: model K +-------+------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================+=======+=======+=======+ | K | Coupling factor | stamp | FALSE | FALSE | +-------+------------------+-------+-------+-------+ Parameters model K ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | coupling factor | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text L1 n1 n2 {L_a} L2 n3 n4 {L_b} k12 L1 L2 0.98 L: Inductor ----------- Below the syntax, the symbol and the matrix stamp for an inductor: model L_. .. _L: Model L: ~~~~~~~~ .. figure:: /img/stampL.svg :width: 800px :alt: Syntax, symbol and matrix stamp of an inductor: model L Syntax, symbol and matrix stamp of an inductor: model L +-------+------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================+=======+=======+=======+ | L | Linear inductor | stamp | FALSE | FALSE | +-------+------------------+-------+-------+-------+ Parameters model L ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | inductance | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text L1 n1 n2 {L_a} .. code-block:: text L1 n1 n2 L value = {L_a} .. code-block:: text L1 n1 n2 L myL .model myL L value = {L_a} M: 4-terminal MOS ----------------- SLiCAP has two models for 4-terminal MOS transistors. Model M_ for a single MOS transistor and model MD_ for a differential-pair MOS. The latter one facilitates the design and analysis of negative-feedback amplifiers in which one controlled source that models the gain of the differential-pair MOS can be selected as loop gain reference variable. Models ~~~~~~ +-------+------------------------------+-----------+ | name | description | type | +=======+==============================+===========+ | M | Four-terminal MOS | expansion | +-------+------------------------------+-----------+ | MD | Four-terminal diff. pair MOS | expansion | +-------+------------------------------+-----------+ .. _M: Model M ~~~~~~~ .. figure:: /img/modelM.svg :width: 800 :alt: Syntax, symbol and network expansion of a 4-terminal MOS: model M Syntax, symbol and network expansion of a 4-terminal MOS: model M Parameters model M ~~~~~~~~~~~~~~~~~~ +-------+--------------------------+---------+---------+ | name | description | default | Laplace | +=======+==========================+=========+=========+ | cgs | gate-source capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cgb | gate-bulk capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cdg | drain-gate capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cdb | drain-bulk capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | csb | source-bulk capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | gm | forward transconductance | 1E-3 | FALSE | +-------+--------------------------+---------+---------+ | gb | bulk transconductance | 0 | FALSE | +-------+--------------------------+---------+---------+ | go | output conductance | 0 | FALSE | +-------+--------------------------+---------+---------+ .. _MD: Model MD ~~~~~~~~ .. figure:: /img/modelMD.svg :width: 800 :alt: Syntax, symbol and network expansion of a 4-terminal MOS: model MD Syntax, symbol and network expansion of a 4-terminal MOS: model MD Parameters model MD ~~~~~~~~~~~~~~~~~~~ +-------+--------------------------+---------+---------+ | name | description | default | Laplace | +=======+==========================+=========+=========+ | cgg | gate-gate capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cdg | drain-gate capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | cdd | drain-drain capacitance | 0 | FALSE | +-------+--------------------------+---------+---------+ | gm | forward transconductance | 1E-3 | FALSE | +-------+--------------------------+---------+---------+ | go | output conductance | 0 | FALSE | +-------+--------------------------+---------+---------+ Examples ~~~~~~~~ Below three ways of defining a MOS in a circuit. The first example calls the mos model M with its default parameters and then overrides these parameters by local definitions in the call. The model parameter ``gm`` is passed as global parameter ``gm``. .. code-block:: text M1 D G S B M gm={g_m} gb = 150u go = 100u cgs = 0.2p cdg = 10f The second example calls the model from a library file and redefines ``g_m`` as a global parameter. .. code-block:: text M1 D G S B myMOS gm = {g_m} .include myMOS.lib The third example calls a model and its parameters. For a given process, geometry and device operating point, these small-signal parameters can be obtained from a SPICE simulation. .. code-block:: text M1 D G S B M1 .model M1 M gm = 2m gb = 150u go = 100u cgs = 0.2p cdg = 10f The next example shows the application of a differential-pair MOS. .. code-block:: text M1 D1 D2 G1 G2 myDiffPairMOS *parameters of the single MOS .param g_m = 1m g_o = 100u c_gs = 0.2p c_dg = 10f c_db = 5f *parameters of the diff. pair MOS .model myDiffPairMOS MD + gm = {g_m/2} + go = {g_o/2} + cgg = {c_gs/2} + cdg = {c_dg} + cdd = {c_db/2} N: Nullor --------- .. N_: Model N ~~~~~~~ .. figure:: /img/stampN.svg :width: 800 :alt: Syntax, symbol and matrix stamp of a nullor: model N Syntax, symbol and matrix stamp of a nullor: model N +-------+----------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+============================+=======+=======+=======+ | N | Nullor | stamp | FALSE | TRUE | +-------+----------------------------+-------+-------+-------+ Examples ~~~~~~~~ .. code-block:: text N_amp out 0 in+ in- O: Operational amplifier ------------------------ SLiCAP has two built-in models for operational amplifiers: 1. A small-signal model for a `voltage-feedback`_ operational amplifier: model OV 2. A small-signal model for a `current-feedback`_ operational amplifier: model OC Models ~~~~~~ +-------+------------------------------+-----------+ | name | description | type | +=======+==============================+===========+ | OV | Voltage-feedback OpAmp | expansion | +-------+------------------------------+-----------+ | OC | Current-feedback OpAmp | expansion | +-------+------------------------------+-----------+ .. _voltage-feedback: Model OV ~~~~~~~~ .. figure:: /img/modelOV.svg :width: 800 :alt: Syntax, symbol and network expansion of a voltage-feedback operational amplifier: model OV Syntax, symbol and network expansion of a voltage-feedback operational amplifier: model OV Parameters model OV ~~~~~~~~~~~~~~~~~~~ +------+--------------------------------------+---------+---------+ | name | description | default | Laplace | +======+======================================+=========+=========+ | cd | differential-mode input capacitance | 0 | FALSE | +------+--------------------------------------+---------+---------+ | cc | common-mode input capacitance | 0 | FALSE | +------+--------------------------------------+---------+---------+ | gd | differential-mode input conductance | 0 | FALSE | +------+--------------------------------------+---------+---------+ | gc | common-mode input conductance | 0 | FALSE | +------+--------------------------------------+---------+---------+ | av | voltage gain | 1E6 | TRUE | +------+--------------------------------------+---------+---------+ | zo | output impedance | 0 | TRUE | +------+--------------------------------------+---------+---------+ .. _current-feedback: Model OC ~~~~~~~~ .. figure:: /img/modelOC.svg :width: 800 :alt: Syntax, symbol and network expansion of a current-feedback operational amplifier: model OC Syntax, symbol and network expansion of a current-feedback operational amplifier: model OC Parameters model OC ~~~~~~~~~~~~~~~~~~~ +------+---------------------------------------+---------+---------+ | name | description | default | Laplace | +======+=======================================+=========+=========+ | cp | input capacitance non-inverting input | 0 | FALSE | +------+---------------------------------------+---------+---------+ | gp | input conductance non-inverting input | 0 | FALSE | +------+---------------------------------------+---------+---------+ | cpn | input capacitance | 0 | FALSE | +------+---------------------------------------+---------+---------+ | gpn | input conductance | 0 | FALSE | +------+---------------------------------------+---------+---------+ | gm | input stage transconductance | 20E-3 | FALSE | +------+---------------------------------------+---------+---------+ | zt | output stage transimpedance | 1E6 | TRUE | +------+---------------------------------------+---------+---------+ | zo | output impedance | 0 | TRUE | +------+---------------------------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text O1 inP inN out 0 AD8610 .model AD8610 OV + cd = 15p + cc = 8p + av = {300k*(1-s*1.3n)/(1+s*2.4m)/(1+s*1.3n)} + zo = 20 .. code-block:: text O1 inP inN out 0 LT1223 .model LT1223 OC + cp = 1.5p + gp = 100n + gm = 65m + zt = {5M/(1+s*680u)/(1+s*1.6n)} + zo = 30 Q: 4-terminal BJT ----------------- SLiCAP incorporates three models for 4-terminal Bipolar Junction Transistors (BJTs): 1. Model QV_ for a single vertical BJT 2. Model QL_ for a single lateral BJT 3. Model QD_ for a differential pair. The latter one facilitates the design and analysis of negative-feedback amplifiers in which one controlled source that models the gain of the differential-pair BJT can be selected as loop gain reference variable. Models ~~~~~~ +-------+------------------------------+-----------+ | name | description | type | +=======+==============================+===========+ | QV | Four-terminal vertical BJT | expansion | +-------+------------------------------+-----------+ | QL | Four-terminal lateral BJT | expansion | +-------+------------------------------+-----------+ | QD | Four-terminal diff. pair BJT | expansion | +-------+------------------------------+-----------+ .. _QV: Model QV ~~~~~~~~ .. figure:: /img/modelQV.svg :width: 800 :alt: SLiCAP built-in model for a 4-terminal vertical BJT: model QV SLiCAP built-in model for a 4-terminal vertical BJT: model QV Parameters model QV ~~~~~~~~~~~~~~~~~~~ +-------+-------------------------------------+---------+---------+ | name | description | default | Laplace | +=======+=====================================+=========+=========+ | cpi | internal base-emitter capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbc | internal base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbx | external base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cs | collector-substrate capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gpi | internal base-emitter conductance | 1E-3 | FALSE | +-------+-------------------------------------+---------+---------+ | gm | transconductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | go | output conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gbc | internal base-collector conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | rb | base resistance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ .. _QL: Model QL ~~~~~~~~ .. figure:: /img/modelQL.svg :width: 800 :alt: SLiCAP built-in model for a 4-terminal lateral BJT: model QL SLiCAP built-in model for a 4-terminal lateral BJT: model QL Parameters model QL ~~~~~~~~~~~~~~~~~~~ +-------+-------------------------------------+---------+---------+ | name | description | default | Laplace | +=======+=====================================+=========+=========+ | cpi | internal base-emitter capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbc | internal base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbx | external base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cs | base-substrate capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gpi | internal base-emitter conductance | 1E-3 | FALSE | +-------+-------------------------------------+---------+---------+ | gm | transconductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | go | output conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gbc | internal base-collector conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | rb | base resistance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ .. _QD: Model QD ~~~~~~~~ .. figure:: /img/modelQD.svg :width: 800 :alt: SLiCAP built-in model for a differential-pair BJT: model QD SLiCAP built-in model for a differential-pair BJT: model QD Parameters model QD ~~~~~~~~~~~~~~~~~~~ +-------+-------------------------------------+---------+---------+ | name | description | default | Laplace | +=======+=====================================+=========+=========+ | cbb | internal base-base capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbc | internal base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | cbx | external base-collector capacitance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gbb | internal base-base conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gm | forward transconductance | 1E-3 | FALSE | +-------+-------------------------------------+---------+---------+ | gcc | colector-collector conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | gbc | internal base-colector conductance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ | rb | base resistance | 0 | FALSE | +-------+-------------------------------------+---------+---------+ Examples ~~~~~~~~ Below a specification of a BJT of which the model parameters are expressed in SPICE model parameters, the operating point current ``I_C`` and the operating voltage ``V_CE``. The expressions are simplifications of the nonlinear device equations for a bipolar transistor. .. code-block:: text Q1 C B E S QV + gm = {g_m} + gpi = {g_m/beta_F} + go = {(I_c+V_ce)/VAF} + cbc = {c_bc} + cbx = {c_bx} + cpi = {(CJE + TAUF*g_m)} + rb = {r_b} + gbc = {g_bc} .param gm = I_c/U_T Below a specification of a BJT that uses small-signal parameters in an operating point as they can be determined with the aid of a SPICE operating point simulation. .. code-block:: text Q1 C B E S Q1 .model Q1 QV + gm = 20m + rb = 50 + go = 10u + gbc = 0 + cpi = 2p + cbc = 0.05p + cbx = 0.05p + cs = 0.2p Below a specification of a lateral BJT that uses small-signal parameters in an operating point as they can be determined with the aid of a SPICE operating point simulation. .. code-block:: text Q1 C B E S Q1 .model Q1 QL + gm=20m + rb=50 + go=10u + gbc=0 + cpi=2p + cbc=0.05p + cbx=0.05p + cs=0.2p Below an example of a differential pair BJT of which the parameters are related to those of the single transistor stage, biased in the same operating point as the transistors of the differential pair. .. code-block:: text Q1 C1 C2 B1 B2 myDiffPairBJT .model myDiffPairBJT QD + gm = {I_c/2/U_T} + gpi = {I_c/2/U_T/beta_AC} + go = {2*(I_c+V_ce)/V_AF} + cbc = {c_bc} + cbx = {c_bx} + cpi = {(CJE + TAUF*I_c/U_T)/2} + rb = {r_b} * below the device parameters of the single transistor .param r_b = 50 V_AF=50 g_bc = 0 CJE = 2p c_bc = 0.05p c_bx = 0.05p beta_AC=100 * below the operating point the single transistor .param I_c = 1m V_ce=5 R: Resistor ----------- The default model type for a resistor is R_. Zero value for its resistance causes a divide by zero error while building the matrix. If zero value is required, e.g. because of parameter stepping, model `type r`_ should be used. Models ~~~~~~ +-------+--------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==========================+=======+=======+=======+ | R | Resistor resistance > 0 | stamp | FALSE | FALSE | +-------+--------------------------+-------+-------+-------+ | value | Resistor resistance >= 0 | stamp | FALSE | TRUE | +-------+--------------------------+-------+-------+-------+ .. _R: Model R ~~~~~~~ .. figure:: /img/stampR.svg :width: 800 :alt: Syntax, symbol and matrix stamp of a resistor: model R Syntax, symbol and matrix stamp of a resistor: model R Parameters model R ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | resistance | 1 | FALSE | +-------+------------------+---------+---------+ .. _type r: Model r ~~~~~~~ .. figure:: /img/stampRz.svg :width: 800 :alt: Syntax, symbol and matrix stamp of a resistor: model r Syntax, symbol and matrix stamp of a resistor: model r Parameters model r ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | resistance | 1 | FALSE | +-------+------------------+---------+---------+ | dcvar | variance | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ The examples below illustrates four different ways for specifying a resistor that is connected between the nodes nP and nN and has a numerical value of 10kOhm. .. code-block:: text R1 nP nN 10k .. code-block:: text R1 nP nN {20 * alpha} .. code-block:: text R1 nP nN r value = {R_a} dcvar = {(sigma * R_a)^2} .. code-block:: text R1 nP nN myR .model myR R value = {20 * alpha} .param alpha = 500 T: Ideal transformer -------------------- SLiCAP has a built-in model for an ideal transformer_. .. _transformer: Model T ~~~~~~~ .. figure:: /img/stampT.svg :width: 800 :alt: Syntax, symbol and matrix stamp of an ideal transformer: model T Syntax, symbol and matrix stamp of an ideal transformer: model T +-------+--------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==========================+=======+=======+=======+ | T | Ideal transformer | stamp | FALSE | TRUE | +-------+--------------------------+-------+-------+-------+ Parameters model T ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | turns ratio | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text T1 secP secN priP priN {Vpri/Vsec} .. code-block:: text T1 secP secN priP priN T value={Vpri/Vsec} .. code-block:: text T1 secP secN priP priN myTrafo .. code-block:: text .model myTrafo T value={Vpri/Vsec} V: Independent voltage source ----------------------------- .. _V: Model V ~~~~~~~ .. figure:: /img/stampV.svg :width: 800 :alt: Symbol, syntax and matrix stamp of an ideal independent voltage source: model V Symbol, syntax and matrix stamp of an ideal independent voltage source: model V +-------+--------------------------------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==================================================+=======+=======+=======+ | V | Independent voltage source | stamp | FALSE | TRUE | +-------+--------------------------------------------------+-------+-------+-------+ Parameters model V ~~~~~~~~~~~~~~~~~~ +-------+--------------------------------+---------+---------+ | name | description | default | Laplace | +=======+================================+=========+=========+ | value | Voltage (Laplace transform) | 0 | TRUE | +-------+--------------------------------+---------+---------+ | dc | DC value [V] | 0 | TRUE | +-------+--------------------------------+---------+---------+ | dcvar | Variance of DC value [V^2] | 0 | TRUE | +-------+--------------------------------+---------+---------+ | noise | Noise voltage density [V^2/Hz] | 0 | TRUE | +-------+--------------------------------+---------+---------+ Examples ~~~~~~~~ .. code-block:: text * Both definitions are equivalent: V1 n1 n2 20m V1 n1 n2 V value = 20m .. code-block:: text Vin 0 input V value = {V_s} noise = 1e-16 dc = 0 dcvar = 10e-8 .param V_s = {1/s}; Step of 1V starting at t = 0 W: Gyrator ---------- SLiCAP is often used for conceptual design and for this reason the gyrator_ has been included. .. _gyrator: Model W ~~~~~~~ .. figure:: /img/stampW.svg :width: 800 :alt: Syntax, symbol and matrix stamp of a gyrator: model W +-------+--------------------------+-------+-------+-------+ | name | description | type | Ii | Io | +=======+==========================+=======+=======+=======+ | W | Gyrator | stamp | FALSE | FALSE | +-------+--------------------------+-------+-------+-------+ Parameters model W ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | transconductance | 1 | FALSE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ Below two definitions of a gyrator with a conversion gain of 10mA/V. .. code-block:: text W1 outP outN inP inN 10m .. code-block:: text W1 outP outN inP inN W value = 10m X: Sub circuit call ------------------- See examples in section: :ref:`subckt`. .. _Z: Z: Impedance ------------ Model Z ~~~~~~~ .. figure:: /img/stampZ.svg :width: 800 :alt: Syntax, symbol and matrix stamp of an impedance: model Z Syntax, symbol and matrix stamp of an impedance: model Z Parameters model Z ~~~~~~~~~~~~~~~~~~ +-------+------------------+---------+---------+ | name | description | default | Laplace | +=======+==================+=========+=========+ | value | impedance | 0 | TRUE | +-------+------------------+---------+---------+ Examples ~~~~~~~~ The examples below illustrates four different ways for specifying an impedance between the nodes nP and nN that consists of a parallel connection of a resistor with resistance :math:`R` and a capacitor with capacitance :math:`C`. .. code-block:: text Z1 nP nN {R/(1+s*R*C)} .. code-block:: text Z1 nP nN Z value = {R/(1+s*R*C)} .. code-block:: text Z1 nP nN {R/(1+s*tau)} .param tau = {R*C} .. code-block:: text R1 nP nN {R} C1 nP nN {C} .. code-block:: text Z1 nP nN myZ .model myZ Z value = {R/(1+s*R*C)}