fsm: set reset_state as default state
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 24 May 2014 11:35:02 +0000 (13:35 +0200)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Sun, 22 Jun 2014 13:21:22 +0000 (15:21 +0200)
migen/genlib/fsm.py

index 8818fe64673a9297dcc50506bdcd0acb6b3d3b03..f6416504b2b0f305f971b46ff5e149fcbb26c89d 100644 (file)
@@ -108,7 +108,7 @@ class FSM(Module):
                cases = dict((self.encoding[k], lns.visit(v)) for k, v in self.actions.items() if v)
                self.comb += [
                        self.next_state.eq(self.state),
-                       Case(self.state, cases)
+                       Case(self.state, cases).makedefault(self.encoding[reset_state])
                ]
                self.sync += self.state.eq(self.next_state)