skidl.tools.spice.spice module

Handler for reading SPICE libraries.

skidl.tools.spice.spice.DeviceModel

alias of XspiceModel

class skidl.tools.spice.spice.Parameters(**params)[source]

Bases: dict

Class for holding Spice subcircuit parameters.

class skidl.tools.spice.spice.XspiceModel(*args, **kwargs)[source]

Bases: object

Object to hold the parameters for an XSPICE model.

skidl.tools.spice.spice.add_part_to_circuit(part, circuit)[source]

Add a part to a PySpice Circuit object.

Parameters:
  • part – SKiDL Part object.

  • circuit – PySpice Circuit object.

skidl.tools.spice.spice.add_subcircuit_to_circuit(part, circuit)[source]

Add a .SUBCKT part to a PySpice Circuit object.

Parameters:
  • part – SKiDL Part object.

  • circuit – PySpice Circuit object.

skidl.tools.spice.spice.add_xspice_io(part, io)[source]

Add XSPICE I/O to the pins of a part.

skidl.tools.spice.spice.add_xspice_to_circuit(part, circuit)[source]

Add an XSPICE part to a PySpice Circuit object.

Parameters:
  • part – SKiDL Part object.

  • circuit – PySpice Circuit object.

skidl.tools.spice.spice.convert_for_spice(part, spice_part, pin_map)[source]

Convert a Part object for use with SPICE.

Parameters:
  • part – SKiDL Part object that will be converted for use as a SPICE component.

  • spice_part (Part) – The type of SPICE Part to be converted to.

  • pin_map (dict) – Dict with pin numbers/names of part as keys and num/names of spice_part pins as replacement values.

skidl.tools.spice.spice.default_lib_paths()[source]

Return default list of directories to search for part libraries.

skidl.tools.spice.spice.gen_netlist(self, **kwargs)[source]

Return a PySpice Circuit generated from a SKiDL circuit.

Parameters:
  • title – String containing the title for the PySpice circuit.

  • libs – String or list of strings containing the paths to directories containing SPICE models.

skidl.tools.spice.spice.get_fp_lib_tbl_dir()[source]

Get the path to where the global fp-lib-table file is found.

skidl.tools.spice.spice.load_sch_lib(self, filename=None, lib_search_paths_=None, lib_section=None)[source]

Load the .subckt I/O from a SPICE library file.

Parameters:
  • filename – The name of the SPICE library file.

  • lib_search_paths – List of directories to search for the file.

skidl.tools.spice.spice.node(net_pin_part)[source]
skidl.tools.spice.spice.not_implemented(part, circuit)[source]

Unable to add a particular SPICE part to a circuit.

skidl.tools.spice.spice.parse_lib_part(self, partial_parse=False)[source]

Create a Part using a part definition from a SPICE library.