Skip to content

wholeboard.blocks

Proven building blocks: tested sub-circuits the AI drops into a design whole.

A design spec may list blocks next to its own components:

"blocks": [ {"block": "usb_c_power", "name": "USB", "connect": {"VBUS": "VBUS", "GND": "GND"}, "placement": {"J1": {"x_mm": 4, "y_mm": 12, "rotation": 270, "locked": true}}}, {"block": "esp32c3_wroom02", "name": "MCU", "connect": {"IO4": "SDA", "IO5": "SCL"}} ]

connect maps the block's ports to nets of the design (a port left out keeps its default net, or is left unconnected when it has none). options turns optional parts on or off, parts overrides fields of a block part ({"D1": {"lcsc": "C2297", "value": "Green"}}) and placement places block parts by their block reference. Expansion gives every block part a free reference in the design and names the block's inner nets "_".

Pins in a block are "REF.PAD" or "REF:PIN_NAME" (every pad of that symbol pin name). More blocks can be added as JSON files in ~/.wholeboard/blocks/.

catalogue()

Every block by id: the built-in ones and the user's JSON files.

info(block_id)

A block as the AI sees it: what it is, its ports and options, and an example entry.

expand(spec)

Replace spec["blocks"] with the blocks' parts and nets. Errors go in spec["block_errors"].