Projects and Libraries¶
Monata organizes reusable circuit designs with a Library/Cell/View hierarchy. This is the main framework boundary: simulator backends and model compilers are attached to this structure, but they do not replace it.
Library Registry¶
LibraryRegistry is the top-level entry point. It keeps track of library
directories and gives you dictionary-style access to libraries.
from monata import LibraryRegistry
reg = LibraryRegistry()
lib = reg.create_library(
path="work/cmos_cells",
name="cmos_cells",
tech_model_paths=["models/ptm_45nm_nmos.lib", "models/ptm_45nm_pmos.lib"],
)
assert "cmos_cells" in reg
lib = reg["cmos_cells"]
Library Layout¶
A Monata library is a directory with a lib.toml file and one directory per
cell.
cmos_cells/
lib.toml
inverter/
cell.toml
schematic.py
testbench.py
symbol.toml
netlist.scs
lib.toml stores library-level metadata and technology settings:
[library]
name = "cmos_cells"
description = "CMOS standard-cell experiments"
[technology]
model_paths = ["models/ptm_45nm_nmos.lib", "models/ptm_45nm_pmos.lib"]
simulator = "ngspice-subprocess"
node_type = "bulk"
Cells¶
A Cell represents one design unit, such as an inverter, buffer, gate,
amplifier, or test macro.
cell = lib.create_cell("inverter", description="CMOS inverter")
assert "inverter" in lib
Each cell owns its views. The idiomatic access pattern is:
cell = reg["cmos_cells"]["inverter"]
schematic = cell["schematic"]
Views¶
Monata currently recognizes these view types:
View |
Purpose |
|---|---|
|
Native Python |
|
Python function that wraps a circuit in sources, loads, and analyses |
|
Generated or hand-written SPICE/Spectre-compatible netlist |
|
Pin interface for hierarchical use |
Views are declared in cell.toml:
[cell]
name = "inverter"
description = "CMOS inverter"
[views]
schematic = { entry = "schematic.py", class = "Inverter" }
testbench = { entry = "testbench.py", function = "main" }
symbol = { entry = "symbol.toml", generated = true }
netlist = { entry = "netlist.scs", generated = true }
Generated views are protected. If a generated netlist or symbol was edited by
hand, regenerate with force=True only when you intend to overwrite it.
cell.generate_symbol()
cell.generate_netlist()
cell.generate_netlist(force=True)