Skip to main content

Interpreter

The interpreter processes Circuitscript in four stages, each consuming the output of the previous one:

Execution ──▶ Annotation ──▶ Layout ──▶ Render (SVG / PDF)

└──▶ KiCad netlist (stops here)
  1. Execution — The code is parsed and run, producing an intermediate representation (IR): a simplified script of the connections between components, pins, nets, and wires.
  2. Annotation — Reference designators (for example R1, C2, U3) are assigned to each component and recorded in the IR.
  3. Layout — The annotated IR is handed to the layout engine, which sizes and positions the components, wires, and other elements.
  4. Render — The layout engine's output feeds the render engine, which produces the graphical result. SVG and PDF are currently supported — see Output formats.

It is also possible to generate a KiCad netlist file that can be imported into KiCad pcbnew. In this case only the first two stages (Execution and Annotation) run, since a netlist needs connectivity but not layout or rendering. See Output formats for details about the KiCad netlist output.