Real (IEEE-754 double-precision floating point) variable.
Values must be numeric and cannot be 'x' or 'z' states.
Definition at line 512 of file writer.py.
◆ format_value()
def format_value |
( |
|
self, |
|
|
|
value, |
|
|
|
check = True |
|
) |
| |
Format real value change for VCD stream.
:param value: Numeric changed value.
:param type: float or int
:raises ValueError: for invalid real *value*.
:returns: string representing value change for use in a VCD stream.
Reimplemented from Variable.
Definition at line 522 of file writer.py.
522 def format_value(self, value, check=True):
523 """Format real value change for VCD stream.
524
525 :param value: Numeric changed value.
526 :param type: float or int
527 :raises ValueError: for invalid real *value*.
528 :returns: string representing value change for use in a VCD stream.
529
530 """
531 if not check or isinstance(value, Number):
532 return f'r{value:.16g} {self.ident}'
533 else:
534 raise ValueError(f'Invalid real value ({value})')
535
536
◆ __slots__
The documentation for this class was generated from the following file: