示例#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()
示例#2
0
文件: decorators.py 项目: TC01/cocotb
 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()
示例#3
0
 def __init__(self, func):
     self._coro = cocotb.coroutine(func)
示例#4
0
 def decorator(self, func):
     return cocotb.coroutine(func)
示例#5
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
示例#6
0
 def execute_function(self, event):
     event.result = yield cocotb.coroutine(self._func)(*args, **kwargs)
     event.set()
示例#7
0
def coroutine(func):
    if using_cocotb():
        wrapped = cocotb.coroutine(func)
        return wrapped
    else:
        return func