sim._pyclock: new type of process.
authorwhitequark <whitequark@whitequark.org>
Thu, 27 Aug 2020 07:54:27 +0000 (07:54 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 27 Aug 2020 07:56:47 +0000 (07:56 +0000)
commit9bc42cb8c50b9124f308c13d6ceb7e25bbe41c65
tree1a4fca14b2c87f4a26d09685b9c90fb342a4766c
parentc00219d9f3bd76f406ffa3cacb9768a1468b1452
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