2-spiceqwewqeqwewqewqeqwe12312312312ed 12312 3

48
 Circuit simulation using SPICE Neuromorphic Engineering II Institute of Neuroinformatics University | ETH Zurich Spring Semester 2013

Upload: darryl-dave-ditucalan

Post on 02-Nov-2015

216 views

Category:

Documents


0 download

DESCRIPTION

213 123 123123 12 12dqwdqwd 123 123 123123 wqfssa fqwr 1212 r12 3efadf fasf asfs sf ds as fasf as fasf saf adfafaf.wdhuibwvibwruifbauirbvuibrauivbuiaervae.r arviaervuibaeuiviuaehruivhuaei hiauvhiaeruhvuaehuivhiuaerhv aeuvhaeiurviaervuiaeruivhiuaerv raer reaasf asf 32 f32

TRANSCRIPT

  • Circuit simulation using SPICE

    Neuromorphic Engineering II

    Institute of NeuroinformaticsUniversity | ETH Zurich

    Spring Semester 2013

  • Outline

    What is SPICE?

    How does SPICE work?

    Tanner Tools TSPICE

    S-Edit

  • SPICE Origins

    SPICE is a computer program designed to simulate analog electroniccircuits.It original intent was for the development of integrated circuits, fromwhich it derived its name: Simulation Program with Integrated CircuitEmphasis.

    1967 Prof. Ronald Rohrer of U.C. Berkeley develop ComputerAnalysis of Nonlinear Circuits, Excluding Radiation(CANCER)

    1972 CANCER was re-written and re-named to SPICE(Version 1) and released to the public domain.

    1975 Version 2 of SPICE was released (Version 2g6)

    1985 Version 3 of SPICE was rewritten in C (rather thanFORTRAN) and released to the public domain.

  • SPICE Origins

    SPICE is a computer program designed to simulate analog electroniccircuits.It original intent was for the development of integrated circuits, fromwhich it derived its name: Simulation Program with Integrated CircuitEmphasis.

    1967 Prof. Ronald Rohrer of U.C. Berkeley develop ComputerAnalysis of Nonlinear Circuits, Excluding Radiation(CANCER)

    1972 CANCER was re-written and re-named to SPICE(Version 1) and released to the public domain.

    1975 Version 2 of SPICE was released (Version 2g6)

    1985 Version 3 of SPICE was rewritten in C (rather thanFORTRAN) and released to the public domain.

  • SPICE Origins

    SPICE is a computer program designed to simulate analog electroniccircuits.It original intent was for the development of integrated circuits, fromwhich it derived its name: Simulation Program with Integrated CircuitEmphasis.

    1967 Prof. Ronald Rohrer of U.C. Berkeley develop ComputerAnalysis of Nonlinear Circuits, Excluding Radiation(CANCER)

    1972 CANCER was re-written and re-named to SPICE(Version 1) and released to the public domain.

    1975 Version 2 of SPICE was released (Version 2g6)

    1985 Version 3 of SPICE was rewritten in C (rather thanFORTRAN) and released to the public domain.

  • SPICE Origins

    SPICE is a computer program designed to simulate analog electroniccircuits.It original intent was for the development of integrated circuits, fromwhich it derived its name: Simulation Program with Integrated CircuitEmphasis.

    1967 Prof. Ronald Rohrer of U.C. Berkeley develop ComputerAnalysis of Nonlinear Circuits, Excluding Radiation(CANCER)

    1972 CANCER was re-written and re-named to SPICE(Version 1) and released to the public domain.

    1975 Version 2 of SPICE was released (Version 2g6)

    1985 Version 3 of SPICE was rewritten in C (rather thanFORTRAN) and released to the public domain.

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Avaliable Packages

    The SPICE home page:http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/Public Domain

    I Original Berkeley SPICE3f4 code:ftp://ic.eecs.berkeley.edu/pub/Spice3/

    I NGSpicehttp://sourceforge.net/projects/ngspice

    Commercial

    I HSPICE (Synopsis)

    I PSCPICE (OrCAD)

    I SYMETRIX

    I TSpice (Tanner Tools)

  • SPICE Programming

    SPICE is an interpreted language: In order for a computer tounderstand the SPICE instructions you type, it must have the SPICEprogram (interpreter) installed. SPICE source files are commonlyreferred to as netlists (or "decks") with each line in the file being calleda "card."Writing a SPICE deck is like writing a good program

    Plan: sketch schematic on paper or in editor.Modify existing decks whenever possible.

    Code: strive for clarity.Start with name, email, date, purpose.Generously comment.

    Test: Predict what results should be.Compare with actual.Garbage In, Garbage Out!

  • Solving differential equations

    SPICE uses numerical techniques to solve nodal analysis of circuit.The nature of SPICEs iterative process allows it to simulate manytypes of systems that can be modelled through standard equationsand differential equations.

    I Hodgkin and Huxley model of a neurons spike generatingmechanism.

    I Chaotic and Dynamical Systems

    I Diffusion equations

  • Solving differential equations

    SPICE uses numerical techniques to solve nodal analysis of circuit.The nature of SPICEs iterative process allows it to simulate manytypes of systems that can be modelled through standard equationsand differential equations.

    I Hodgkin and Huxley model of a neurons spike generatingmechanism.

    I Chaotic and Dynamical Systems

    I Diffusion equations

  • Solving differential equations

    SPICE uses numerical techniques to solve nodal analysis of circuit.The nature of SPICEs iterative process allows it to simulate manytypes of systems that can be modelled through standard equationsand differential equations.

    I Hodgkin and Huxley model of a neurons spike generatingmechanism.

    I Chaotic and Dynamical Systems

    I Diffusion equations

  • Spice components and analysis types

    You can use SPICE to specify these circuit components:

    I Resistors, Capacitors, Inductors

    I Independent sources (V, I), Dependent sources (V, I)

    I Transmission lines

    I Active devices (diodes, BJTs, JFETS, MOSFETS)

    You can use SPICE to perform the following types circuit analysis:

    I Non-linear d.c.

    I Non-linear transient

    I Linear a.c.

    I Noise and temperature

  • SPICE common elemenets

    Letter ElementR ResistorC CapacitorL InductorV Independent Voltage SourceI Independent Current SourceM MOSFETD DiodeQ Bipolar transistorX SubcircuitrE Voltage controlled Voltage SourceG Voltage controlled Current SourceH Current controlled Voltage SourceF Current controlled Current Source

  • Active components: the MOSFET device models

    All Mosfet devices in SPICE reference a model by its instance name.Each Mosfet model in SPICE has a keyword NMOS or PMOS, as wellas a Level parameter.MOSFET TRANSISTOR MODELS:General form: .model [modelname] [nmos or pmos] [parmtr1=x] . . .

    I .model mod1 pmos

    I .model mod2 nmos level=2 phi=0.65 rd=1.5

  • MOSFET device model levels

    I Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.Not very accurate, but fast.

    I Level 4 (BSIM1): accurate, based on the Berkeley short-channelIGFET model.

    I Level 5 (Tanner, Maher-Mead): accurate physically based model,continuous over all regions of operation, including subthreshold.

    I Levels 13, 28, 39, and 47: Based on Berkeley IGFET models(BSIM, BSIM2, and BSIM3 models).

    I Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.

  • MOSFET device model levels

    I Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.Not very accurate, but fast.

    I Level 4 (BSIM1): accurate, based on the Berkeley short-channelIGFET model.

    I Level 5 (Tanner, Maher-Mead): accurate physically based model,continuous over all regions of operation, including subthreshold.

    I Levels 13, 28, 39, and 47: Based on Berkeley IGFET models(BSIM, BSIM2, and BSIM3 models).

    I Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.

  • MOSFET device model levels

    I Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.Not very accurate, but fast.

    I Level 4 (BSIM1): accurate, based on the Berkeley short-channelIGFET model.

    I Level 5 (Tanner, Maher-Mead): accurate physically based model,continuous over all regions of operation, including subthreshold.

    I Levels 13, 28, 39, and 47: Based on Berkeley IGFET models(BSIM, BSIM2, and BSIM3 models).

    I Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.

  • MOSFET device model levels

    I Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.Not very accurate, but fast.

    I Level 4 (BSIM1): accurate, based on the Berkeley short-channelIGFET model.

    I Level 5 (Tanner, Maher-Mead): accurate physically based model,continuous over all regions of operation, including subthreshold.

    I Levels 13, 28, 39, and 47: Based on Berkeley IGFET models(BSIM, BSIM2, and BSIM3 models).

    I Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.

  • MOSFET device model levels

    I Levels 1,2,3 (Berkeley SPICE 2g6): basic transistor equations.Not very accurate, but fast.

    I Level 4 (BSIM1): accurate, based on the Berkeley short-channelIGFET model.

    I Level 5 (Tanner, Maher-Mead): accurate physically based model,continuous over all regions of operation, including subthreshold.

    I Levels 13, 28, 39, and 47: Based on Berkeley IGFET models(BSIM, BSIM2, and BSIM3 models).

    I Levels 49 and 53 (BSIM3 Revision 3): most accurate models.Supported by most foundries and SPICE simulation engines.

  • SPICE Analysis Types

    DC Operating Point Analysis .op: Computes circuits DC operatingpoint values.

    DC Transfer Analysis .dc: Sweeps signals and computes operatingpoint values for all range of swept signals.

    Transient Analysis .tran: Provides information on how circuit elementsvary with time.

    Transient Powerup Analysis .tran/powerup: Sets the entire circuit tozero for t = 0s. As the simulation proceeds, the voltagesources are allowed to ramp up to their specified values.Useful to define the initial state of a circuit which has nodefinite DC steady-state condition.

    AC Analysis .ac: Characterizes the circuits behavior dependence onsmall-signal input frequency.

  • SPICE Analysis Types

    DC Operating Point Analysis .op: Computes circuits DC operatingpoint values.

    DC Transfer Analysis .dc: Sweeps signals and computes operatingpoint values for all range of swept signals.

    Transient Analysis .tran: Provides information on how circuit elementsvary with time.

    Transient Powerup Analysis .tran/powerup: Sets the entire circuit tozero for t = 0s. As the simulation proceeds, the voltagesources are allowed to ramp up to their specified values.Useful to define the initial state of a circuit which has nodefinite DC steady-state condition.

    AC Analysis .ac: Characterizes the circuits behavior dependence onsmall-signal input frequency.

  • SPICE Analysis Types

    DC Operating Point Analysis .op: Computes circuits DC operatingpoint values.

    DC Transfer Analysis .dc: Sweeps signals and computes operatingpoint values for all range of swept signals.

    Transient Analysis .tran: Provides information on how circuit elementsvary with time.

    Transient Powerup Analysis .tran/powerup: Sets the entire circuit tozero for t = 0s. As the simulation proceeds, the voltagesources are allowed to ramp up to their specified values.Useful to define the initial state of a circuit which has nodefinite DC steady-state condition.

    AC Analysis .ac: Characterizes the circuits behavior dependence onsmall-signal input frequency.

  • SPICE Analysis Types

    DC Operating Point Analysis .op: Computes circuits DC operatingpoint values.

    DC Transfer Analysis .dc: Sweeps signals and computes operatingpoint values for all range of swept signals.

    Transient Analysis .tran: Provides information on how circuit elementsvary with time.

    Transient Powerup Analysis .tran/powerup: Sets the entire circuit tozero for t = 0s. As the simulation proceeds, the voltagesources are allowed to ramp up to their specified values.Useful to define the initial state of a circuit which has nodefinite DC steady-state condition.

    AC Analysis .ac: Characterizes the circuits behavior dependence onsmall-signal input frequency.

  • SPICE Analysis Types

    DC Operating Point Analysis .op: Computes circuits DC operatingpoint values.

    DC Transfer Analysis .dc: Sweeps signals and computes operatingpoint values for all range of swept signals.

    Transient Analysis .tran: Provides information on how circuit elementsvary with time.

    Transient Powerup Analysis .tran/powerup: Sets the entire circuit tozero for t = 0s. As the simulation proceeds, the voltagesources are allowed to ramp up to their specified values.Useful to define the initial state of a circuit which has nodefinite DC steady-state condition.

    AC Analysis .ac: Characterizes the circuits behavior dependence onsmall-signal input frequency.

  • Why Tanner-Tools TSPICE

    I Integrated with L-Edit and S-Edit

    I Affordable (

  • Why Tanner-Tools TSPICE

    I Integrated with L-Edit and S-Edit

    I Affordable (

  • Why Tanner-Tools TSPICE

    I Integrated with L-Edit and S-Edit

    I Affordable (

  • Why Tanner-Tools TSPICE

    I Integrated with L-Edit and S-Edit

    I Affordable (

  • TSPICE netlist example

    Vdd

    Vin Vout

    Inverter netlist (inverter.sp)

    .include mosis.md *(Include device models)

    MP1 Vout Vin Vdd Vdd pmos L=10 W=10MN1 Vout Vin Gnd Gnd nmos L=10 W=10

  • TSPICE netlist example

    Vdd

    Vin Vout

    Inverter netlist (inverter.sp)

    .include mosis.md *(Include device models)

    MP1 Vout Vin Vdd Vdd pmos L=10 W=10MN1 Vout Vin Gnd Gnd nmos L=10 W=10Mosfet D G S B model L W

  • TSPICE netlist example

    Vdd

    Vin Vout

    Simulation commands (inverter_c.sp)

    .options scale=0.8u deftables=0

    .options maxmsg=1 modelmode=direct

    .options abstol=1e-17 reltol=1e-7 chargetol=1e-19

    .options absdv=0.01 accurate=1

    .options js=1e-5

    .include "inverter.sp"vdd Vdd gnd 5vin in gnd pwl( 0 0 5u 5 10u 0).tran/powerup 1u 10u.print tran in out

  • TSPICE netlist example

    Vdd

    Vin Vout

    Simulation commands (inverter_c.sp)

    .options scale=0.8u deftables=0

    .options maxmsg=1 modelmode=direct

    .options abstol=1e-17 reltol=1e-7 chargetol=1e-19

    .options absdv=0.01 accurate=1

    .options js=1e-5

    .include "inverter.sp"vdd Vdd gnd 5vin in gnd pwl( 0 0 5u 5 10u 0).tran/powerup 1u 10u.print tran in out

    options

  • TSPICE netlist example

    Vdd

    Vin Vout

    Simulation commands (inverter_c.sp)

    .options scale=0.8u deftables=0

    .options maxmsg=1 modelmode=direct

    .options abstol=1e-17 reltol=1e-7 chargetol=1e-19

    .options absdv=0.01 accurate=1

    .options js=1e-5

    .include "inverter.sp"vdd Vdd gnd 5vin in gnd pwl( 0 0 5u 5 10u 0).tran/powerup 1u 10u.print tran in out

    circuit

  • TSPICE netlist example

    Vdd

    Vin Vout

    Simulation commands (inverter_c.sp)

    .options scale=0.8u deftables=0

    .options maxmsg=1 modelmode=direct

    .options abstol=1e-17 reltol=1e-7 chargetol=1e-19

    .options absdv=0.01 accurate=1

    .options js=1e-5

    .include "inverter.sp"vdd Vdd gnd 5vin in gnd pwl( 0 0 5u 5 10u 0).tran/powerup 1u 10u.print tran in out

    elements

  • TSPICE netlist example

    Vdd

    Vin Vout

    Simulation commands (inverter_c.sp)

    .options scale=0.8u deftables=0

    .options maxmsg=1 modelmode=direct

    .options abstol=1e-17 reltol=1e-7 chargetol=1e-19

    .options absdv=0.01 accurate=1

    .options js=1e-5

    .include "inverter.sp"vdd Vdd gnd 5vin in gnd pwl( 0 0 5u 5 10u 0).tran/powerup 1u 10u.print tran in out

    commands

  • How does (T)SPICE work?

    Not very well! Dont ever believe it completely models reality.Problems:

    I Very computer intensive.

    I Doesnt model transistor mismatch.

    I Doesnt model Early effects well.

    I Doesnt model distributed characteristics like resistance andcapacitance.

    I Makes you lazy about thinking.

  • How does (T)SPICE work?

    Not very well! Dont ever believe it completely models reality.Problems:

    I Very computer intensive.

    I Doesnt model transistor mismatch.

    I Doesnt model Early effects well.

    I Doesnt model distributed characteristics like resistance andcapacitance.

    I Makes you lazy about thinking.

  • How does (T)SPICE work?

    Not very well! Dont ever believe it completely models reality.Problems:

    I Very computer intensive.

    I Doesnt model transistor mismatch.

    I Doesnt model Early effects well.

    I Doesnt model distributed characteristics like resistance andcapacitance.

    I Makes you lazy about thinking.

  • How does (T)SPICE work?

    Not very well! Dont ever believe it completely models reality.Problems:

    I Very computer intensive.

    I Doesnt model transistor mismatch.

    I Doesnt model Early effects well.

    I Doesnt model distributed characteristics like resistance andcapacitance.

    I Makes you lazy about thinking.

  • How does (T)SPICE work?

    Not very well! Dont ever believe it completely models reality.Problems:

    I Very computer intensive.

    I Doesnt model transistor mismatch.

    I Doesnt model Early effects well.

    I Doesnt model distributed characteristics like resistance andcapacitance.

    I Makes you lazy about thinking.

  • T-SPICE and S-Edit

  • T-SPICE and S-Edit

  • T-SPICE and S-Edit

    What is SPICE?How does SPICE work?Tanner Tools TSPICES-Edit