skidl.tools.kicad9.gen_netlist module

Generate KiCad 8 netlist.

skidl.tools.kicad9.gen_netlist.gen_netlist(circuit, **kwargs)[source]

Generate a netlist for a given circuit.

This function creates a netlist representation of the circuit, which includes information about components, nets, and design metadata. The netlist is formatted as a nested list structure and converted to S-expression format using the Sexp class.

Parameters:

circuit (Circuit) – The circuit object containing parts, nets, and other design information.

Returns:

The netlist in S-expression format.

Return type:

str

Notes

  • The function performs checks for empty footprints and randomly-assigned part tags to ensure the netlist is stable and usable for PCB design.

  • The netlist includes metadata such as the source file, date, and tool version.

  • Components and nets are sorted for consistent output.

  • The Sexp class is used to create a properly formatted S-expression.