You are on page 1of 32

Course Outline

• Introducing the Concepts


• Time Handling Mechanisms
• Discrete Event Simulation (DES)
• General Principles
• DES Case Study in SIMAN/Arena
• Continuous-Time Simulation
• DAE Solvers
• Random Numbers
• Usage, Generation, Validation, Pitfalls
• Queuing Systems

• Other Topics:
• Mixed-Signal Simulation
• Finite Element Modeling and Multi-physics
Continuous-Time Simulation
• Examples in the field of electronics include Circuit-level simulators such as SPICE,
Spectre and ADS.

• Simulation is the process of empirically determining a circuit's response to a


particular set of inputs called a test vector.

• Require some model of the computational elements of the circuit and some way
of handling time.

• Computationally expensive process and is therefore impractical for circuits of


more than a few thousand transistors.
Continuous-Time Simulation (cont.)
• Alternatives for analyzing large designs:
• Break the design into a number of smaller pieces. Simulate each on its own
and simulate at the interfaces for integration.

• Simulate a larger portion of the design at a coarser level of detail instead of


full analog waveforms.
• Circuits could be modeled as if composed of switches, gates, or even more complex
units.
• Generally, these require less computation time for the same circuit complexity.
Continuous-Time Case Study:
DAE Solver - Principle of Operation
• SPICE falls into a class of simulators called Differential Algebraic Equations (DAE) solvers.

• What exactly does SPICE do?


• It solves systems of equations to determine the analog waveforms at particular nodes in a
circuit design.

• Circuit elements are modeled as transistors, resistors, … etc and wires with propagation delays
determined by their geometric structure and the underlying technology.

• Relies on basic physical principles and thus can be highly accurate and general.
Continuous-Time Case Study:
DAE Solver (cont.)
• Simulation begins in the node-extraction phase of static analysis.

• The node extractor provides the simulator with the capacitance and resistance of the wires, transistors, and
resistors that the design comprises of.

• Delays can then be accurately determined. These parameters are determined by the technology and the
geometric properties of the structures.

• All this information is combined to produce a system of coupled, nonlinear ordinary differential equations
(ODE).
• Mainly by applying KCL at every node.

• These are converted into differential algebraic equations (DAE) using numerical integration.
Continuous-Time Case Study:
SPICE Models
• This information is combined with built-in or user- Simplified MOS model
supplied device models.

• A device model is a functional approximation of


the behavior of an actual device.

• The choice of device model affects the accuracy


and the speed of the simulation.

• The most accurate device models are analytical


and require an iterative solution to a set of
equations and require long computation time.
Continuous-Time Case Study:
DAE Solver (cont.)
• Example of extracted algebraic equation:
Continuous-Time Case Study:
DAE Solver (cont.)
• Now the system matrix equation Gv = i is in the form of
Ax = b

• Solve using LU decomposition


• For square matrix A we can find A = LU where L and U are lower and upper triangular matrices.
• Then
LUx = b
Ly = b and Ux = y
• These can be directly solved.

• Or solve using Gaussian Elimination.


Continuous-Time Case Study:
DAE Solver (cont.)
• Example of extracted differential equation:
Continuous-Time Case Study:
DAE Solver (cont.)
• Numerical Integration:
• Forward Euler, Backward Euler (Gear 1), Trapezoidal Rule and Gear 2.
Continuous-Time Case Study:
DAE Solver (cont.)
• Example:
Continuous-Time Case Study:
DAE Solver (cont.)
Simulation Solution Steps:

1. Use KCL to generate DAEs.


2. Create conductance and
capacitance matrices.
3. Isolate differential terms on one
side of the equation.
4. Replace differential terms with
numerical integration formula.
5. Solve the new algebraic
equations using standard matrix
algebra techniques.
Continuous-Time Case Study:
DAE Solver (cont.)
• Use KCL to generate DAEs:
Continuous-Time Case Study:
DAE Solver (cont.)
• Create conductance (algebraic terms)
and capacitance (differential terms)
matrices:
Continuous-Time Case Study:
DAE Solver (cont.)
• Isolate differential terms on one side
of the equation:
Continuous-Time Case Study:
DAE Solver (cont.)
• Replace differential terms with
numerical integration formula:

• Using Backwards Euler rule


