# Board as code ## What this builds A complete, original board described in code: a schematic or netlist, a layout, silkscreen, and a bill of parts. Tests assert a netlist (named nets are connected as in a file), run ERC and DRC with a documented rule set, and render the board. No fabricator, no assembler, and no programmer are required. This is not a copy of a commercial product's board. Read `spekkr.inputs.json` first. `title` is in the title block. `width` and `height` size the outline. `usb` and `mounts` add features. `tool` is the toolchain. ## Out of scope - A board house, a parts order, or a programmer in the checks. - A certified radio or a mains-voltage design. - A live parts-shop API in the checks. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Netlist and ERC - The generated netlist contains the nets in `fixtures/board-nets.json` (for example VCC, GND, a signal list). Named pins are on the named nets. - ERC is clean for the rule set in the file, or only the documented waived classes remain. - If `usb` is on, the connector's power and ground pins are on VCC and GND as in the file. Accept when: every listed pin-to-net assertion holds, and ERC matches the expected clean or waived result. ### R2. Layout, DRC, renders - The board outline is `width` by `height` within 0.1 mm. If `mounts` is on, four M3 holes sit at the inset in the file. - DRC is clean for the rule set (clearance, track width, drill) in the file, or only documented waivers remain. - Renders: schematic (or a netlist plot), front copper and silk, back, and a 3D or isometric view. One command generates, checks, and writes the renders. No fabricator. Accept when: outline and holes match, DRC matches, the four renders are written, and a deliberate short in a fixture netlist fails ERC. ### R3. Inputs - Inputs are read from `spekkr.inputs.json`. Values outside the ranges or choices in `design.md` are refused before a netlist, a board or a testbench is built. - Options turn the optional circuits, ports or features in the Inputs table on or off. Accept when: an illegal input is refused by name, and the default input set produces the measurements in `design.md`. ### R4. Checks and report - One command runs the simulation or the testbench, writes the plots or dumps, and compares them to the numbers in `design.md`. - The command works without a physical board, a lab instrument or a network. Accept when: the command passes at the defaults, and fails if a documented value in the netlist or the ROM is corrupted on purpose. ## Verification Netlist assertions, ERC, and DRC are run on a board generated from code. The outline and mounting holes are measured. Board renders are written. A deliberate short fails ERC. No fabricator, no parts order, and no programmer are required. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to generate the board, how to run ERC and DRC, and that a fabrication is optional.