Skip to content

[PyCDE] Expanded syntax for FSMs #3646

Open
@teqdruid

Description

I was thinking something like:

@fsm.machine
class F1:
  clk = Clock()
  go = Input(types.i1)
  valid = Input(types.i1)
  data = Input(types.i4)

  @fsm.state(initial=True)
  def a(ports, next):
    with If(ports.go):
      next.b()
    EndIf()

  @fsm.state
  def b(ports, next):
    with If(ports.valid):
      with If(ports.data == 3):
        next.a()
      EndIf()
    EndIf()

Metadata

Assignees

Labels

PyCDEPython CIRCT Design Entry API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions