You are on page 1of 4

ixedmsignal Circuit Simulation

ith Behavioral Modeling Cap


Joseph T. Smith and Harold K. Brown
Florida Institute of Technology
150 W. Universit Boulevard
Melbourne, F l 32901
(407) 768-8000 ext. 7180
email: jts@ee.fit.edu

Abstract 2 Simulation Fundamentals


In this paper, the development of a mixed-signal circuit The basic understandingof certain fundamentals regarding
simulation system with behavioral modeling capability is the internal workings of a simulator such as the simulation
discussed. In this context, mixed-signalsimulation refers to system developed during this research is helpful for the
the simulationof circuits and systems containingboth analog comprehensionof the results that have been achieved. For
and digital cells excited with signals of either an analog or this reason, a brief but concisesummary of the key numerical
digital nature. The backgroundinformation regardingcircuit and modelingtechniques is given in this section.
simulation is given along with a discussion of device and Modified Nodal Analysis
system modelingfor analog and digital cells. In addition, the
numericalmethods and programmingtechniques along with As it's name implies, modified nodal analysis is a variation
how these relate to the internal data structure are analyzed. of the method of nodal analysis. This method is based on
Finally, the scenarios used for testing the simulator are Kirchoff's current law which states that the algebraic sum of
discussedand the resultscomparedto results obtainedfrom all currents entering a node is equal to zero.
the SPICE simulator using device based models. In order to describe the current flow in a system, circuit
The development of this simulation system has provided a equations of the following form must be composedfor every
seamless methodfor developing behavioral models given a node:
cell which has been well characterized. These behavioral G,,V,+G,,V,. ..+G,,V"=I, 2.1
models are developedutilizingobject-orientedprogramming
techniques and are capable of providing highly accurate G,, V , + G,V,.. .+ G,V, =I, 2.2
results. Behavioral cells, once developed, can then be
simulated with signals and cells of an analog or digital nature
to provide significant improvements in simulation times of
large systems.
G , V , + G,V,. ..+ G,V, = 1. 2.3
1 Introduction In matrix notation, these equations are expressedas follows:
Overthelastthirtyyears, the sizeand complexityof electronic G*V=I 2.4
circuits has grown at a remarkable rate and thus has placed
great demands on the developers of simulation tools. For where G -epresentsthe nx nadmittancematrix whosevalues
example, it is not unusual to find systems such as micro- are known, V is the voltage vector of dimension n whose
processors that exhibittransistorcounts well into the millions. values will be solved for, and I is the current vector of
In order to design such a system, it is necessary for teams dimension n whose values are known.[l]
of engineers to work together on the design, segmenting it
into sub-moduleswhich may be inherently analog or digital Where modified nodal analysis deviates from the method of
and developing these submodules separately utilizing tools nodal analysis is.how the method deals with the infinite
which allow for mixed-signal simulation. Even with the admittance associated with an ideal voltage source. For
segmentation of these large designs, the overall complexity each voltage source in a given circuit, a new equation is
and sheer size of a system may overcome available com- formed (and thus a row and column is added to the MNA
puting. resources. Thus, the designers must come up with matrix). The new equationthat is placed in the matrix is now
ehaworal models which are computationallyefficient but do solved for the current instead of the voltage.
not sacrifice a great deal of accuracy. For this reason, it is
verydesirableto have a simulationtool which is very modular Analog System Modeling
by design which can facilitate the interconnection of very The modelin of analog elements such as resistors,
large subsystems and/or macro-behavioral models which capacitors,inluctors, etc. is achieved in one of two ways. In
describe these subsystems in a seamless manner. It is also the case of linear elements such as resistors,the contribution
desirable for such a system to have the capability of being of the element to the MNA matrix (or the stamp) is simply
parallelized so that the computations associated with large placed into the matrix at the appropriate time during the
simulations could be distributed over a number of machines. simulation. For non-linear elements such as capacitors,
The purpose of this researchwas to developthe groundwork inductors, and diodes, a companion model must be formu-
for a new circuit simulation system which while supporting lated which usually consists of dependent and/or indepen-
the SPICE netlist format, will contain added functionality, dent sources and admittances whose values are determined
improvedmodularity,parallel capability, and the capabilityto utilizing numericaltechniques such as numerical inte ration
implement macro-behavioral models in a way which is and Newton-Raphsoniteration. The contributions ogthese
transparent to the user. companion models are then placed into the MNA matrix at
each timestep.[l-5, 7-9, 111

580
Digital System Modeling
As in the case of analog system modeling, the modelin of In the development of this software, object oriented pro-
digital elements can be achieved in one of two ways. 8ne gramming techniques were utilized in order to achieve the
way that this can be done is to model the digital element at modular data structure necessary for a successful circuit
thedevice ortransistor level. However, in large systems, the simulation system. The primary techniques used were
modeling of digital elements at the device level becomes inheritance and polymorphism (utilizing virtual functions).
compute intensive and can someltimes overcome ones
compute resources. A more acceptable solution is to Every element of a circuit has certain attributes associated
represent well characterized system:; with macro-behavioral with it. Some of these attributes are unique to a particular
models which reduce the computational burden while pro- element but others can be thought of as being generic; t
viding highly accurate results. This simulation system uses term generic meaning that this particular attribute can
the exponential running averagle technique in the defined in the same manner for any given element. This
implementationof these macro-behavioral models.[6, I O ] particular property of circuit elements can be used to define
a class structure that lends itself to the problemat hand. The
Exponential Running Average Technique way this is done is to design a base class which will be
inherited by all subsequently derived classes. Within the
It is common in the realm of digital system design for one to base class, all of the cell properties and member functions
observe in the response of digital systems a rounding of that will act as the interfaceto these cell propertieswhich are
square (or nearly square) wave edges which becomes more commonto all of the different cell types will be defined. These
and more pronounced as the excitation frequencies common pro erties will include such things as the name of
increase. In the modeling of this wave edge rounding, it can the device, tge device t pe, the number of internal nodes,
be assumed that the observed responsecorresponds to that and the number of MNA(matrix contributions to mention a
of a first-order RC low pass filter.[l3:1 few. This base class will then be inherited by other classes
R which will define unique element types. Within these derived
classes, all of the properties that make an element unique
-
+
7 and the member functions that aid in the implementation of
these properties will be defined.

-L
I + The use of virtual functions was essential for providing the
type of generality necessary for developing a simulation
vin "out capable of being expanded in a logical manner. Virtual
cL
T functions are defined as follows: "A virtual function is a
special member function invokedthrough a publicbase class
reference or pointer; it is bound dynamically at run time. The
0 instance invokedis determined by the class type of the actual
Figure 2.34 First Order RC lLew Pass Filter object addressed by the pointer or reference. Resolutionof
a virtual function is transparent to the user."[l2] What this
When a LaplaceTransform is erformedon this circuit, it can means is that the simulator does not have knowledge of and
be found that the transfer knction of the circuit in the is not concerned with what type of cell it is dealing with. It
s-domain is: simply knows that it has certain functions that it must erform
2.5 for each cell. These functions are uniquely defined L r each
F ( s )=- 1 1
cell type and the resolution of these function calls is deter-
1 +sRC - 1+s,u mined at simulation time.
where 'c = RC.
4 Conclusion
The equation given above expresses the transfer function of
thecircuitin acontinuous sense. However,forthe calculation The systemdevelopedduringthis researchwas tested under
of this responseonacomputerfosthepurposesofsimulation, a select number of test conditions using built-in cells utilizing
it would be desirable to obtain a discrete expression. A behavioralmodels and the results comparedwith the results
discrete expression for this response can be obtained b of SPICE simulations of identical circuits using transis-
performing a z-transformon the circuit transfer function.[4{ tor-level models of the same elements. There was also a
test run which compared the performance of the simulation
Y" + 1 = (1- aY, + U,+l 2.6 system developed during this research using device-based
models and behavioral models. In the testing phase, the
lnthis expression,I(,,+, correspondsto the input beingapplied attempt was made to demonstrate the increase in compu-
at the present timestep and Y, and Y,+, are the outputs of tational speed realized by the exclusive use of behavioral
the circuit at the previous and present timestep respectively. models in the circuits being simulated. Also, the ability of the
The t!me constant of the circuit is related to the previous simulationsystemto deal with systems which containsignals
equation by the following expression. of an analog nature interacting with digital cells and non-
linear elements was examined. Convergence issues
2.7 encountered in this testing phase were then evaluated.
Simulation Test Cases
This method has proved useful in the development of the initial testing of this simulation system involved the testing
behavioral models of digital elements implemented in this of digital elements without the presence of non-linear ele-
simulation system due to it's computational simplicity. ments. The NAND gate was tested by applying piecewise
linear inputs whose values generated outputs verifying the
losic function performed by a single gate. The diagram of
this test circuit is shown in Figure 4.1,
I
0 PWL

i
-
I
Qpm
U
I
A-
Figure 4.1 Simulator Test Case Circuit #1 Figure 4.4 Simulator Test Case Circuit ##4
The next test case that was evaluated was circuit in which a In the test case pictured in Figure 4.4, it was found that the
number of NAND gates were connected together into a use of behavioral models decreased simulation times with
flip-flop configuration. This was done in order to evaluate respect to identical simulations run with a device-based
the performance of these models when more than one gate model of the AND gate. The ratio of the two simulationtimes
is simu!ated in a system. The diagram of this test circuit is shows an improvement of 6.36X.
shown in Figure 4.2. The final circuit configuration that was tested involved the
interconnection of an RLC network being driven by a
piecewiselinear source, and a Dflip-flopcomprised of NAND
gates with clamping diodes connected to one of the inputs.
This was done to evaluate whether there are any conver-
-r 1 - gence issues associated with signals of an analog nature
driving non-linear elements connected to digital elements. A
c'wkY5v
LCL, - schematic of this circuit is shown in Figure 4.5 and the
inputloutput voltages of the circuit are displayed in Figure
Flgure 4.2 Simulator Test Case Circuit #2 4.6. The simulationtimewas not addressedforthistestcase.
The third test case that was evaluated involved the inter-
"-
connection of an RLC network with the flip-flop circuit
pictured in Figure 4.2. The purpose of this test case was to
establish the ability of the behavioral NAND gate model to Q
deal with ill behaved input signals yielding accurate resutts D
in a timely fashion. A schematic of this test circuit is shown
in Figure 4.3. -
Q

Figure 4.5 Simulator Test Case Circuit #5

1f , , , , , , , , I ,

Figure 4.3 Simulator Test Case Circuit #3


Although the comparison of simulation times using behav-
ioral models compared to simulations using device based
models run on SPICE does give an indication of the speed
enhancements derived from using behavioral models, the
level of enhancement that is observed is somewhat con-
servative. This is due to the sparse matrix storage mecha-
nism used in SPICE and the matrix solving routines which
are optimized to operate solely on the non-zero elements of
the matrix (Typically about 2% of the MNA matrix). This
sparse-matrix storage mechanism and corresponding sob-
ing routines were not included in this simulation system. For
this reason the fourth test case involved the comparison of
simulation times of behavioral and device-based (diode 1
0 le Q2l
cQl IcOl 4c-01 %Ul &Ol 1Cm Scm 9r-07 ISM
logic) AND gate implementations run solely under the fimc ( U s d )
simulation system developed during this research. This
simulation test case was designed to more accurately Figure 4.6 Test Case #5 Input and Output Voltages
represent the speed enhancement achieved when behav-
ioral models are used by providing equal testing conditions.
Comparison to SPICE Simulations Using Device-
Based Models
After evaluating the performance of the circuits given in
Figures 4.1,4.2,and 4.3,. SPICE rsi.mulations of the same
circuitswere performedusing a tranlsistor-level model forthe
NAND gate. It was determined from the results of these
simulations that this simulation system performed very
favorably in comparison to the same circuits simulated in
SPICE on the same computing platliorm. However, it should
be noted that speed improvements shown are not as large
as they should be due to the absence of a sparse matrix
storage mechanism and LU decomposition(matrix solution)
algorithms optimized for that storage in this simulation
system. These results are summarized in Table 4.1.

Beh. Mod. Time

Figure 4.7 Test Case #2 Input and Output Voltages

References
[l] William J. McCalla, Fundamentalsof Comouter-Aided
Table 4.1 Test Results Circuit Simulation. Boston, Massachusettes: Kluwer
Academic Publishers, 1988.
PI sobrio. Semi-
Convergence Issues New York, NY:
In the simulation of the circuit shown in Figure 4.5 it was
found that there were no difficulties with the system con- [3] Gray, Paul R. and Robert G. Meyer. Analvsis and
verging. However, it should be noted that the test performed Pesian of Analo-ated Ci r c m . New York, NY:
here was specific in nature and therefore does not suggest Wiley, 1984.
that future convergence issues relaiingto this system will not [4] Gregorian, Roub.ik, and Gabor C. Temes. &&a MOS
be encountered. Convergence is an issue that must be lntearated Circuits for Sianal Processing. New York,
evaluated on a circuit by circuit basiis and thus only time and NY: Wiley, 1986.
a battery of tests involving circuits olf varying types will begin
to bring to light the future probleims that will have to be [5] Allen, Phillip E., and Douglas R. Holber . CMOS
addressed involving convergence. Analoa Circuit Desian. Fort Wor!h, TX: Hof, Ringhart
and Winston, 1987.
Accuracy [6] Geiger, RandallL., Phillip E. Allen, and Noel R. Strader.
Duringthe testing phase of development, it was determined VLSl Desian Techniauesfor Analoa and DiaitalCircuits.
that a reasonable degree of accuracy could be achieved New York, NY: McGraw-Hill, 1990.
when utilizing behavioral models for digital cells. In order to [7] Edward S. Yan . Mi f electronic Devices. New York,
illustratethis, graphs of the input and output voltages for test
cases W1 and #2 are given in Figures 4.6and 4.7.
NY: McGraw-th,l sc8".
[8] Michael Shur. Phvsics of Semiconductor Devices.
EnglewoodCliffs, NJ: Prentice Hall, 1990.
[9] Ben G. Streepan. Solid u r o n i c Devices.
Englewood Cliffs, NJ: Prentice Hall, 1990.
[lo]Hod es, David A., and Horace G. Jackson. Analv&
and tesian of Diaital Intearated Circuits. New York,
NY: McGraw-Hill, 1988.
E [l I] Hayt,.William H., and Jack E. Kemmerly.
J Circuit Analvsis. New York, NY: McGraw-
1121 Stanley B. Lippman. C++ Pn'ms. Reading, Massa-
chusettes: Addison-Wesley, 1991.
[I31 Mahattanakul, Jirayuth. Artificial Retina. MS Thesis,
Florida Institute of Technology. Melbourne FL., 1992.

0 le07 h-07 3007 4F-07 Se47 6-07 7-01 &-07 BO1 le06
T- (=&I)

Flgure 4.6 Test Case #1 Input and Output Voltages

583

You might also like