Authoring Circuits¶
Circuit authoring in Monata happens through views. The schematic view describes the reusable circuit topology. The testbench view wraps that topology with stimulus, loads, analysis setup, and result processing.
Schematic View¶
A schematic view is a Python file that exports a circuit class. The class name
is registered in cell.toml.
[views]
schematic = { entry = "schematic.py", class = "Inverter" }
The schematic should define a stable native subcircuit interface:
from monata.netlist import SubCircuit
class Inverter(SubCircuit):
NAME = "inverter"
NODES = ("vin", "out", "vdd", "gnd")
def build(self):
self.include("/path/to/models/nmos.lib")
self.include("/path/to/models/pmos.lib")
self.mos("mn", d="out", g="vin", s="gnd", b="gnd", model="nmos", w="1u", l="180n")
self.mos("mp", d="out", g="vin", s="vdd", b="vdd", model="pmos", w="2u", l="180n")
Monata uses NAME and NODES when generating symbols and netlists.
Testbench View¶
A testbench view is a Python function registered in cell.toml.
[views]
testbench = { entry = "testbench.py", function = "main" }
Use testbenches for one complete design check: build the circuit, attach stimulus, choose an analysis, run simulation, and return results.
def main():
circuit = build_testbench()
task = SimTask(circuit=circuit, analysis_spec=TranSpec(stop=10e-9))
return LocalExecutor().submit(task).result()
Generated Symbol View¶
Symbols are generated from the schematic pin list:
cell.generate_symbol()
symbol = cell["symbol"].load()
Pin directions are inferred from pin names. Review generated symbols before using them as stable interfaces in larger designs.
Generated Netlist View¶
Netlists are generated from the schematic view:
path = cell.generate_netlist()
netlist = cell["netlist"]
Generated netlists are best treated as build artifacts. Keep hand-written netlists separate, and mark them as non-generated if they should not be overwritten.
Authoring Boundary¶
Use this page for the Monata view lifecycle and native netlist API. Backend extensions beyond the native ngspice path are tracked separately.