cbadc.circuit.opamp.OpAmpFrontend

class cbadc.circuit.opamp.OpAmpFrontend(analog_frontend: AnalogFrontend, GBWP: float, DC_gain: float, vdd_voltage: float = 1.2, in_high=0.0, in_low=0.0, C_int: float = 1e-13, C_amp: float = 1e-14)[source]

Bases: CircuitAnalogFrontend

An opamp-based analog frontend.

Parameters
  • analog_frontend (AnalogFrontend) – The analog frontend to which this opamp-based analog frontend belongs.

  • GBWP (float) – The GBWP of the opamp.

  • DC_gain (float) – The DC gain of the opamp.

  • vdd_voltage (float, optional) – The supply voltage of the opamp, by default 1.2.

  • in_high (float, optional) – The high input voltage of the opamp, by default 0.0.

  • in_low (float, optional) – The low input voltage of the opamp, by default 0.0.

  • C_int (float, optional) – The integration capacitance, by default 100e-15.

  • C_amp (float, optional) – The capacitance of the internal opamp pole, by default 10e-15.

Methods

__init__(analog_frontend, GBWP, DC_gain[, ...])

add(*elements)

Add elements to the subcircuit

add_terminal(terminal[, index])

Add a terminal to the component

add_terminals(terminals)

Add multiple terminals to the component

check_connections()

Check that all terminals are connected

check_subckt_names()

Check that all subcircuit names are unique

connect(first, second[, name])

Add a connection between two terminals

connect_upstream()

Connect all terminals of the subcircuit to the parent circuit

connects(*connections)

Add connections to the subcircuit

get_ngspice([connections])

Get the ngspice call for the component

get_spectre([connections])

Get the spectre call for the component

get_sub_circuit_definitions([dialect])

Get the spice definition of the subcircuit

get_terminals()

Get the terminals of the component

Attributes

C

add(*elements: CircuitElement)

Add elements to the subcircuit

Parameters

elements (CircuitElement) – The elements to add

add_terminal(terminal: Terminal, index: int = -1)

Add a terminal to the component

Parameters
  • terminal (Terminal) – The terminal to add

  • index (int, optional) – The index to add the terminal at, by default -1, i.e., at the end

add_terminals(terminals: List[Terminal])

Add multiple terminals to the component

Parameters

terminals (List[Terminal]) – The terminals to add

check_connections()

Check that all terminals are connected

Raises

ValueError – If a terminal of the subckt is not connected

check_subckt_names()

Check that all subcircuit names are unique

Raises

ValueError – If a subcircuit name is not unique

connect(first: Terminal, second: Terminal, name='')

Add a connection between two terminals

Parameters
  • first (Terminal) – First terminal

  • second (Terminal) – Second terminal

  • name (str, optional) – Name of the connection, by default tries to inherit the name of the first named terminal

Notes

  • If the terminals are already connected, the connection is not changed

  • If one of the terminals is already connected, the other terminal is added to the connection

  • If neither of the terminals is connected, a new connection is created

  • If both terminals are connected to different connections, the connections are merged

  • If both terminals are connected to the same connection, the connection is not changed

  • If one of the terminals has a name, the connection is named after the terminal with the name

  • If both terminals have a name, the connection is named after the first terminal

  • If neither of the terminals have a name, the connection is unnamed

connect_upstream()

Connect all terminals of the subcircuit to the parent circuit

Notes

  • If a terminal is already connected, the connection is not changed

  • If a terminal is not connected, a new connection is created

  • If a terminal has a name, the connection is named after the terminal

connects(*connections: Tuple[Terminal, Terminal])

Add connections to the subcircuit

Parameters

args (list[tuple[Terminal, Terminal]]) – The connections to add

get_ngspice(connections: Optional[Dict[Terminal, Port]] = None)

Get the ngspice call for the component

get_spectre(connections: Optional[Dict[Terminal, Port]] = None)

Get the spectre call for the component

get_sub_circuit_definitions(dialect: SpiceDialect = SpiceDialect.ngspice) List[str]

Get the spice definition of the subcircuit

get_terminals() List[Terminal]

Get the terminals of the component