migen/genlib/fsm: fix delayed_enter when delay is negative (can happen when delay...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 2 Jun 2015 17:26:42 +0000 (19:26 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 2 Jun 2015 17:26:42 +0000 (19:26 +0200)
migen/genlib/fsm.py

index 6ad3083cd3c71f990c5b2cbaf6a199a795c7f164..7a2ee619026176d8abdf29838b1e2f435bedfebd 100644 (file)
@@ -74,7 +74,7 @@ class FSM(Module):
     def delayed_enter(self, name, target, delay):
         if self.finalized:
             raise FinalizeError
-        if delay:
+        if delay > 0:
             state = name
             for i in range(delay):
                 if i == delay - 1: