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.
Open source · v0.4.0
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.
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 …}
Principles
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.
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.
Components come from versioned libraries with datasheet-verified pinouts and land patterns, pinned to exact versions and content hashes through the package registry.
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.
Pipeline
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 live in plain .cohdl files. Components
come from packages pinned to exact versions in a lockfile—yours, the standard
libraries, or the registry’s.
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
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
0 errors · 0 warnings
03 / Build
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
Case study
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
Install
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.