sim._pyclock: new type of process.
authorwhitequark <whitequark@whitequark.org>
Thu, 27 Aug 2020 07:54:27 +0000 (07:54 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 31 Dec 2021 15:11:14 +0000 (15:11 +0000)
commit9a910d3d9735538234961d07c82e7c929a509773
tree78cc43a28d04f97978cb97e5776a43451991ee47
parent432ef66063fe5e0fb45dafcf766a7a22a67e5280
sim._pyclock: new type of process.

The overhead of coroutine processes is fairly high. A clock driver
implemented through a coroutine process is mostly overhead. This was
partially addressed in commit 2398b792 by microoptimizing yielding.

This commit eliminates the coroutine process overhead completely by
introducing dedicated clock processes. It also simplifies the logic
to a simple toggle.

This change improves runtime by about 12% on Minerva SRAM SoC.
nmigen/sim/_pyclock.py [new file with mode: 0644]
nmigen/sim/pysim.py