File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,15 @@ async def testbench(ctx):
191191 which they were added. If two testbenches share state, or must manipulate the design in
192192 a coordinated way, they may rely on this execution order for correctness.
193193
194+ .. warning::
195+
196+ On Python 3.12 and earlier, async generators (:py:`async` functions that also
197+ :py:`yield`) are not cleaned up reliably when the simulator exits. To make sure context
198+ managers or :py:`finally` blocks inside async generators run properly, use Python 3.13
199+ or later. See `PEP-525`_ for more information on async generator finalization.
200+
201+ .. _PEP-525: https://peps.python.org/pep-0525/#finalization
202+
194203 Raises
195204 ------
196205 :exc:`RuntimeError`
@@ -248,6 +257,15 @@ async def process(ctx):
248257 :py:`await ctx.tick().sample(...)`. Such state is visible in a waveform viewer,
249258 simplifying debugging.
250259
260+ .. warning::
261+
262+ On Python 3.12 and earlier, async generators (:py:`async` functions that also
263+ :py:`yield`) are not cleaned up reliably when the simulator exits. To make sure context
264+ managers or :py:`finally` blocks inside async generators run properly, use Python 3.13
265+ or later. See `PEP-525`_ for more information on async generator finalization.
266+
267+ .. _PEP-525: https://peps.python.org/pep-0525/#finalization
268+
251269 Raises
252270 ------
253271 :exc:`RuntimeError`
You can’t perform that action at this time.
0 commit comments