if name == "FSM":
fsm_signal, fsm_reset, fsm_encoding, fsm_decoding, fsm_states = \
data["signal"], data["reset"], data["encoding"], data["decoding"], data["states"]
+ if not fsm_states:
+ return
fsm_signal.nbits = bits_for(len(fsm_encoding) - 1)
if fsm_reset is None:
fsm_signal.reset = fsm_encoding[next(iter(fsm_states))]
)
""")
+ def test_FSM_empty(self):
+ m = Module()
+ with m.FSM():
+ pass
+ self.assertRepr(m._statements, """
+ ()
+ """)
+
def test_FSM_wrong_redefined(self):
m = Module()
with m.FSM():