Esempio n. 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()
Esempio n. 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()
Esempio n. 3
0
 def __init__(self, func):
     self._coro = cocotb.coroutine(func)
Esempio n. 4
0
 def decorator(self, func):
     return cocotb.coroutine(func)
Esempio n. 5
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
Esempio n. 6
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
Esempio n. 7
0
def coroutine(func):
    if using_cocotb():
        wrapped = cocotb.coroutine(func)
        return wrapped
    else:
        return func