Product Documentation
Analog Expression Language Reference
Product Version IC23.1, June 2023

1


Basic Concepts

Introduction to Analog Expression Language (AEL)

The Analog Expression Language (AEL) is an expression language designed to:

This manual contains concept and reference information about Analog Expression Language (AEL) and provides some sample applications. This user guide is aimed at developers and designers of integrated circuits and assumes that you are familiar with analog design and simulation. You should also be proficient in Cadence® SKILL language programming.

The following topics are discussed in this chapter:

Overview

This section explains the concepts of the Analog Expression Language (AEL) and provides some sample applications. AEL is not a programming language, but an expression language designed to

AEL distinguishes between several types of expression components:

AEL is used in these situations:

In these and other situations, the controlled partial evaluation of expressions makes a single expression useful in a number of otherwise incompatible contexts. To get the same effect without controlled partial evaluation requires the maintenance of separate but related expressions, and possibly more than one expression evaluation mechanism.

Terminology

The following terms are used in this section.

Complex

In AEL, a defined data type for complex numbers. In Cadence® SKILL language, a user-defined data type for complex numbers.

Complex Strnum

A text representation of a number of the form “complex (r, i)”

Double

A SKILL f (flonum)

Inherited Parameters

A parseAsCEL parameter on the parent instance

Instance Parameters

A parseAsCEL parameter on the current instance

Integer

A SKILL x (fixnum)

List

A SKILL l (list) or a typedef by that name in the il.h file

Related Parameters

A term that defines instance and inherited parameters together

String

A SKILL t (text)

Strnum

A text representation that contains nothing but a number with optional leading and trailing white space

Globals and Constant Globals

AEL globals are values that apply to all parts of any given large application. For example, they represent values such as the sheet resistivity of a particular material or the temperature at which a given simulation is run.

Some AEL globals are built-in constants. Constant globals behave the same way as user globals, except that they exist in every AEL environment and their values cannot be changed.

The names of built-in constants and mathematical functions are reserved words and cannot be used as names of user globals. Refer to Appendix A, AEL Evaluation Symbols for reserved names.

Suffixes and Converters

Suffixes and converters provide a shorthand notation for expressing powers of 10 and other multipliers. For example, 5p reads five pico and represents the value 5.0e-12 or 0.000000000005. (For more information on suffixes and converters, refer to “AEL Evaluation Symbols”.)

Defined and Deferred Globals and Functions

A user-supplied global is defined when it has a data type and a value. The value can be changed, but the data type cannot. A global is deferred if it appears in an expression but does not have a data type or value. A deferred global cannot become defined and a defined global cannot become deferred.

A defined function is one that is compiled into AEL. Both AEL-supplied and user-supplied functions are compiled into AEL. (You must have the Integrator’s Toolkit™ [ITK] to do this.) The functions have a return type and, in most cases, an argument template. A function is deferred if it appears in an expression but is not compiled into AEL. A deferred function cannot become defined, and a defined function cannot become deferred.

AEL can replace a defined global with its value or a defined function call with its return value, if all arguments are also defined. If a function or global is deferred or if a defined function has any deferred arguments, AEL cannot replace the global or function with a value.

In some cases, you may want to defer a function or global so that a simulator used later in the process can define and call the function or resolve the global. For example, if you want a simulator to sweep a variable, you can defer the design global in AEL. The resulting symbolic expression can then be passed to the simulator for further evaluation.

All AEL globals and functions reside in a single name space and must be unique.

Component Description Format (CDF)

Component Description Format (CDF) is a facility for dynamically defining parameters for objects at different levels of the hierarchy of a design.

AEL can affect intercomponent CDF parameter dependencies. In particular, a parameter value on a given cell can be a function of the values of other parameters on the same cell or on the parent cell. Outside of AEL, such interdependent CDF parameter relationships are supported through user-written callbacks. They are not inherent in CDF and are not supported in contexts other than form-based user input.

For a CDF parameter to be processed by AEL, it must be a text string whose content is a legal AEL expression. The string must be marked parseAsCEL. Expressions marked this way can refer to other parseAsCEL parameters on the same cell or on the parent cell. (For more information on CDF, refer to the Component Description Format User Guide.)

Compile and Interpret

AEL expressions can be compiled and executed in separate steps or they can be interpreted (compiled and executed in one step). In some contexts, compilation is not possible or interpretation is more appropriate. AEL is most efficiently used, however, with expressions that are compiled once and executed many times.

Because AEL supports partial evaluation, compilation is not a clearly defined task. It assumes the following conditions:

If the first assumption is violated, you can perform only a one-time evaluation, not a compilation. If the second assumption is violated, compilation is invalidated, requiring a recompile. Either of these situations converts the compiler into an interpreter, defeating its purpose.

