litex/examples/basic/fsm.py
Sebastien Bourdeauducq f9acee4e68 corelogic -> genlib
2013-02-22 23:19:37 +01:00

9 lines
307 B
Python

from migen.fhdl.structure import *
from migen.fhdl import verilog
from migen.genlib.fsm import FSM
s = Signal()
myfsm = FSM("FOO", "BAR")
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}))