skidl.skidlbaseobj module

Base object for Circuit, Interface, Part, Net, Bus, Pin objects.

This module provides the foundation class SkidlBaseObject that all major SKiDL objects inherit from. It implements common functionality such as ERC checking, attribute handling, and object copying.

class skidl.skidlbaseobj.SkidlBaseObject[source]

Bases: object

Base class for all SKiDL objects.

This class provides common functionality for all SKiDL objects such as attribute handling, ERC checking, and object copying. It also manages object names, aliases, and notes.

ERC(*args, **kwargs)[source]

Run Electrical Rules Check on this object.

This method runs all ERC functions and evaluates all ERC assertions assigned to the object.

Parameters:
  • *args – Arguments to pass to ERC functions.

  • **kwargs – Keyword arguments to pass to ERC functions.

add_erc_assertion(fail_msg='FAILED', severity=ERROR)[source]

Add an ERC assertion to this object or its class.

Parameters:
  • assertion – A string containing a Python expression that should evaluate to True.

  • fail_msg – Message to display if assertion fails.

  • severity – Level of severity (ERROR, WARNING, or OK) if assertion fails.

add_erc_function(func)[source]

Add an ERC function to this object or its class.

Parameters:

func – A function that will be called during ERC checking.

property aliases

Get the aliases for this object.

Returns:

An Alias object containing all alternate names for this object.

check_tag(create_if_missing=False)[source]

Check if the tag is set for this object. Warn if the tag is not set.

Returns:

True if the tag is set, False otherwise.

copy()[source]

Create a deep copy of this object.

Returns:

A new SkidlBaseObject with copies of this object’s fields, aliases, and notes.

erc_assertion_list = []
erc_list = []
property name

Get the primary name of this object.

Returns:

The primary name of this object.

property notes

Get the notes for this object.

Returns:

A Note object containing all notes associated with this object.

src_line(track_abs_path=False)[source]

Return the file name and line number where the object was instantiated.

Parameters:

track_abs_path (bool) – If True, use the absolute path of the file. If False, use the relative path from the script directory.

Returns:

File name and line number separated by colon.

Return type:

str

property tag

Get the tag of this object.

Returns:

The tag of this object.