def __init__(self, entity, name, clock, **kwargs): # emulate keyword-only arguments in python 2 index = kwargs.pop("array_idx", None) reject_remaining_kwargs('__init__', kwargs) self.log = SimLog("cocotb.%s.%s" % (entity._name, name)) Driver.__init__(self) self.entity = entity self.clock = clock self.bus = Bus(self.entity, name, self._signals, self._optional_signals, array_idx=index) # Give this instance a unique name self.name = name if index is None else "%s_%d" % (name, index)
def __init__(self, *args, **kwargs): # emulate keyword-only arguments in python 2 self._clock = kwargs.pop("clk", None) reject_remaining_kwargs('__init__', kwargs) self._signals = [] for arg in args: self._signals.append(Wavedrom(arg)) self._coro = None self._clocks = 0 self._enabled = False if self._clock is None: raise ValueError("Trace requires a clock to sample")