2012-01-09 10:28:48 -05:00
|
|
|
from migen.fhdl.structure import *
|
|
|
|
from migen.fhdl import verilog
|
2013-02-22 17:19:37 -05:00
|
|
|
from migen.genlib.fsm import FSM
|
2012-01-09 10:28:48 -05:00
|
|
|
|
|
|
|
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}))
|