Continuous-Time Case Study:
DAE Solver (cont.)
• Solve using standard matrix
algebra techniques.
Continuous-Time Case Study:
DAE Solver (cont.)
• If the ODEs are non-linear, we use
1. Newton-Raphson method to solve the system:
Continuous-Time Case Study:
DAE Solver (cont.)
Continuous-Time Case Study:
DAE Solver (cont.)
2. Linearize the system:
i. Taking the slope
ii. Piecewise linear approximation
iii. Piecewise linear evaluation
Continuous-Time Case Study:
DAE Solver (cont.)
• All of the previous procedural steps
are for one time step.

• At each time step, an initial guess at


the node values is made based on the
values at the previous time step.

• This guess is improved by iteration


until some predetermined error
tolerance is met.

• Then, the system records the values


and moves on to the next time step.
Continuous-Time Case Study:
DAE Solver (cont.)
• To use numerical integration, the derivative at the next step must be known at the current time
step.
• Forward Euler is used as a predictor.
Continuous-Time Case Study:
DAE Solver (cont.)
• Step adjustment is used if the error between predicted value and corrected one is too large.
Continuous-Time Case Study:
DAE Solver (cont.)
Continuous-Time Case Study:
DAE Solver (cont.)

• This is called the direct method which is often used to solve these equations:
• based on Newton's method, sparse-matrix techniques, and numerical
integration.

• The direct method has the


• advantage that it can be used to simulate any electronic circuit.
• disadvantage that the computation time is long for large circuits.
Continuous-Time Case Study:
DAE Solver (cont.)
• Other methods have been developed to decrease the computation time at the expense of generality.

• Observation: a circuit can often be partitioned into several sections that do not interact very much, or that interact in a
limited fashion.

• This led to the development of a class of circuit simulators based on relaxation techniques instead of on Newton's method.

• Relaxation methods have the


• Advantage is that they generally require less computation than does the direct method,
• Disadvantage is that they are of use only for MOS circuits and can be significantly slower than the direct method
when there is feedback in the design.

• Regardless of method chosen, this relatively expensive computation is performed for each node in the system at each time
step.
• This accounts for the relatively long running times of circuit-level simulators.
Continuous-Time Simulation:
Delay Modeling
• Two types of delay for circuits:
• Delay through "active components" and
• Delay through wires
• Circuit-level simulators inherently calculate active-component and wire delay
• Since they are normally taken into account in the equations that are solved.
• Logic-level simulators assume a simplified model of delay for efficiency
• Simplest is using a unit delay through active components and assuming zero delay through wires.
• Many variations are possible. For example a functional simulator might use a table of delays for various functional
blocks.
• The table could be based on actual observed delays from off-the-shelf components.
• Relatively complex logic-level simulators combine delay models with the simplification provided in assuming a fixed set of
logic levels.
• For example, RSIM uses a linear model of transistors to determine delay and final logic values for each node. The
model takes into account the capacitance at each node and the drive capabilities, and is carefully tuned for each
technology so that accurate results are obtained.
Continuous-Time Simulation:
Delay Modeling (cont.)
• For simple delay models, such as a unit-delay or table-driven approach,
• the simulator needs only the connectivity of the circuit and the type of each node.
• When accurate circuit delays are required,
• a more complex delay model is used.
• These delay models approximate the fine-grain behavior of nodes and wires.
• The time that it takes a wire to change state, say from near 0 volts to near 5 volts, is
determined by the resistance R and capacitance C of the wire.
• The delay depends exponentially on the product RC.
• Thus, the simulator must be given the resistance and capacitance of each node and wire, in
addition to device type and connectivity information.
Continuous-Time Simulation:
Delay Modeling (cont.)
• The RC information is calculated in the node-extraction phase of design analysis.
• Consider a wire made of polysilicon in a MOS technology.
• The resistance is determined by its volume and the resistivity of the polysilicon.
• The resistivity of the material and the depth of the wires are fixed for a particular
implementation process. The node extractor only calculates length and width.
• Similarly, the capacitance depends on wire area, separation from the underlying substrate,
and the permittivity of the insulator.
• The separation distance and the permittivity are fixed for the implementation process.
• Non-planar technologies such as bipolar may also require complex calculations to determine
the resistance and capacitance of nodes and wires. As usual, the cost is time.
Continuous-Time Simulation:
Other Modeling Details
• Noise.
• Temperature.
• High-order modal modeling.

• Electrostatic Effects.
• Parasitic Resistance, Capacitance,
Inductance.

• Basic 2nd order model.


Continuous-Time Simulation:
Examples from Other Domains
• 2nd order ordinary differential equations (ODEs) naturally arise as mathematical
models of physical systems.
Continuous-Time Simulation:
Other Domains - Accelerometer

You might also like