model ¤
Reusable model-library registrations for schematic instance elaboration.
Classes:
| Name | Description |
|---|---|
LibraryModel | Register one library wrapper, binding settings separately per instance. |
NetlistDefinition | Canonical topology and shared leaf models, before solver compilation. |
LibraryModel ¤
LibraryModel(
library: Library | None,
subcircuit: str,
*,
defaults: Mapping[str, Any] | None = None,
params_map: Mapping[str, str] | None = None,
port_map: Mapping[str, str] | None = None,
parameter_units: Mapping[str, tuple[str, str]] | None = None,
parameter_values: Mapping[str, Mapping[Any, float]] | None = None,
expressions: Mapping[str, str] | None = None,
module_paths: tuple[Path, ...] = (),
osdi_modules: tuple[Path, ...] = (),
compiler: str | None = None,
cache_dir: Path | None = None,
analysis: str = "dc",
state_policy: str = "reject",
simparams: Mapping[str, float] | None = None
)
Register one library wrapper, binding settings separately per instance.
This object is deliberately non-callable. compile_circuit elaborates wrapper instances to kfnetlist and lets kfnetlist flatten their topology. OSDI descriptor definitions are shared; card and instance values populate individual leaf settings and therefore rows in the native device batch.
params_map maps schematic setting names to library parameter names. parameter_units explicitly declares (source, target) units for those schematic settings. Defaults use the same source units. expressions maps library parameter names to safe expressions over converted settings. Unspecified defaults remain owned by the original library cards.
A temperature_c setting (degrees Celsius) selects the card temperature. It stays available to expressions and parameter_units/parameter_values, but is forwarded to the library as a parameter only when params_map names it.
Methods:
| Name | Description |
|---|---|
from_file | Register lazily; parse the selected corner only when instantiated. |
instantiate | Build the resolved topology and retain reusable native models. |
resolve | Evaluate settings and cards without building or provisioning models. |
source_digests | Return |
Source code in circulax/netlist_io/model.py
from_file classmethod ¤
from_file(
path: str | Path,
subcircuit: str,
*,
section: str | None = None,
sections: tuple[str, ...] = (),
dialect: str = "ngspice",
temperature_c: float = 27.0,
include_paths: tuple[Path, ...] = (),
**options: Any
) -> LibraryModel
Register lazily; parse the selected corner only when instantiated.
Source code in circulax/netlist_io/model.py
instantiate ¤
instantiate(settings: Mapping[str, Any] | None = None) -> NetlistDefinition
Build the resolved topology and retain reusable native models.
Source code in circulax/netlist_io/model.py
resolve ¤
resolve(settings: Mapping[str, Any] | None = None) -> ResolvedCircuit
Evaluate settings and cards without building or provisioning models.
Returns ordered electrical leaf topology and public terminal aliases using the same corner, unit and expression bindings as execution. Source files may be parsed and cached; no native model, compiler or simulator is loaded or executed by this operation.
Source code in circulax/netlist_io/model.py
source_digests ¤
Return path/sha256 records for the sources behind the selected corner.
Covers the parsed cards and their includes. Nothing native is loaded or provisioned.