Beispiel #1
0
 def execute_function(self, event):
     coro = cocotb.coroutine(self._func)(*args, **kwargs)
     try:
         _outcome = outcomes.Value((yield coro))
     except BaseException as e:
         _outcome = outcomes.Error(e)
     event.outcome = _outcome
     event.set()
Beispiel #2
0
 def execute_function(self, event):
     coro = cocotb.coroutine(self._func)(*args, **kwargs)
     try:
         _outcome = outcomes.Value((yield coro))
     except BaseException as e:
         _outcome = outcomes.Error(e)
     event.outcome = _outcome
     event.set()
Beispiel #3
0
 def __init__(self, func):
     self._coro = cocotb.coroutine(func)
Beispiel #4
0
 def decorator(self, func):
     return cocotb.coroutine(func)
Beispiel #5
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
Beispiel #6
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
Beispiel #7
0
def coroutine(func):
    if using_cocotb():
        wrapped = cocotb.coroutine(func)
        return wrapped
    else:
        return func