sax.circuit module#
SAX Circuit Definition
- class CircuitInfo(dag, models, backend)[source]#
Bases:
NamedTuple
Information about the circuit function you created.
- Parameters:
dag (nx.DiGraph[str]) –
models (dict[str, Model]) –
backend (str) –
- dag: nx.DiGraph[str]#
Alias for field number 0
- models: dict[str, Model]#
Alias for field number 1
- backend: str#
Alias for field number 2
- circuit(netlist, models=None, backend='default', return_type='sdict', ignore_missing_ports=False)[source]#
Create a circuit function for a given netlist.
- Parameters:
netlist (sax.netlist.Netlist | sax.netlist.NetlistDict | sax.netlist.RecursiveNetlist | dict[str, sax.netlist.NetlistDict]) – The netlist to create a circuit for.
models (dict[str, Model] | None) – A dictionary of models to use in the circuit.
backend (str) – The backend to use for the circuit.
return_type (str) – The type of the circuit function to return.
ignore_missing_ports (bool) – Ignore missing ports in the netlist.
- Return type:
tuple[Model, sax.circuit.CircuitInfo]
- get_required_circuit_models(netlist, models=None)[source]#
Figure out which models are needed for a given netlist.
- Parameters:
netlist (sax.netlist.Netlist | sax.netlist.NetlistDict | sax.netlist.RecursiveNetlist | dict[str, sax.netlist.NetlistDict]) – The netlist to create a circuit for.
models (dict[str, Model] | None) – A dictionary of models to use in the circuit.
- Return type:
list[str]