I want to find out the maximum range for user-defined physical types like the following:
type resistance is range 0 to 1_000_000 units Ohm; kOhm = 1000 Ohm; MOhm = 1000 kOhm; end units resistance;
Documentation for physical types (VHDL LRM sections 3.1.3 and 3.1.2) says that the range is of integer type, so I could write
range integer'low to integer'high which is the same as
range -2_147_483_648 to 2_147_483_647. However, my simulator seems to use 64-bit arithmetic here, and
range -40_000_000_000_000 to 40_000_000_000_000 also works, as does
range -2**62 to 2**62 (while
2**63 does not).
Is there a canonical way to find out the simulator-supported range?
If not, how would I put the empirically-found
2**62 into a constant (for externalizing such simulator-specific code)? An integer constant won't cut it :)