Simpler state machines, inspired by coroutines.

Cocoa lets you write synthesizable state machines as straightforward initial processes, unifying low-level RTL with high-level functional models. The transpiler emits traditional state machines — zero hardware overhead, no simulation drift, no 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.