An evaluation mode determines which expression components are evaluated and which are retained unaltered. The evaluation mode that is set when an environment is created cannot be changed and applies to all expressions compiled in that environment. Each expression interpreted in a given environment can specify any evaluation mode desired.

Syntax

Use the following guidelines when creating AEL expressions:

Licensing Requirements

For information about licensing in the Virtuoso Studio Design Environment, see Virtuoso Software Licensing and Configuration Guide.

Partial Evaluation

A simple expression evaluator typically yields a floating-point value. An evaluator like AEL, that supports partial evaluation and deferred symbols, cannot do so. AEL can only convert the input string into another string containing a modified representation. For example, if the input string is

3*2*factor

and factor is a deferred global, AEL converts this input to

6*factor

If you want to use an expression in its most symbolic form, do not request any evaluation. If you want to use an expression in its most mathematical form, request evaluation of all globals and suffixes, but do not call functions or apply operators. If you use a simulator that does not support any expressions, request full evaluation. Full evaluation requires that all globals and functions be defined and that none are deferred.

Partial evaluation allows you to request evaluation of some or all expression components. If you request full evaluation and any globals or functions are deferred, those globals and functions remain symbolic. For example,

1.5u*3

produces a string representation of a double (“4.5e-6”) if suffixes are being evaluated. It remains unchanged if they are not.

Partial Evaluation Example

The following is a sample AEL expression.

2 * pi * pPar("freq") / sqrt(iPar("w") * magic(c)) * 1.5u

This expression contains these components:

Component Definition

2

unsuffixed literal

*

mathematical multiplication operator

pi

constant global

freq

CDF parameter inherited from the current cell’s parent

/

mathematical division operator

sqrt

predefined function

w

CDF parameter on the current cell instance

magic

user-supplied function

c

user-supplied global

1.5u

suffixed literal

If you request literal evaluation, the evaluator returns the expression as entered. If you request full evaluation, and neither magic nor c is deferred, the evaluator returns a string representation of a double-precision floating-point number. This number results from replacing globals with their values, replacing suffixed literals with their equivalents in scientific notation, calling functions, and applying operators.

The following string results if none of the components in the expression are deferred and you request evaluation of globals, suffixes, and CDF parameters:

2 * 3.14159265358979323846 * 1e9 / sqrt(3e-6 * magic(10)) * 1.5e-6

All predefined and user-defined globals are replaced with their values, suffixed numbers are replaced with their equivalents in scientific notation, and all CDF parameter functions are called. However, no non-CDF functions are called and no operators are applied.

The values returned by pPar( ) and iPar( ) were arbitrarily chosen for this example.

If full evaluation of the same expression is requested and the user-supplied global c is deferred, the evaluator returns the following string.

6.283185307e9 / sqrt(3e-6 * magic(c)) * 1.5e-6

By deferring c, you also defer the following elements:

Even though you request full evaluation, only two of five operators are applied and neither of the two non-CDF functions is called. If the expression is used only for annotation or if the expression will be passed to an evaluator that can finish the job, the expression might be acceptable in this state.

The cascading effect of even a single deferred value, as illustrated in this example, can have unexpected results.

Evaluating AEL Expressions

Attaching Expressions to Design Components

The documentation for CDF describes how to create a string parameter, marked parseAsNumber and parseAsCEL, and how to attach it to a given cell. When AEL expressions are used as parameters, two things happen:

For more information on CDF, refer to the Component Description Format User Guide.

Example Expressions and Evaluation

The following is an example expression using AEL syntax followed by a table listing the results of several different types of evaluation.

2 * pi * pPar(“freq”) / sqrt(iPar(“w”) * magic(c)) * 1.5u

For the purposes of this expression, the following values are assumed:

freq = “10M”

(on the parent of the current cell)

w = “5n”

(on the current cell)

c = 1.23

(a user-supplied AEL global)

Evaluation Method Resulting Expression

Suffixes

2 * pi * pPar(“freq”) / sqrt(iPar(“w”) * magic(c)) * 1.5e-6

Globals

2 * 3.14159 * pPar(“freq”) / sqrt(iPar(“w”) * magic(1.23)) * 1.5u

Instance CDF parameters

2 * pi * pPar(“freq”) / sqrt(5e-9 * magic(c)) * 1.5u

Inherited CDF parameters

2 * pi * 10e6 / sqrt(iPar(“w”) * magic(c)) * 1.5u

Related parameters

2 * pi * 10e6 / sqrt(5e-9 * magic(c)) * 1.5u

Related parameters and suffixes

2 * pi * 10e6 / sqrt(5e-9 * magic(c)) * 1.5e-6

Full evaluation

421.5e9


Return to top
 â €
X