Professional Documents
Culture Documents
VHDL 1076.1:
ANALOG AND MIXED-SIGNAL
EXTENSIONS TO VHDL
Ernst Christen *, Kenneth Bakalar* *
* Analogy, Inc., 9205 S. W. Gemini Drive, Beaverton, OR 97008, USA.
** Compass Design Automation, 5457 Twin Knolls Road, Columbia, MD 21045, USA.
ABSTRACT
VHDL 1076.1 is an extension to the well-established VHDL 1076 language to support
the description and simulation of continuous and mixed continuous/discrete systems. We
provide an overview ofthe extended language.
2.1. INTRODUCTION
IEEE VHDL 1076-1993 (The VHSIC Hardware Description Language) is designed for
the description and simulation of digital systems, supporting modeling at abstraction
levels from system level down to gate level. The standard, first approved in 1987 and
later revised and reaffirmed in 1993, has gained wide acceptance in the last few years.
The extension of VHDL to support continuous and mixed continuous/discrete systems
began in 1989 with the intent to include the necessary language changes in the VHDL
revision targeted for the 1993 release. It soon became apparent that the complexity of
the topic dictated the formation of a separate working group. The design of
VHDL 1076.1 began in 1993 under the auspices of the Design Automation Standards
Committee of the Computer Society of the IEEE, authorized under PAR 1076.1 and
supported by the Joint European Silicon Software Initiative (JESSI), the U.S. Air Force
Rome Laboratory, and the employers of participating engineers.
19
The work is now nearing completion. A language reference manual suitable for
submission to the IEEE balloting process will be completed by March 1997. The
extended language has informally been called VHDL-A; the committee now prefers the
designation VHDL 1076.1 or VHDL-AMS, the later to emphasize its mixed-signal
application.
We begin with a review of the foundations for the VHDL 1076.1 language: the design
objectives, the VHDL 1076 language, and the applicable mathematical theory. Most of
the presentation is devoted to the elements of the extended language. Each language
element is illustrated by a brief example. We conclude with selected examples illustrating
the use of the language for analog and mixed-signal applications.
The presentation assumes that the reader is familiar with the VHDL 1076 language. We
note that the language extensions described in this chapter have not yet been approved
as an IEEE standard, and changes are to be expected.
2.2. FOUNDATIONS
2.2.1. Language Design Objectives
The design objectives [1] for the extended language have been compiled from
requirements submitted by interested parties to the 1076.1 Working Group. They have
been analyzed and the results published [2]. We briefly summarize them here.
The design objectives require the VHDL 1076.1 language to be a superset of VHDL
1076-1993 [3], supporting the hierarchical description and the simulation of continuous
and mixed continuous/discrete systems with conservative and non-conservative
semantics. The language is required to support modeling at a variety of abstraction
levels in electrical and non-electrical disciplines. The systems to be described are lumped
systems (i.e. no partial differential equations), and the solution of the equations
describing the behavior of the system may include discontinuities. Interactions between
the discrete part of a model and its continuous part are to be supported in a flexible and
efficient manner, and support for frequency domain AC and noise simulation must be
provided.
2.3.1. Quantities
The unknowns in the system of DAEs implied by the text of a model are analytic
functions of time; that is, they are piecewise continuous with a finite number of
discontinuities. Numerical solution algorithms simultaneously solve for the values of all
unknowns at certain times determined by the algorithm. None of the existing VHDL
objects get their values in a comparable fashion. For this reason, VHDL 1076.1
introduces a new class of value-bearing object, the quantity, to stand for the unknowns
in the DAEs.
Quantities must have scalar subelements of a floating point type to approximate the
continuous properties of the underlying formalism. A quantity object can appear in an
expression or anywhere else a value of the type is allowed. In the remainder of this
section, we describe the characteristics of scalar quantities. The characteristics of a
composite quantity are simply the aggregation of the characteristics of its scalar
subelements. The behavior of each scalar subelement is independent of the others.
Quantities can be declared anywhere a signal can be declared except in a package. The
following statement declares two quantities qa and qb of type real:
quantity qa, qb: Real;
When this model is instantiated each interface quantity is constrained to have the same
value as the quantity with which it is associated in a quantity association.
In addition to explicit quantities the language defines a number of implicit quantities.
Most will be discussed in Section 2.3.9, here we focus on the implicit quantities that are
essential to writing DAEs.
• For each quantity Q the name Q'Dot denotes a quantity of the same type as Q that
represents the derivative of Q with respect to time .
• For each quantity Q the name Q'Integ denotes a quantity of the same type as Q that
represents the integral of Q over time, from time 0.0 to the current time.
Since Q'Dot is a quantity the second derivative of Q with respect to time can be written
as Q'Dot'Dot, and higher order derivatives can be formed following the same pattern.
The notation for higher order integrals parallels the notation for higher order derivatives.
VHDL 1076.1: Analog and Mixed-Signal Extensions to VHDL 23
declares a floating point subtype Charge with a tolerance code "toll". Similarly, the
statements
quantity qO: Charge;
quantity ql, q2: Charge tolerance "toI2";
declare a quantity qQ of type Charge with a tolerance code "toll", and two
quantities ql and q2 of a subtype equivalent to Charge except that the tolerance
group has been changed to "toI2". The implicit quantity qQ 'Dot belongs to the same
tolerance group as qQ because it inherits its type and constraints from qQ.
quantities, flow like effects. Table 1 lists these effects for a number of physical
disciplines [5],[6].
A nature declaration may also declare an array nature or a record nature. The
corresponding declarations parallel those of composite type declarations, and the
sub nature declaration serves a purpose similar to the subtype declaration. The
predefined attribute N' Across denotes the across type of a nature N; in the example it is
Vol tage. Similarly, N'Through denotes the through type of N, in the example,
Current.
The type of a branch quantity is derived from the nature of its terminals. It is a
composite type if the nature of one of its terminals is composite. In the example, the
across quantity v which represents the potential difference between the two terminals is
of type Vol tage and its tolerance code is "vol tage". Similarly, the type of the two
VHDL 1076.1: Analog and Mixed-Signal Extensions to VHDL 25
through quantities il and i2, which represent two parallel branches, is Current, and
their tolerance code is "current".
The two terminals of a branch quantity must have either both scalar natures, or both the
same composite nature, or one a scalar nature and the other a composite nature. In either
case the scalar subelements of both natures must have the same simple nature. The
terminals are called the plus terminal and minus terminal of the branch quantity and the
direction of the branch is plus to minus-in an electrical system, the direc;tion of
positive current flow. The following statements declare an array nature, two terminals
of that nature, and declarations for through quantities for the possible combinations of
scalar and composite plus and minus terminals. Figure 1 shows the resulting quantities
graphically.
nature Electrical_vector is array(Natural range <» of Electrical;
terminal t3, t4: Electrical_vector(l to 5);
quantity i3 through t3 to tl;
quantity i4 through t2 to t4;
quantity i5 through t3 to t4;
t1 t3 t2 t3
plus terminal
i1 i2 i5
minus terminal
t2 t1 t4 t4
Figure 1: Scalar and Composite Branch Quantities
The tolerance group of a branch quantity is determined by its subtype. It can be
overwritten in a subnature declaration or in the declaration of the branch quantity. The
following statements declare a subnature Highvoltage with appropriate tolerance codes,
two terminals of that subnature, and two across and one through quantities:
subnature Highvoltage is Electrical
tolerance "highvoltage" across "highcurrent" through;
terminal t5, t6: Highvoltage;
quantity vhl across ihl through t5 to t6;
quantity vh2 tolerance "voltage" across t5 to t6;
The tolerance groups for the branch quantities vhl and ihl are those defined by the
subnature declaration: they are "highvoltage" and "highcurrent". The tolerance
group for the across quantity vh2 is "vol tage".
A terminal may be declared anywhere a signal declaration is allowed. In particular, a
terminal, like a signal, can be a port of an entity. For instance, the following statement
declares the terminal ports of a diode:
port (terminal anode, cathode: Electrical);
When a model with this port list is instantiated the connection of terminal ports
constructs nodes in the hierarchical description at which Kirchhoff's laws (or their
equivalents in other disciplines) hold. The corresponding conservation equations are
26 CHAPTER 2
automatically extracted from the graph created by the declared branch quantities and
terminals and the association of terminals into nodes.
The declaration of a simple nature creates a reference terminal (a "ground") which is
shared by all terminals with elements of that simple nature. The reference terminal of a
terminal T of nature N is designated N'Reference. If a branch quantity declaration
includes only a single terminal then the minus terminal of the branch quantity is defined
to be the reference terminal of the simple nature of the specified terminal. In other
words, the declaration creates a branch to ground. The declaration of T itself creates two
quantities:
• The reference quantity T'Reference is an across quantity with T and N'Reference as
its plus and minus terminals.
• The contribution quantity T'Contribution is a through quantity whose value is equal
to the sum of all through quantities incident to T (with appropriate sign).
If T is composite, so are T'Reference and T'Contribution, and the rules apply to each
scalar subelement ofT.
For instance, the constitutive equation ofa resistor could be written as i == vir;
where i and v are a through and an across quantity, respectively, representing the
current through and the voltage across the resistor, and r is the resistance value. The
expressions may have composite values, in which case there must be a matching
subelement on the left for each subelement on the right. The expressions may refer to
quantities, signals, constants, shared variables, literals and functions. When the analog
solver has properly established the values of each quantity the matching subelements of
the expressions will be (approximately) equal.
The language defines three additional forms of simultaneous statements.
• The simultaneous procedural statement allows a user to notate DAEs using a
sequential style. This style is more familiar to model writers with experience in one
of the continuous system simulation languages like ACSL [7]. The simultaneous
procedural statement can include any sequential statement of the VHDL language,
except wait statements and signal assignments.
VHDL 1076.1: Analog and Mixed-Signal Extensions to VHDL 27
• The simultaneous case statement and the simultaneous if statement support the
description of piecewise defined behavior. Each contains an arbitrary list of
simultaneous statements in its statement parts, including nested simultaneous case
and if statements. Only the simultaneous statements selected by the case expressions
and chosen by the conditional expressions are considered by the analog solver.
The example of a limiting voltage amplifier shown in Figure 2 brings together many of
the new language concepts: terminal ports, branch quantities, and simultaneous
statements.
entity limiter is
generic (gain: Real := 1.0; limit: Real);
port ( terminal inp, inm: Electrical; -- input terminals
terminal p, m: Electrical); -- output terminals
end entity limiter;
following statement explicitly specifies the tolerance group for the simple simultaneous
statement describing a resistor:
i == v / r tolerance "toll";
The language definition makes another concession to the realities of practical solution
algorithms. Iterative algorithms assume that during a sequence of iterations only the
quantity values change, controlled by the iterative engine. If a simultaneous statement
includes shared variables or calls to impure functions, and if their values change during a
sequence of iterations for reasons other than changes in function arguments, then the
simultaneous statement must be marked impure. By default, simultaneous statements
are pure, and models that include impure simultaneous statements are potentially
nonportable. Note that a simultaneous statement that includes a call to the impure
function NOW is pure, because time does not advance during iterations: NOW always
returns the same value. It is prudent to avoid statements with side effects in
simultaneous statements, for example assert and report statements, because their effects
are not controlled by the model in an iterative context.
A digital process that is sensitive to such a signal executes at the exact time of the
threshold crossing, which may have no exact representation in physical type Time. Such
times are called offset times. Any process resuming as a consequence of a delta-delayed
signal assignment in a process executing at an offset time also executes at the same offset
time, and postponed processes execute, as usual, immediately before time advances.
However, any delayed signal assignment occurs at a time exactly representable in
physical type Time, converted by truncation.
If a discontinuity occurs in the solution of the DAEs the underlying mathematical
framework requires that the analog solver be notified. The break mechanism serves this
purpose: a model must generate a kind of pseudo-event at the time of each discontinuity
in the model. A discontinuity will occur if, for example, a quantity is equated to a signal
in a simple simultaneous statement and an event occurs on that signal. There is no
known algorithm that can reliably and efficiently detect and successfully correct for
discontinuities without explicit notification of the time of occurrence. Therefore, the
language includes a break statement that has both a sequential and a concurrent form.
The execution of the break statement creates an event on the implicit BREAK signal; the
signal itself is not visible in the model. The language semantics require the analog solver
to assume a discontinuity whenever the driver of the BREAK signal is active. The break
statement includes a provision for specifying new initial conditions for selected
quantities, to be applied after the discontinuity. The following example demonstrates
the use of a break statement in a simple DIA converter.
entity dac is
generic (vhigh: Real := 5.0); output voltage for s='l'
port ( signal s: in Bit; bit-valued input
terminal a: Electrical); output
end entity dac;
30 CHAPTER 2
A model must include an appropriate break statement if the name of a signal appears in
an expression in a simultaneous statement and an event on the signal causes a
discontinuity. Similarly, a break statement is required if a discontinuity is introduced by
the selection of a different set of simultaneous statements, for example when the value
of the condition in a simultaneous if statement changes. However, break statements are
not needed for discontinuities in one of the predefined quantities S'Ramp or S'Slew (see
Section 2.3.9), even if these quantities appear in expressions in a simultaneous
statement.
The effect of specifying initial conditions is that suitable equations from the set (2) are
replaced by the initial conditions. For the example they are the equations dq lldt = 0 and
dq21dt = O. This can only happen if q 1'Dot and q2'Dot appear in the text of the model,
because otherwise these equations are not part of (2). Investigations are underway at the
time of this writing to extend the syntax of the break statement to allow for a more
flexible specification of initial conditions.
The kernel process controls the driver of the predefined signal DOMAIN whose type is
the enumerated type DOMAIN_TYPE. During initialization the value of the DOMAIN
signal is set to INITIALIZATION_DOMAIN. When the quiescent point has been
reached the kernel assigns a new value to the DOMAIN signal: TIME_DOMAIN if the
quiescent point has been found on behalf of a time domain simulation,
FREQUENCY_DOMAIN if a frequency domain simulation follows. As a consequence
of this signal assignment the execution of the postponed processes is skipped, and at
least one more delta cycle is executed to update the DOMAIN signal. This makes it
possible to resume a process when the quiescent point has been reached, and to define
different behavior for finding the quiescent point, time domain simulation, and
frequency domain simulation.
entity current_source is
generic (dc, ac_mag, ac-phase, ns_mag: Real .- 0.0);
port (terminal p, m: Electrical);
end entity current_source;
32 CHAPTER 2
The expressions defining the magnitude for a source quantity or the phase for a spectral
source quantity are general VHDL expressions. In particular, they may include the
names of other quantities, which allows, for example, to define bias dependent noise.
Additionally, these expressions may include calls to the predefined function
FREQUENCY that returns the current simulation frequency. It is the only place where
this function may be called, i.e. the language supports the specification of frequency
dependent stimulus, but not of frequency dependent behavior.
2.3.9. Miscellaneous
VHDL 1076.1 contains a variety of other facilities that we briefly summarize here.
Besides the explicit quantities and the implicit quantities already discussed, the language
defines a number of additional implicit quantities. Most have been defined to simplify
the writing of VHDL 1076.1 models; their functionality is defined by means of an
equivalent block. In the descriptions Q and S represent a quantity and a signal.
• The quantity Q'Delayed(T), where T is a static expression of type Real, implements
an ideal delay, i.e. the value of quantity Q at a fixed interval T in the past. Its type is
that of Q; it can be a composite type.
• The quantity Q'Zoh(T, Initial_Delay), where T and Initial_Delay are static
expressions of type Real, implements a zero order hold with a sampling period T and
a first sampling after Initial_Delay seconds. Its type is that of Q; it can be a
composite type.
• The quantity Q'Ltf(Num, Den) implements a Laplace transfer function with Q as
input, i.e. the ratio of two polynomials in the Laplace variable s, with the numerator
polynomial coefficients specified by Num and the denominator polynomial
coefficients specified by Den. Num and Den must static expressions of the new
predefined type Real_vector. The type of Q'Ltf is that of Q; it must be a scalar
type.
• The quantity Q'Ztf(Num, Den, T, Initial_Delay) implements a z-domain transfer
function with Q as input, i.e. the ratio of two polynomials in z-l, with the numerator
polynomial coefficients specified by Num and the denominator polynomial
coefficients specified by Den. Its sampling period is T, and the first sampling occurs
after Initial_Delay seconds. Num and Den must be static expressions of the new
predefined type Real_vector, T and Initial_Delay must be static expressions of type
Real. The type of Q'Ztf is that of Q; it must be a scalar type.
• The quantity Q'Slew(Max_Rising_Slope, Max_Falling_Slope) follows Q, but its
change over time is constrained by the specified maximum slopes. Max_Rising_Slope
and Max_Falling_Slope must be static expressions of type Real. If
Max_Falling_Slope is not specified it defaults to Max_Rising_Slope; if neither is
VHDL 1076.1: Analog and Mixed-Signal Extensions to VHDL 33
specified the value of Q'Slew is identical to the value of Q at all times. The type of
Q'Slew is that of Q; it must be a scalar type .
• The quantity S'Slew(Max_Rising_Slope, MaxJalling_Slope) where S is a signal ofa·
floating point type follows S, but ramps linearly with one of the specified maximum
slopes from its current value when S has an event to the new value of S.
Max_Rising_Slope and Max_Falling_Slope must be static expressions of type Real.
If MaxJailing_Slope is not specified it defaults to Max_ RisinLSlope; if neither is
specified the value of S'Slew is identical to the value of S at all times. The type of
S'Slew is that of S. A model using S'Slew does not need break statements for the
discontinuities in S'Slew.
• The quantity S'Ramp(Tr, Tf) where S is a signal of a floating point type follows S,
but ramps linearly over the specified rise time Tr or fall time Tf from its current
value when S has an event to the new value of S. Tr and Tf must be static
expressions of type Real. If Tf is not specified it defaults to Tr; if neither is specified
they both default to 0.0, i.e. the value ofS'Ramp is identical to the value ofS at all
times. The type of S'Ramp is that of S. A model using S'Ramp does not need break
statements for the discontinuities in S'Ramp.
2.4. EXAMPLES
We will demonstrate the use of the VHDL 1076.1 language with examples from a
variety of application areas.
thermal
resistances
library disciplines;
use disciplines.electrical_system.all;
use work. real_aux. all;
entity xfrm is
generic (ml: Real_matrix); -- matrix of self/mutual inductances
port (terminal p, m: Electrical_vector);
end entity xfrm;
instantiation statements. Note the component instantiation statement for the balancing
transformer, which makes it a transformer with two windings.
library disciplines;
use disciplines.electrical_system.all;
use disciplines.thermal_system.all;
use work. real_aux. all;
entity quenching is
end entity quenching;
entity bouncer is
end entity bouncer;
library disciplines;
use disciplines.electrical_system.all;
entity scr is
generic ( vdrop: Voltage := 0.7; On voltage drop
von: Voltage := 0.7; Turn on voltage
ihold: Current := 0.0; Holding current
ron: Real := 0.le-9); On resistance
port (terminal anode, cathode, gate: Electrical);
end entity scr;
Acknowledgements
The authors would like to thank their colleagues from the 1076.1 Language Design
Committee for their contributions to the design of the extended language.
VHDL 1076.1: Analog and Mixed-Signal Extensions to VHDL 41
REFERENCES
[1] "VHDL 1076.1 Design Objective Document," IEEE 1076.1 Working
Group, 1995.
[2] C.-J. R. Shi, and A.Vachoux, "VHDL-A Design Objectives and Rationale," In
J.-M. Berge, O. Levia, J. Rouillard (Ed.). Current Issues in Electronic
Modeling, vol. 2: Modeling in Analog Design. Kluwer, 1995.
[3] "IEEE Standard VHDL Language Reference Manual", ANSI/IEEE
Std 1076-1993.
[4] K.E. Brenan, S.L.Campbell, and L.R.Petzold, "Numerical Solution of Initial-
Value Problems in Differential-Algebraic Equations, "North-Holland, 1989.
[5] F.E. Cellier, "Continuous System Modeling, " Springer-Verlag, 1991.
[6] J.W. Lewis, "Modeling Engineering Systems," HighText Publications, 1994.
[7] E.E.L. Mitchell, J.S. Gauthier, "ACSL: Advanced Continuous Simulation
Language-User Guide and Reference Manual, " Mitchell & Gauthier Assoc.,
Concord, MA, 1986.
[8] C.C. Pantelides, "The Consistent Initialization of Differential-Algebraic
Systems," SIAM J.Sci.Stat, Comput., 9(2): 213-231, March 1988.
[9] L.O. Chua, P.-M. Lin, "Computer-Aided Analysis of Electronic Circuits, "
Prentice-Hall, 1975.