A
Standard Packages Supported
This chapter includes information on:
- The IEEE libraries that are included in the installation. See “IEEE Libraries for VHDL-AMS”.
- Support for the IEEE standard VHDL mathematical packages. See “IEEE Standard VHDL Mathematical Packages”
IEEE Libraries for VHDL-AMS
The software supplied by Cadence includes two libraries designed for use with VHDL-AMS. The first library is a superset of the default IEEE library. The second library is a superset of the IEEE (pure) library. Both libraries include the VHDLAMS specific packages:
package IEEE.ELECTRICAL_SYSTEMS
package IEEE.ENERGY_SYSTEMS
package IEEE.FLUIDIC_SYSTEMS
package IEEE.FUNDAMENTAL_CONSTANTS
package IEEE.MATERIAL_CONSTANTS
package IEEE.MECHANICAL_SYSTEMS
package IEEE.RADIANT_SYSTEMS
package IEEE.THERMAL_SYSTEMS
To use the VHDL-AMS superset of the IEEE library, include the following lines in your cds.lib files.
SOFTINCLUDE $AMSHOME/tools/xcelium/files/cds.lib
UNDEFINE ieee
DEFINE ieee $AMSHOME/tools/xcelium/files/IEEE_vhdlams/IEEE
To use the VHDL-AMS superset of the IEEE (pure) library, include the following lines in your cds.lib files.
SOFTINCLUDE $AMSHOME/tools/xcelium/files/cds.lib
UNDEFINE ieee
DEFINE ieee $AMSHOME/tools/xcelium/files/IEEE_vhdlams_pure/IEEE
With this preparation, you can access the VHDL-AMS specific definitions that are included in the packages. For example, to access electrical natures in your design, you specify the following in your code:
library ieee;
use ieee.electrical_systems.all
For more information, see the VHDL-AMS package source located in
your_install_directory/tools/xcelium/files/IEEE_vhdlams.src
IEEE Standard VHDL Mathematical Packages
The AMS Designer simulator supports the VHDL mathematical packages defined in IEEE Standard VHDL Mathematical Packages (IEEE Std 1076.2-1996). This standard defines two package declarations: MATH_REAL and MATH_COMPLEX. The packages define a standard for designers to use in describing VHDL models that make use of common REAL or COMPLEX constants and common REAL or COMPLEX mathematical functions and operators.
Because of the IEEE copyright on these packages, Cadence cannot redistribute the source code. The source files (MATH_COM.vhd and MATH_REAL.vhd) that are shipped with the AMS Designer simulator have been stripped of all VHDL code.
The precompiled packages are included with the simulator. You can use the precompiled mathematical packages without the source code if you know which constants, functions, procedures, and operators are defined in the packages. The following sections tell you what the two packages contain.
If, for some reason, you need the VHDL source code for the mathematical packages (for example, if you must recompile the packages because a library on which they depend has changed), you can get the source code, and a copy of the IEEE Std 1076.2-1996 standard, by contacting the IEEE directly at:
http://www.ieee.org
As explained in the previous section, two sets of IEEE packages are shipped with the simulator (the Synopsys packages and the “IEEE_pure” packages). However, unlike the other packages, the IEEE mathematical packages are compiled under both the IEEE and IEEE_pure directories. The AMS Designer simulator also supports the Synopsys version of the packages. To use the Synopsys version, you must first purchase it and then compile it into the IEEE library. Before you compile the source code, remove the following line from MATH_REAL.vhd:
attribute FOREIGN : string;
This line of code redefines the FOREIGN attribute, which is already defined in the STANDARD package. When the AMS Designer simulator detects the redefinition of the FOREIGN attribute, it hides both definitions of the attribute, in compliance with the VHDL LRM.
To avoid warning messages while compiling the Synopsys version, remove the dummy VHDL implementations of RAND, SRAND, and GET_RAND_MAX from MATH_REAL.vhd. Because these three functions are defined as FOREIGN functions, the AMS Designer simulator issues the following warning message when it sees the VHDL implementations of the three functions that have the FOREIGN attribute:
ncvhdl_p: *W,FATSPB : FOREIGN subprogram has body which will never be called.
If you are using the Synopsys version, you can use the “C_NATIVE” functions RAND, SRAND, and GET_RAND_MAX.
MATH_REAL
This section lists the constants, functions and procedures available in the MATH_REAL package.
Constants
The MATH_REAL package defines the following constants:
- MATH_E
- MATH_1_OVER_E
- MATH_PI
- MATH_2_PI
- MATH_1_OVER_PI
- MATH_PI_OVER_2
- MATH_PI_OVER_3
- MATH_PI_OVER_4
- MATH_3_PI_OVER_2
- MATH_LOG_OF_2
- MATH_LOG_OF_10
- MATH_LOG2_OF_E
- MATH_LOG10_OF_E
- MATH_SQRT_2
- MATH_1_OVER_SQRT_2
- MATH_SQRT_PI
- MATH_DEG_TO_RAD
- MATH_RAD_TO_DEG
Functions and Procedures
The MATH_REAL package contains the following functions and procedures:
- function SIGN (X : in REAL) return REAL;
- function CEIL (X : in REAL) return REAL;
- function FLOOR (X : in REAL) return REAL;
- function ROUND (X : in REAL) return REAL;
- function TRUNC (X : in REAL) return REAL;
- function "MOD" (X, Y : in REAL) return REAL;
- function REALMAX (X, Y : in REAL) return REAL;
- function REALMIN (X, Y : in REAL) return REAL;
- procedure UNIFORM (variable SEED1,SEED2:inout POSITIVE; variable X:out REAL);
- function SQRT (X : in REAL) return REAL;
- function CBRT (X : in REAL) return REAL;
- function "**" (X : in INTEGER; Y : in REAL) return REAL;
- function "**" (X : in REAL; Y : in REAL) return REAL;
- function EXP (X : in REAL) return REAL;
- function LOG (X : in REAL) return REAL;
- function LOG2 (X : in REAL) return REAL;
- function LOG10 (X : in REAL) return REAL;
- function LOG (X : in REAL; BASE : in REAL) return REAL;
- function SIN (X : in REAL) return REAL;
- function COS (X : in REAL) return REAL;
- function TAN (X : in REAL) return REAL;
- function ARCSIN (X : in REAL) return REAL;
- function ARCCOS (X : in REAL) return REAL;
- function ARCTAN (X : in REAL) return REAL;
- function ARCTAN (Y : in REAL; X : in REAL) return REAL;
- function SINH (X : in REAL) return REAL;
- function COSH (X : in REAL) return REAL;
- function TANH (X : in REAL) return REAL;
- function ARCSINH (X : in REAL) return REAL;
- function ARCCOSH (X : in REAL) return REAL;
- function ARCTANH (X : in REAL) return REAL;
MATH_COMPLEX
The MATH_COMPLEX package defines two complex types, constants, functions, and arithmetic operators.
Types
The types are defined as follows:
type COMPLEX is
record
RE: REAL; -- Real part
IM: REAL; -- Imaginary part
end record;
subtype POSITIVE_REAL is REAL range 0.0 to REAL’HIGH;
subtype PRINCIPAL_VALUE is REAL range -MATH_PI to MATH_PI;
type COMPLEX_POLAR is
record
MAG: POSITIVE_REAL; -- Magnitude
ARG: PRINCIPAL_VALUE; -- Angle in radians; -MATH_PI is illegal
end record;
Constants
- MATH_CBASE_1 defined as COMPLEX’(1.0, 0.0)
- MATH_CBASE_J defined as COMPLEX’(0.0, 1.0)
- MATH_CZERO defined as COMPLEX’(0.0, 0.0)
Functions and Operators
- function "=" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR ) return BOOLEAN;
- function "/=" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR ) return BOOLEAN;
- function CMPLX(X: in REAL; Y: in REAL:= 0.0 ) return COMPLEX;
- function GET_PRINCIPAL_VALUE(X: in REAL ) return PRINCIPAL_VALUE;
- function COMPLEX_TO_POLAR(Z: in COMPLEX ) return COMPLEX_POLAR;
- function POLAR_TO_COMPLEX(Z: in COMPLEX_POLAR ) return COMPLEX;
- function "ABS"(Z: in COMPLEX ) return POSITIVE_REAL;
- function "ABS"(Z: in COMPLEX_POLAR ) return POSITIVE_REAL;
- function ARG(Z: in COMPLEX ) return PRINCIPAL_VALUE;
- function ARG(Z: in COMPLEX_POLAR ) return PRINCIPAL_VALUE;
- function "-" (Z: in COMPLEX ) return COMPLEX;
- function "-" (Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function CONJ (Z: in COMPLEX) return COMPLEX;
- function CONJ (Z: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function SQRT(Z: in COMPLEX ) return COMPLEX;
- function SQRT(Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function EXP(Z: in COMPLEX ) return COMPLEX;
- function EXP(Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function LOG(Z: in COMPLEX ) return COMPLEX;
- function LOG2(Z: in COMPLEX ) return COMPLEX;
- function LOG10(Z: in COMPLEX ) return COMPLEX;
- function LOG(Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function LOG2(Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function LOG10(Z: in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function LOG(Z: in COMPLEX; BASE: in REAL) return COMPLEX;
- function LOG(Z: in COMPLEX_POLAR; BASE: in REAL ) return COMPLEX_POLAR;
- function SIN (Z : in COMPLEX ) return COMPLEX;
- function SIN (Z : in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function COS (Z : in COMPLEX ) return COMPLEX;
- function COS (Z : in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function SINH (Z : in COMPLEX ) return COMPLEX;
- function SINH (Z : in COMPLEX_POLAR ) return COMPLEX_POLAR;
- function COSH (Z : in COMPLEX ) return COMPLEX;
- function COSH (Z : in COMPLEX_POLAR ) return COMPLEX_POLAR;
Arithmetic operators
- function "+" ( L: in COMPLEX; R: in COMPLEX ) return COMPLEX;
- function "+" ( L: in REAL; R: in COMPLEX ) return COMPLEX;
- function "+" ( L: in COMPLEX; R: in REAL ) return COMPLEX;
- function "+" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "+" ( L: in REAL; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "+" ( L: in COMPLEX_POLAR; R: in REAL) return COMPLEX_POLAR;
- function "-" ( L: in COMPLEX; R: in COMPLEX ) return COMPLEX;
- function "-" ( L: in REAL; R: in COMPLEX ) return COMPLEX;
- function "-" ( L: in COMPLEX; R: in REAL ) return COMPLEX;
- function "-" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "-" ( L: in REAL; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "-" ( L: in COMPLEX_POLAR; R: in REAL) return COMPLEX_POLAR;
- function "*" ( L: in COMPLEX; R: in COMPLEX ) return COMPLEX;
- function "*" ( L: in REAL; R: in COMPLEX ) return COMPLEX;
- function "*" ( L: in COMPLEX; R: in REAL ) return COMPLEX;
- function "*" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "*" ( L: in REAL; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "*" ( L: in COMPLEX_POLAR; R: in REAL) return COMPLEX_POLAR;
- function "/" ( L: in COMPLEX; R: in COMPLEX ) return COMPLEX;
- function "/" ( L: in REAL; R: in COMPLEX ) return COMPLEX;
- function "/" ( L: in COMPLEX; R: in REAL ) return COMPLEX;
- function "/" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "/" ( L: in REAL; R: in COMPLEX_POLAR) return COMPLEX_POLAR;
- function "/" ( L: in COMPLEX_POLAR; R: in REAL) return COMPLEX_POLAR;
Return to top