Open source · v0.4.0

The schematic is source code.

CoHDL is a hardware description language for PCB schematics. A board is a program—typed, checked, and compiled to a netlist, bill of materials, footprints, and layout handoff data. No dragging symbols across a canvas. No silent mistakes discovered at the assembly house.

main.cohdl · excerpt checked
design SF32MiniBoard {    inst mcu: sifli_sf32::MCU_SF32LB52EUB6    inst ldo_3v3: contrib_ldo::LDO_RT9080_33_ZQFN    inst usbc: usb::connectors::type_c::USB_C_HRO_TYPE_C_31_M_12    inst esd: esd::ESD_USBLC6    inst c_vbus: passive::C_10u_25V_X5R_0805     #[high_current(500mA)]    net VBUS [5V]: usbc.VBUS, esd.VBUS, ldo_3v3.VIN, ldo_3v3.EN, c_vbus.A    // … audited devices, nets, and pin accounting …}
terminal
$ cohdl check examples/sf32-miniboard No errors found. $ cohdl build examples/sf32-miniboard \ --emit ipc2581 netlist · BOM · footprints · layout IPC-2581 handoff ready
§01

Principles

Correct by construction.

01

It refuses to guess

Units are part of the type system. A resistor where a capacitor belongs, a 3.3 V-rated part on a 5 V net, or a required pin left unconnected becomes a compile error naming the exact instance and pin.

02

The same source, the same bytes

Compilation is deterministic end to end. The same design and pinned libraries produce the same designators and a byte-identical netlist—today or a year from now.

03

Parts you can actually buy

Components come from versioned libraries with datasheet-verified pinouts and land patterns, pinned to exact versions and content hashes through the package registry.

04

Built for working with AI

A language a model can write is a language a compiler can check. Every design is text, source diagnostics can be emitted as structured JSON, and the compiler’s verdict never changes.

§02

Pipeline

From source to handoff.

One compiler carries a design from text to checked handoff outputs. Each stage must pass before the next begins, so an error is caught at the first point that can name it precisely.

01 / Write

Devices, nets, and subcircuits in plain text

Devices, nets, and subcircuits live in plain .cohdl files. Components come from packages pinned to exact versions in a lockfile—yours, the standard libraries, or the registry’s.

main.cohdl · excerpt
design SF32MiniBoard {    inst mcu: sifli_sf32::MCU_SF32LB52EUB6    inst ldo_3v3: contrib_ldo::LDO_RT9080_33_ZQFN    inst usbc: usb::connectors::type_c::USB_C_HRO_TYPE_C_31_M_12    inst esd: esd::ESD_USBLC6     #[high_current(500mA)]    net VBUS [5V]: usbc.VBUS, esd.VBUS, ldo_3v3.VIN    // … complete project accounts for every pin …}

02 / Check

Climb the verdict ladder

cohdl check moves through parse, resolve, type-check, connect, and design-rule check. Every diagnostic carries a stable error code and an exact span.

$ cohdl check examples/sf32-miniboard

  • parse
  • resolve
  • type-check
  • connect
  • drc

0 errors · 0 warnings

03 / Build

Emit design handoff data, byte for byte

cohdl build emits a KiCad netlist, BOM, footprints, and conditional layout constraints. Add --emit ipc2581 for the IPC-2581 handoff—each output deterministic down to the byte.

$ cohdl build examples/sf32-miniboard --emit ipc2581

  • out/*.net

    KiCad netlist

  • out/*-bom.csv

    bill of materials

  • out/footprints/

    land patterns

  • out/*-layout.json

    layout constraints

  • out/*.xml

    IPC-2581 handoff

reproducible · byte-identical

§03

Case study

OpenMicroKbd

A 13-key macropad with a rotary encoder, analog joystick, capacitive touch, and 21 RGB LEDs—an STM32 board whose entire schematic is 823 lines of CoHDL. The compiler checked it, emitted the design handoff data, and handed layout constraints to the autorouter. The board came back and worked.

Read the case study
  • 13keys + encoder
  • 21RGB LEDs
  • 823lines of CoHDL
  • 4source files
The white OpenMicroKbd macropad with its rotary encoder, joystick, keycaps, and 3D-printed packaging on a black background
FIG.01 — OPENMICROKBD, PRODUCT BUILD
§04

Install

It’s open. Install it.

CoHDL v0.4.0 ships prebuilt binaries for macOS and Linux. One line installs it to ~/.cohdl/bin, verified against the release’s published checksums.

curl -fsSL https://raw.githubusercontent.com/conol-ai/cohdl/main/install.sh | sh

Keep it current with cohdl self-update. Windows builds are on the releases page; building from source is plain cargo build. Then follow the getting-started guide to compile a first board.