-
Notifications
You must be signed in to change notification settings - Fork 31
Header license issue
Proposal by Bastien. The following is a clean room description of annex G of verilog standard. If you want to implement you should not read it, but only read this description.
Proposal by Guilherme. Alternatively we could run publicly available Verilog-AMS files thru admsXml with empty headers, and let if fail. Then we pick-up the error message update the header and start over. This way we can figure out which constants and disciplines are expected. This would be like reverse engineering the LRM without looking at it. This should be scripted, and part of the repository to give us some backing that we are not just copying from the standard. (yeah I know, convoluted but might work). We should anyway warn the user that the headers we provide are not LRM compliant. I am not sure that providing an easy way to download the headers would be accepted on Debian. Perhaps we need a non-free package just for the headers?
This file is guarded by classical ifdef CONSTANTS_H
else define CONSTANTS_H
endif
The following variable are defined, value are best value from NIST. Mathematical constant are at least suitable for double precision.
- M_E -> e^1
- M_LOG2E -> ln(e)/ln(2)
- M_LOG10E -> ln(e)/ln(10)
- M_LN2 -> ln(2)
- M_LN10 -> ln(10)
- M_PI -> archimedian constant
- M_TWO_PI -> 2*M_PI
- M_PI_2 -> M_PI/2
- M_PI_4 -> M_PI/4
- M_1_PI -> 1/M_PI
- M_2_PI -> 2/M_PI
- M_2_SQRTPI -> 2/sqrt(M_PI)
- M_SQRT2 -> sqrt(2)
- M_1_SQRT2 -> 1/sqrt(2)
- P_Q -> electron charge (SI unit)
- P_C -> speed of light in vacuum (SI unit)
- P_K -> Bolzman constant (SI unit)
- P_H -> Plank constant (SI unit)
- P_ESP0 -> vacuum permittivity (SI unit)
- P_MU0 -> vacuum permeabilitty (SI unit)
- P_CELSIUS0 -> 0°C in kelvin
... i (felix) find that we want to have
- M_E 2.71828182845904523536
- M_LOG2E 1.44269504088896340737
- M_LOG10E .43429448190325182765
- M_LN2 .69314718055994530941
- M_LN10 2.30258509299404568401
- M_PI 3.14159265358979 # (from memory, there's no pi in bc)
- M_TWO_PI 6.28318530717958
- M_PI_2 1.570796326794895
- M_PI_4 .7853981633974475
- M_1_PI .31830988618379099966
- M_2_PI .63661977236758199932
- M_2_SQRTPI 3.54490770181103022748
- M_SQRT2 1.41421356237309504880
- M_1_SQRT2 .70710678118654752440
- P_Q 1.60217646 # 10-19 coulomb. wikipedia told me.
- P_C 299792458 # m / s (dito)
- P_K 1.3806503 # 10-23 m2 kg s-2 K-1 (again)
- P_H 6.62607004081 # \times 10^{-34}\text{ J⋅s} = 4.135\ 667\ 662(25)\times 10^{-15}\text{ eV⋅s} .
- P_ESP0 8.854187817 # 10−12 F·m−1
- P_MU0 1.2566370614 # 10−6 H / m or T·m / A or Wb / (A·m) or V·s / (A·m)
- P_CELSIUS0 273.15 # 0°C in °kelvin
in the file described above.