Tracer

class circuit_analyzer.all.Tracer

Circuit tracer: analyze the circuit, tracing it’s paths and the flow of signals.

The input is a circuit. Several methods can be called after instantiation:

Use a hierarchy_filter to decide where flattening stops. Use directionality to decide how light can flow between devices when finding paths between A and B.

  • show_light_flow_interactive: combine layout + circuit model to visualize signal at different ports

  • create_subcircuit: cut a subcircuit from port source to port target

  • path_data_extraction: extract data from each cell in a path from port source to port target

Parameters:
circuit: PCell, required

PCell to analyze.

inst_information: ( ), optional, *None allowed*

Function that takes in a cell’s layout and returns information.

view: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters, optional

Extract the netlist from the CircuitModel or the Netlist. Option are circuitmodel or netlist.

directionality: optional

Describes the port combinations where the optical signal can be transmitted through.For instance, for an ideal waveguide without reflections, the input can only transmit light to the output, e.g. {pdk.Waveguide: {‘in’: [‘out’], ‘out’: [‘in’]}

hierarchy_filter: optional

Filter function that takes in a PCell and returns True if the hierarchy of that cell should be skipped.

Other Parameters:
expanded_circuit: locked

Fully expanded circuit by flattening and keeping leaf nodes

Examples

>>> import circuit_analyzer.all as ca
>>> import numpy as np
>>> wavelengths = np.linspace(1.5, 1.6, 1001)
>>> tracer = ca.Tracer(circuit=my_circuit)
>>> tracer.show_light_flow_interactive(input_port="in", wavelength=wavelengths, scale="dB")
possible_probes()

Returns all possible probes in the circuit.

create_subcircuit(source, target, use_source=True, use_target=True, algorithm=None, **kwargs)

Creates a subcircuit of all the components that are part of the paths between source and target.

Parameters:
source: tuple

Path to a port of an instance, e.g. ((‘top’, ‘inst1’, ‘subinst1’), “port1”).

target: tuple

Path to a port of an instance, e.g. ((‘top’, ‘inst2’, ‘subinst2’), “port1”).

use_source: bool

Whether to take the source or the port of an instance that is connected to source. Default is True.

use_target: bool

Whether to take the target or the port of an instance that is connected to target. Default is True.

algorithm: Callable

What algorithm to use to simplify the graph. By default, simplify_graph is used.

kwargs: dict

Arguments of algorithm.

Returns
——-
Returns a PCell.
path_data_extraction(source, target, use_source=True, use_target=True, algorithm=None, save_path=None, **kwargs)

Extract information from a path between source and target.