Files
tools.ads.dk.old/doc/VerilogA/constants.vams
T
2026-06-26 15:48:29 +02:00

96 lines
3.5 KiB
Plaintext

// Copyright(c) 2009-2014 Accellera Systems Initiative Inc.
// 1370 Trancas Street #163, Napa, CA 94558, USA.
//
// The material in constants.vams is an essential part of the Accellera Systems
// Initiative ("Accellera") Verilog-AMS Language Standard. Verbatim copies of
// the material in this Annex may be used and distributed without restriction.
// All other uses require permission from Accellera IP Committee
// (ipr-chair@lists.accellera.org).
// All other rights reserved
//
// Version 2.4.0
//
// Mathematical and physical constants
`ifdef CONSTANTS_VAMS
`else
`define CONSTANTS_VAMS 1
// M_ is a mathematical constant
`define M_E 2.7182818284590452354
`define M_LOG2E 1.4426950408889634074
`define M_LOG10E 0.43429448190325182765
`define M_LN2 0.69314718055994530942
`define M_LN10 2.30258509299404568402
`define M_PI 3.14159265358979323846
`define M_TWO_PI 6.28318530717958647693
`define M_PI_2 1.57079632679489661923
`define M_PI_4 0.78539816339744830962
`define M_1_PI 0.31830988618379067154
`define M_2_PI 0.63661977236758134308
`define M_2_SQRTPI 1.12837916709551257390
`define M_SQRT2 1.41421356237309504880
`define M_SQRT1_2 0.70710678118654752440
// The following constants have been taken from http://physics.nist.gov
// P_ is a physical constant
// charge of electron in Coulombs
`define P_Q_SPICE 1.60219e-19
`define P_Q_OLD 1.6021918e-19
`define P_Q_NIST1998 1.602176462e-19
`define P_Q_NIST2010 1.602176565e-19
// speed of light in vacuum in meters/second
`define P_C 2.99792458e8
// Boltzmann's constant in Joules/Kelvin
`define P_K_SPICE 1.38062e-23
`define P_K_OLD 1.3806226e-23
`define P_K_NIST1998 1.3806503e-23
`define P_K_NIST2010 1.3806488e-23
// Planck's constant in Joules*second
`define P_H_SPICE 6.62620e-34
`define P_H_OLD 6.6260755e-34
`define P_H_NIST1998 6.62606876e-34
`define P_H_NIST2010 6.62606957e-34
// permittivity of vacuum in Farads/meter
`define P_EPS0_SPICE 8.854214871e-12
`define P_EPS0_OLD 8.85418792394420013968e-12
`define P_EPS0_NIST1998 8.854187817e-12
`define P_EPS0_NIST2010 8.854187817e-12
// permeability of vacuum in Henrys/meter
`define P_U0 (4.0e-7 * `M_PI)
// zero Celsius in Kelvin
`define P_CELSIUS0 273.15
`ifdef PHYSICAL_CONSTANTS_SPICE
// from UC Berkeley SPICE 3F5
`define P_Q `P_Q_SPICE
`define P_K `P_K_SPICE
`define P_H `P_H_SPICE
`define P_EPS0 `P_EPS0_SPICE
`else
`ifdef PHYSICAL_CONSTANTS_OLD
// from Verilog-A LRM 1.0 and Verilog-AMS LRM 2.0
`define P_Q `P_Q_OLD
`define P_K `P_K_OLD
`define P_H `P_H_OLD
`define P_EPS0 `P_EPS0_OLD
`else
`ifdef PHYSICAL_CONSTANTS_NIST2010
`define P_Q `P_Q_NIST2010
`define P_K `P_K_NIST2010
`define P_H `P_H_NIST2010
`define P_EPS0 `P_EPS0_NIST2010
`else
// use NIST1998 values as in LRM 2.2 - 2.3 for backwards-compatibility
`define P_Q `P_Q_NIST1998
`define P_K `P_K_NIST1998
`define P_H `P_H_NIST1998
`define P_EPS0 `P_EPS0_NIST1998
`endif
`endif
`endif
`endif