cbadc.circuit.components.comparator.ClockedComparator

class cbadc.circuit.components.comparator.ClockedComparator(instance_name: str, sub_ckt_name: str, in_low: float, in_high: float, out_low: float, out_high: float, out_undef: float, input_load: float = 1e-12, clk_delay: float = 0.0, clk_offset: float = 0.6, t_tolerance: float = 0.0, t_rise: float = 1e-09, t_fall: float = 1e-09, rise_delay: float = 1e-15, fall_delay: float = 1e-15, set_delay: float = 1e-15, reset_delay: float = 1e-15, comments: List[str] = [])[source]

Bases: SubCircuitElement

Methods

__init__(instance_name, sub_ckt_name, ...[, ...])

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

get_verilog_ams()

Attributes

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: Dict[Terminal, Port])[source]

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