back.pysim: collect handlers before running (-5% runtime).
This commit is contained in:
parent
a7ebc02bdd
commit
b09f4b10ee
|
@ -306,10 +306,13 @@ class Simulator:
|
|||
self._vcd_writer.change(vcd_signal, self._timestamp * 1e10, new.value)
|
||||
|
||||
def _handle_event(self):
|
||||
handlers = set()
|
||||
while self._state.curr_dirty:
|
||||
signal = self._state.curr_dirty.pop()
|
||||
if signal in self._handlers:
|
||||
for handler in self._handlers[signal]:
|
||||
handlers.update(self._handlers[signal])
|
||||
|
||||
for handler in handlers:
|
||||
handler(self._state)
|
||||
|
||||
for signal in self._state.next_dirty:
|
||||
|
|
Loading…
Reference in a new issue