예제 #1
0
파일: handle.py 프로젝트: Rezam1998/cocotb
    def value(self):
        """The value of this simulation object.

        .. note::
            When setting this property, the value is stored by the :class:`~cocotb.scheduler.Scheduler`
            and all stored values are written at the same time at the end of the current simulator time step.

            Use :meth:`setimmediatevalue` to set the value immediately.
        """
        binstr = simulator.get_signal_val_binstr(self._handle)
        result = BinaryValue(binstr, len(binstr))
        return result
예제 #2
0
파일: handle.py 프로젝트: pwiecha/cocotb
 def __init__(self, handle, path, handle_type):
     NonHierarchyObject.__init__(self, handle, path)
     if handle_type in [simulator.INTEGER, simulator.ENUM]:
         self._value = simulator.get_signal_val_long(self._handle)
     elif handle_type == simulator.REAL:
         self._value = simulator.get_signal_val_real(self._handle)
     elif handle_type == simulator.STRING:
         self._value = simulator.get_signal_val_str(self._handle)
     else:
         val = simulator.get_signal_val_binstr(self._handle)
         self._value = BinaryValue(n_bits=len(val))
         try:
             self._value.binstr = val
         except:
             self._value = val
예제 #3
0
파일: handle.py 프로젝트: Rezam1998/cocotb
 def __init__(self, handle, path, handle_type):
     """
     Args:
         handle (int): The GPI handle to the simulator object.
         path (str): Path to this handle, ``None`` if root.
         handle_type: The type of the handle
             (``simulator.INTEGER``, ``simulator.ENUM``,
             ``simulator.REAL``, ``simulator.STRING``).
     """
     NonHierarchyObject.__init__(self, handle, path)
     if handle_type in [simulator.INTEGER, simulator.ENUM]:
         self._value = simulator.get_signal_val_long(self._handle)
     elif handle_type == simulator.REAL:
         self._value = simulator.get_signal_val_real(self._handle)
     elif handle_type == simulator.STRING:
         self._value = simulator.get_signal_val_str(self._handle)
     else:
         val = simulator.get_signal_val_binstr(self._handle)
         self._value = BinaryValue(n_bits=len(val))
         try:
             self._value.binstr = val
         except Exception:
             self._value = val
예제 #4
0
파일: handle.py 프로젝트: pwiecha/cocotb
 def _getvalue(self):
     binstr = simulator.get_signal_val_binstr(self._handle)
     result = BinaryValue(binstr, len(binstr))
     return result
예제 #5
0
파일: handle.py 프로젝트: Paebbels/cocotb
 def _getvalue(self):
     result = BinaryValue()
     result.binstr = simulator.get_signal_val_binstr(self._handle)
     return result
예제 #6
0
 def _getvalue(self):
     result = BinaryValue()
     result.binstr = simulator.get_signal_val_binstr(self._handle)
     return result
예제 #7
0
 def _get_value_str(self):
     return simulator.get_signal_val_binstr(self._handle)
예제 #8
0
파일: handle.py 프로젝트: icicle99/cocotb
 def _get_value_str(self):
     return simulator.get_signal_val_binstr(self._handle)