SLiCAPngspice.py

Created on Tue Jun 15 15:05:13 2021

@author: anton

class MOS(refDes, lib, dev, W, L, M)

MOS Transistor.

Parameters
  • refDes (str) – Reference designator used in SLiCAP circuit file

  • lib (str) – path to library file, absolute or relative to python script.

  • dev (str) – Device name (as in library)

MOS attributes:

  • self.refDes = refDes

  • self.lib = lib

  • self.dev = dev

  • self.modelDef = Text string with SLiCAP model definition for this device

  • self.parDefs = Dictionary with SLiCAP parameter definitions for this device

  • self.params = Dictionary with names and values of parameters provided by ngspice

  • self.errors = Relative difference between forward and reverse parameter measurement

  • self.step = Step data for VG or ID, defaults to False

getOPid(ID, VD, VS, VB, f, step=None)

Returns operating point information of the device with the drain current as (swept) independent variable.

Parameters
  • W (float) – Width of the device in [m]

  • L (float) – Length of the device in [m]

  • M (int) – Number of devices in parallel

  • ID (float) – Drain current [A]

  • VD (float) – Drain voltage with respect to ground in [V]

  • VS (float) – Source voltage with respect to ground in [V]

  • VB (float) – Bulk voltage with respect to ground in [V]

  • step – Step data for ID; list with start value, number of values and stop value. Defaults to None

getOPvg(VG, VD, VS, VB, f, step=None)

Returns operating point information of the device with the gate voltage as (swept) independent variable.

Parameters
  • W (float) – Width of the device in [m]

  • L (float) – Length of the device in [m]

  • M (int) – Number of devices in parallel

  • VG (float) – Gate voltage with respect to ground in [V]

  • VD (float) – Drain voltage with respect to ground in [V]

  • VS (float) – Source voltage with respect to ground in [V]

  • VB (float) – Bulk voltage with respect to ground in [V]

  • step – Step data for VG; list with start value, number of values and stop value. Defaults to None

getSv_inoise(ID, VD, VS, VB, fmin, fmax, numDec)
ngspice2traces(cirFile, simCmd, namesDict, stepCmd=None, traceType='magPhase')

Creates a dictionary with traces from an ngspice run.

Parameters
  • cirFile (str) –

    Name of the circuit file withouit ‘.cir’ extension, located in the cir folder.

    The circuit file should not have a .end command, this will be added at the end of he control section.

  • simCmd (str) –

    ngspice instruction capable of generating plot data, such as,

    • ac dec 20 1 10meg

    • tran 1n 10u

    • dc Source Vstart Vstop Vincr [ Source2 Vstart2 Vstop2 Vincr2 ]

    • noise V(out) Vs dec 10 1 10meg 1

  • stepCmd (str, nonetype) –

    .stepCmd instruction or None if no stepping is performed:

    .stepCmd <parname> <stepmethod> <firstvalue> (<lastvalue> <numberofvalues | listwithvalues>)

    • parname (str): name of the parameter (not a RefDes)

    • stepmethod (str): lin, log or list

  • namesDict (dict) –

    Dictionary with key-value pairs:

    key: plot label (str)

    value: nodal voltage or brach current in ngspice notation

  • traceType

    Type of traces for AC analysis or noise analysis:

    • realImag

    • magPhase

    • dBmagPhase

    • onoise

    • inoise