migen/genlib/fsm: fix delayed_enter when delay is negative (can happen when delay is generated from others parameters)

This commit is contained in:
Florent Kermarrec 2015-06-02 19:26:42 +02:00
parent fd16b66bdf
commit 79624ce849

View file

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