litex/examples/fsm.py

10 lines
310 B
Python
Raw Normal View History

2012-01-09 10:28:48 -05:00
from migen.fhdl.structure import *
from migen.fhdl import verilog
from migen.corelogic.fsm import FSM
s = Signal()
2012-02-14 07:12:43 -05:00
myfsm = FSM("FOO", "BAR")
2012-01-09 10:28:48 -05:00
myfsm.act(myfsm.FOO, s.eq(1), myfsm.next_state(myfsm.BAR))
myfsm.act(myfsm.BAR, s.eq(0), myfsm.next_state(myfsm.FOO))
print(verilog.convert(myfsm.get_fragment(), {s}))