Configuration¶
Elvis LVS settings can be stored in a config file so you don't have to repeat flags on every CLI invocation or pass kwargs to every Python call.
Lookup order¶
Elvis searches for config in this order, stopping at the first match:
elvis.tomlin the current directory or any ancestorpyproject.toml[tool.elvis]section in the current directory or any ancestor
CLI flags and Python kwargs always override config file values.
Settings reference¶
All settings are optional. Missing settings use program defaults.
| Setting | Type | Default | Description |
|---|---|---|---|
tolerance |
integer | 1 |
Port matching tolerance in nanometers |
top-cell |
string | auto | Override top cell name for hierarchical schematics |
short-layers |
list of [layer, datatype] |
[] |
Layers to check for geometric shorts |
connected-layers |
list of [[l1, d1], [l2, d2]] |
[] |
Cross-layer connectivity pairs (e.g., metal ↔ via) |
equivalent-ports |
table or "auto" |
{} |
Equivalent port groups (see below) |
elvis.toml¶
tolerance = 1
top-cell = "my_design"
short-layers = [[49, 0], [45, 0], [41, 0], [44, 0], [1, 0]]
connected-layers = [[[44, 0], [41, 0]], [[44, 0], [45, 0]]]
[equivalent-ports]
pad = ["e1", "e2", "e3", "e4", "pad"]
pyproject.toml¶
[tool.elvis]
tolerance = 1
top-cell = "my_design"
short-layers = [[49, 0], [45, 0], [41, 0], [44, 0], [1, 0]]
connected-layers = [[[44, 0], [41, 0]], [[44, 0], [45, 0]]]
[tool.elvis.equivalent-ports]
pad = ["e1", "e2", "e3", "e4", "pad"]
Setting details¶
tolerance¶
Port matching tolerance in nanometers. Two ports connect when they are at the same position (within this tolerance) and face opposite directions.
CLI equivalent: -t 10 or --tolerance 10
top-cell¶
Override the top cell name used for hierarchical LVS. By default Elvis uses the GDS file's top cell. This is useful when the GDS top cell name differs from the schematic name.
CLI equivalent: --top-cell mzi_optimized
short-layers¶
Layers on which to detect geometric shorts. Each entry is a [layer, datatype]
pair. Elvis checks whether polygons on these layers create unintended connections
between ports on different nets.
CLI equivalent: --short-layer 49,0 --short-layer 45,0 --short-layer 41,0
connected-layers¶
Pairs of layers that are electrically connected (e.g., a metal layer and a via
layer). Each entry is a pair of [layer, datatype] arrays. This tells Elvis
that polygons on one layer can connect to polygons on the other, enabling
cross-layer short detection.
This declares that layer 44/0 connects to both 41/0 and 45/0 (e.g., a via layer bridging two metal layers).
CLI equivalent: --connected-layers 44,0:41,0 --connected-layers 44,0:45,0
equivalent-ports¶
Declares groups of electrically equivalent ports on a component. When one port in the group is connected, Elvis does not report the others as open errors. This is common for components like pads where all edge ports touch the same metal.
Explicit groups (table form):
Automatic derivation (string form):
When set to "auto", Elvis derives equivalent-port groups from the GDS polygon
geometry. This requires at least one short-layers or connected-layers entry
to be configured. Ports whose polygons overlap on a short-detection layer are
grouped as equivalent.
The two forms are mutually exclusive — you cannot combine "auto" with an
explicit table.
CLI equivalent:
Python API¶
Python functions (lvs, lvs_rdb) accept the same settings as keyword
arguments. When a kwarg is None (the default), the config file value is used.
Passing an explicit value overrides the config.
import elvis
result = elvis.lvs(
"layout.gds",
schematic,
tolerance_nm=10,
short_layers=[(49, 0), (45, 0)],
connected_layers=[((44, 0), (41, 0))],
equivalent_ports={"pad": ["e1", "e2", "e3", "e4", "pad"]},
top_cell="my_design",
)
For automatic equivalent-port derivation, pass the string "auto":
Precedence¶
Settings are resolved in this order (highest priority first):
- CLI flags / Python kwargs — explicit values always win
- Config file —
elvis.tomlorpyproject.toml - Program defaults —
tolerance=1, empty lists, no top-cell override