next up previous contents
Next: Physical Type Info Instantiation Up: The Physical Type Info Previous: Physical Type Info Variables

Physical Type Info Methods

Methods Description
'Class_Name'() Constructor to initialise the variables of the base classes. Note, as the bounds of the integer type must be locally static they can be determined at compile time.
static long long int left() Returns the left bound of the physical type. Corresponds to the ``left'' VHDL attribute.
static long long int right() Returns the right bound of the physical type. Corresponds to the ``right'' VHDL attribute.
static long long int low() Returns the low bound of the physical type. Corresponds to the ``low'' VHDL attribute.
static long long int high() Returns the high bound of the physical type. Corresponds to the ``high'' VHDL attribute.
   

Example:

TYPE TIME IS RANGE -9223372036854775807 TO 9223372036854775807
   UNITS
     fs;
     ps = 1000 fs;
     ns = 1000 ns;
     us = 1000 ns;
     ms = 1000 us;
     sec = 1000 ms;
     min = 60 sec;
     hr = 60 min;
   END UNITS;
is converted into the following type info class
// Note, all physical values are represented as 64 bit integers
class L3lib_Q8standard_I4time : public physical_info_base {
public:
  const static long unit_count = 7;
  const static char *units[7];
  const static long long int scale[7];
  static long long int low() { return -9223372036854775807LL; };
  static long long int high() { return 9223372036854775807LL; }
  static long long int left() { return -9223372036854775807LL; }
  static long long int right() { return 9223372036854775807LL; }
  L3lib_Q8standard_I4time() :
    physical_info_base(left(), right(), low(), high(), 
                       units, scale, unit_count) {};
};

const char *L3lib_Q8standard_I4time::units[7] = 
         {"fs", "ps", "ns", "us", "ms", "sec", "hr"};
const long long L3lib_Q8standard_I4time::scale[7] = 
         {1L, 1000LL, 1000000LL, 1000000000LL, 1000000000000LL,
          1000000000000000LL, 1000000000000000000LL};


next up previous contents
Next: Physical Type Info Instantiation Up: The Physical Type Info Previous: Physical Type Info Variables

1998-11-17