Simpler state machines, inspired by coroutines.

Cocoa lets you write synthesizable state machines as straightforward initial processes, like functional models used in simulation. The transpiler emits traditional state machines: zero hardware overhead, simulation ready, and without leaving SystemVerilog.

$ pip install cocoa-sv
$ cocoa build src/ -o build/

Examples

Why cocoa?

Zero hardware cost.

Cocoa emits the same registers and case statement a careful engineer would, so area and Fmax match hand-written RTL.

Simulation friendly.

initial processes are already legal SystemVerilog. Source RTL and transpiled output agree cycle-for-cycle in simulation.

Drops into your build.

Run it as a preprocessor next to your linter. Outputs vanilla SystemVerilog-2017 — no new language, runtime, or complex tooling.