Skip to content

Commit adcd90e

Browse files
committed
correctly sort _futureevents
1 parent 0671c4f commit adcd90e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

myhdl/_Simulation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import sys
2626
import os
27+
from operator import itemgetter
2728
from warnings import warn
2829
from types import GeneratorType
2930

@@ -157,7 +158,7 @@ def run(self, duration=None, quiet=0):
157158
if t == maxTime:
158159
raise _SuspendSimulation(
159160
"Simulated %s timesteps" % duration)
160-
_futureEvents.sort()
161+
_futureEvents.sort(key=itemgetter(0))
161162
t = _simulator._time = _futureEvents[0][0]
162163
if tracing:
163164
print("#%s" % t, file=tracefile)

0 commit comments

Comments
 (0)