![]() This is a somewhat obscure use case, but it is possible to use async functions with pysim by carefully using @asyncio.coroutine. That is, async functions can call back into pysim if they are declared in a specific way: @asyncio.coroutine def do_something(self, value): yield self.reg.eq(value) which may then be called from elsewhere with: async def test_case(self): await do_something(0x1234) This approach is unfortunately limited in that async functions cannot yield directly. It should likely be improved by using async generators, but supporting coroutines in pysim is unobtrustive and allows existing code that made use of this feature in oMigen to work. |
||
---|---|---|
.. | ||
back | ||
build | ||
compat | ||
hdl | ||
lib | ||
test | ||
vendor | ||
__init__.py | ||
_version.py | ||
asserts.py | ||
cli.py | ||
tools.py | ||
tracer.py |