Getting started¶
Installation¶
Nimphel requires Python 3.10 or newer. Clone the repository and create the development environment with uv:
Run the test suite with:
Installing only the runtime library does not install the documentation tool. Use the documentation dependency group when working on this site:
Build a circuit¶
A Component describes how to create instances. It defines the target
primitive or model, its semantic kind, ordered pin names, and optional
parameter defaults.
from nimphel import Circuit, Component, ComponentKind
resistor = Component(
target="resistor",
pins=("p", "n"),
kind=ComponentKind.RESISTOR,
defaults={"r": "1k"},
)
with Circuit(name="divider") as circuit:
first = resistor(("vin", "vout"))
second = resistor(("vout", 0), r="2k")
assert first.ref == "R1"
assert second.ref == "R2"
Factories automatically register instances with the innermost active circuit or subcircuit. The equivalent explicit form is:
circuit = Circuit(name="divider")
circuit.add(resistor(("vin", "vout")))
circuit.add(resistor(("vout", 0), r="2k"))
Write Spectre output¶
The result is:
Continue with the core API for subcircuits, directives, validation, and reference allocation.