CfgSources#

class pyedb.configuration.cfg_ports_sources.CfgSources(pedb=None, sources_data=None)#

Collect current-source and voltage-source entries.

Overview#

get_pin_group_name

add_current_source

Add a current source to this configuration.

add_voltage_source

Add a voltage source to this configuration.

apply

Write all configured sources into the open EDB design.

get_data_from_db

Read existing sources from the open EDB design.

export_properties

Serialize all sources to plain dictionaries.

Import detail#

from pyedb.configuration.cfg_ports_sources import CfgSources

Attribute detail#

CfgSources.sources#

Method detail#

CfgSources.get_pin_group_name(src)#
CfgSources.add_current_source(name: str, positive_terminal: dict, negative_terminal: dict, magnitude=0.001, impedance=None, reference_designator=None, distributed=False)#

Add a current source to this configuration.

Parameters:
namestr

Unique source name.

positive_terminaldict

Terminal-selector dictionary for the positive pole. Use TerminalInfo factory methods to build it.

negative_terminaldict

Terminal-selector dictionary for the negative (reference) pole.

magnitudefloat, optional

Source current magnitude in amperes. Default is 0.001 A.

impedancefloat or str, optional

Source impedance. When None the solver default of 5e7 Ω is used.

reference_designatorstr, optional

Component reference designator to associate with this source.

distributedbool, optional

When True one source element is created per pin. Default is False.

Returns:
CfgSource

The newly created source object.

Examples

>>> cfg.sources.add_current_source(
...     "isrc1",
...     positive_terminal=TerminalInfo.pin_group("pg_VDD"),
...     negative_terminal=TerminalInfo.pin_group("pg_GND"),
...     magnitude=0.5,
... )
CfgSources.add_voltage_source(name: str, positive_terminal: dict, negative_terminal: dict, magnitude=1.0, impedance=None, reference_designator=None, distributed=False)#

Add a voltage source to this configuration.

Parameters:
namestr

Unique source name.

positive_terminaldict

Terminal-selector dictionary for the positive pole.

negative_terminaldict

Terminal-selector dictionary for the negative (reference) pole.

magnitudefloat, optional

Source voltage in volts. Default is 1.0 V.

impedancefloat or str, optional

Source impedance. When None the solver default of 1e-6 Ω is used.

reference_designatorstr, optional

Component reference designator.

distributedbool, optional

Create one source per pin when True. Default is False.

Returns:
CfgSource

The newly created source object.

Examples

>>> cfg.sources.add_voltage_source(
...     "vsrc1",
...     positive_terminal=TerminalInfo.net("VDD"),
...     negative_terminal=TerminalInfo.net("GND"),
...     magnitude=1.8,
... )
CfgSources.apply()#

Write all configured sources into the open EDB design.

CfgSources.get_data_from_db()#

Read existing sources from the open EDB design.

Returns:
list of dict

Serialized source payloads.

CfgSources.export_properties()#

Serialize all sources to plain dictionaries.