Skip to content

Reference

Every emir command, with every option, as its parser defines it, generated from the code (python scripts/gen_cli_reference.py; a test fails when it is stale). The agent contract, agent/CONTRACT.md, and the catalog of codes, agent/errors.md, are generated from the code too.

  • --format json prints exactly one JSON document on stdout (its schema field names it; emir schema <name> prints the JSON Schema). Logs go to stderr.
  • Exit status: 0 done; 1 with --fail-on-violation, a FAIL verdict; 2 bad input or refused (emir check: inputs not OK); 3 a required tool or package is missing; 70 internal error or a failed self-test or validation; 130 interrupted (SIGINT); 143 terminated (SIGTERM).
  • Every refusal, failure, warning and note carries a stable code, EMIR-<level><area><number>: level E error, W warning, I note; area 1 files, 2 DSPF, 3 process file, 4 currents and simulation results, 5 options, 6 external tools, 7 outputs and viewers, 8 retired, 9 internal. emir explain <code> prints its meaning, hint and the command that fixes or diagnoses it. Codes are never reused: a retired one stays in the catalog with its reason. Branch on the code, never on the message text.
  • Option abbreviations are refused: write every option in full. @FILE arguments are read from FILE, one argument per line.

Screening, not sign-off: every result these commands print screens the layout; foundry-qualified EM/IR remains the sign-off flow (Method and accuracy). EMIR is a research project, provided as is, with no warranty or guarantee of accuracy: test and verify its results for your process, tools and design before relying on them.

command what it does
emir check EM / IR screening of one DSPF
emir explain What an error code means, and the command that fixes or diagnoses it
emir extract GDS -> DSPF
emir gui-install Write the Virtuoso SKILL files
emir import-ict Generate the per-PDK EMIR data file from a foundry ICT
emir info Where the tools were found
emir mcp Serve EMIR over the Model Context Protocol (stdio) for MCP clients: one typed tool per command ...
emir nets List the nets of a DSPF and their sizes
emir next What to run next, and why
emir pins List the instance pins on one net
emir process Process data entered by hand, when no readable process file exists for the PDK (the ICT is missing ...
emir process new Write a fill-in process file for the layers and vias a DSPF uses (or the ones you list), every ...
emir process check What a process file still lacks before a run: empty values (required: emir refuses to run ...
emir report The summary of a run to relay to a person
emir run EM / IR screening of one DSPF
emir save-lines Print the lines that save every branch current an rcc run reads: Spectre save, HSPICE .probe ...
emir schema Print the JSON Schema (2020-12) of a document emir reads or writes
emir selftest Offline proof that the install works (a few seconds)
emir simulate Simulate a testbench so that emir run --cc-sim can read the currents: writes a copy of the ...
emir validate Run the analytic validation suite (6 closed-form cases)
emir verify-sim Prove on this machine that a simulator's route into EMIR gives the right numbers: simulate small ...

emir check

EM / IR screening of one DSPF

emir check [dspf] [options]

Arguments

  • [dspf]: extracted DSPF (R or RC); leave it out to check the --process file on its own; --dspf FILE is accepted as the same

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --net NET: net to analyse, or all (the default when the run is driven: every net with resistors)
  • --process PROCESS: PDK EM/IR data file (emir.yaml); default from the site file
  • --em-temp C: the temperature (C) to analyse EM at (default: the process file's em_tref): R is scaled by the layer TCR, avg limits are derated by jmax_factor
  • --delta-t C: the self-heating temperature rise (C) the rms limits allow, for layers whose rms limit is sqrt(k * delta_T) (jmax_rms_k); default 5
  • --currents JSON|FILE: DC currents {"node": amps} into the net, inline JSON or the path of a file holding it; must balance (emir schema currents)
  • --ground GROUND: reference node
  • --cc-sim CC_SIM: the simulation result rcc reads: a transient of the RC-extracted netlist with every branch current saved (emir save-lines), as PSF ASCII or nutascii (a file, or a Spectre -raw directory), HSPICE ASCII (.tr0, .option post=2) or CSDF. The currents come from here instead of --currents.
  • --analysis ANALYSIS: which analysis to read from a --cc-sim directory; for a result with several sweep tables, sweep:N picks one
  • --sim {spectre,hspice,xyce,ngspice}: the simulator that wrote --cc-sim, when neither the result's header nor its names sidecar says (for the on-site verification, emir verify-sim); with --netlist, the simulator that runs it (default spectre)
  • --period S: the block's period in seconds (1e-08; on the command line also 10n or 10ns), needed for a transient result and a --netlist run (EMIR-E428): every average is over the record's last whole periods of it, up to three. rcc is exact for the simulated record over the whole periods you give (--period); whether the testbench has settled is yours to establish, as for any .meas. Refused, with no number: fewer than two whole periods (EMIR-E431), or the last two differ by more than 2 % on a branch carrying 1 % of its net's largest current (EMIR-E429)
  • --feed FEED: node the net is fed at (default: the DSPF port): the IR reference unless --ground is given. One net only.
  • --netlist NETLIST: the testbench of the RC netlist to SIMULATE with Spectre instead of reading a finished --cc-sim result (Spectre is licensed: it runs only with --run; emir simulate drives HSPICE, Xyce and ngspice)
  • --mode {rcc}: rcc, the one method of a simulated run (it may be left out): the RC netlist was simulated with every branch current saved, and every metric (avg, rms and peak EM, static and dynamic IR) is read from them, exactly. A DC run (--currents) takes no mode
  • --run: spectre (licensed): run it on --netlist; without it the command is printed and nothing runs (ask the person first)
  • --sim-timeout S: stop the Spectre run of --netlist after this many seconds (default 3600)
  • --save-branches: print the Spectre save lines an RCC run needs. With --net all (or no --net) that covers EVERY net, which is what EM needs -- any wire carrying current is subject to it, not just the rails.
  • --save-prefix SAVE_PREFIX: instance path to prepend to saved names when the extracted subckt sits in a testbench, e.g. "XI0."
  • --html DIR: write a self-contained HTML report to this directory (e.g. emir_out/nets). The net map is inline SVG, so it zooms losslessly in a browser; with matplotlib, the run's EM/IR chart beside it (emir_chart.png and emir_chart_light.png: every net, the worst items numbered).
  • --gds GDS: with --html: the layout under the chart, drawn by KLayout (a DSPF whose coordinates are the layout's: emir extract --tool magic writes them so); --cell names its cell
  • --open: open the HTML report in a browser when done
  • --viewer DIR: write the layout-viewer data to this directory (e.g. emir_out/viewer): SKILL for the Virtuoso EMIR Explorer and a marker database for KLayout. Results land on the layout itself, which is where the fix happens.
  • --viewer-all: write every segment into the viewer data; by default a run with more than 20000 segments keeps the worst (clean ones and IR off the rails left out)
  • --lib LIB: OA library the viewer should open (default from the site file)
  • --spectre SPECTRE: spectre executable for --netlist (default: $SPECTRE_BIN, site file, then $PATH)
  • --no-check: skip the input checker (not recommended)
  • --force: run even if the input checker reports FAIL
  • --summary-out FILE: write the run summary (the emir.run/1 JSON document, the same one --format json prints) to this file; emir report --from FILE turns it into the summary for a person
  • --power-nets POWER_NETS: comma-separated supply/ground nets. IR is a PDN quantity by convention, so these set the IR colour scale and are what the viewer opens on; other nets stay selectable (analog bias and reference lines have real drop). Inferred from net names if omitted.
  • --cell CELL: cell the viewer should open, and the --gds cell under the chart (default: the DSPF design name)
  • --json-out FILE: write the findings (the emir.check/1 document) here
  • --all: show the OK lines too

emir explain

What an error code means, and the command that fixes or diagnoses it.

emir explain [CODE ...] [options]

Arguments

  • [CODE ...]: EMIR-E204, E204, e204 ...

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --list: every code

emir extract

GDS -> DSPF. --tool quantus (the default): GDS + CDL with PVS LVS and Quantus; without --run it prints the plan and runs nothing (licensed tools: ask the person before --run). --tool magic: magic (open source) extracts the cell with every resistor's layer, width, length and place (a magic that writes resistor geometry: extresist geoout), and EMIR writes the DSPF, which is also the RC netlist rcc simulates; it runs at once.

emir extract --gds GDS [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --tool {quantus,magic}: quantus: PVS LVS + Quantus (licensed; planned unless --run); magic: magic's extraction with resistor geometry (open source) (default quantus)
  • --gds GDS: the layout (GDS) (required)
  • --cdl CDL: quantus: the netlist LVS compares against (CDL; required)
  • --cell CELL: the layout top cell (quantus: required; magic: default the layout's only top cell, read with the klayout package)
  • --kind {r_only,rc_coupled,rc_decoupled}: quantus (required): rc_coupled: the RC netlist rcc simulates and screens; rc_decoupled: the same with grounded capacitance; r_only: the resistor grid, for DC currents
  • --source-cell SOURCE_CELL: quantus: the CDL top cell, if it is not --cell
  • --work WORK: quantus: work directory (default <work_dir>/extract_<cell>)
  • --rules RULES: quantus: PVS LVS rule deck (site: pvs_lvs_rules)
  • --tech-dir TECH_DIR: quantus: Quantus technology directory (site: qrc_tech_dir)
  • --corner CORNER: quantus: Quantus corner (site: qrc_corner)
  • --temperature C: quantus: extraction temperature in C (site: extract_temperature)
  • --pvs PVS: quantus: pvs executable (default: $PVS_BIN, site file, $PATH)
  • --qrc QRC: quantus: qrc executable (default: $QRC_BIN, site file quantus:, $PATH)
  • --site FILE: the site file to read the tools and decks from (default: $EMIR_SITE, ~/.emir/site.yaml)
  • --rerun-lvs: quantus: run LVS again even when a matched, up-to-date one is there
  • --timeout S: seconds each tool may run (default 7200)
  • --run: quantus: run PVS and Quantus (licensed tools); without it, the plan only (magic always runs: it is open source)
  • --process PROCESS: magic (required): the process file: its pdk: name finds magic's startup file, its magic: section names magic's layers, the devices' terminals and the magic to use
  • --magicrc FILE: magic: its startup file (default: $EMIR_MAGICRC, else $PDK_ROOT/<pdk>/libs.tech/magic/<pdk>.magicrc for the process file's pdk: name)
  • --magic EXE: magic: the magic to run, one that writes resistor geometry (default: $EMIR_MAGIC, the process file's magic: binary: (a magic's bare name on $PATH), the site file's magic:, then magic-8.3.515-geo and magic on $PATH)
  • --out DIR: magic: where the DSPF goes; magic runs in its magic/ subdirectory, EMIR's own (default <work_dir>/extract_<cell>; a <cell>.dspf there that EMIR did not write is never overwritten: EMIR-E646)
  • --tolerance TOLERANCE: magic: extresist tolerance (default 10): a net whose resistance is small next to its devices' is not split into resistors (EMIR-W645 lists such nets)
  • --port-pins {tied,separate}: magic: what to do with a port labelled at several places (each place its own node): tied (default) shorts them to the port with 0 V sources, so current may leave by any of them; separate leaves them apart

emir gui-install

Write the Virtuoso SKILL files.

emir gui-install [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --dir DIR: where to write the .il files (default: <clone or bundle>/skill, else ~/.emir/skill)

emir import-ict

Generate the per-PDK EMIR data file from a foundry ICT.

Process data lives in the per-PDK YAML, never in code. This
module is how that YAML gets its EM numbers: it parses the ICT's `em_model`
blocks and merges them onto the curated geometry/resistance fields already in
the file (gds numbers, sheet resistance, via resistance, min width), which come
from the techfile and are hand-checked.

    emir import-ict         --ict /path/to/<pdk>_typical.ict         --emir /path/to/pdk/emir.yaml

What an ICT typically gives, and how it is converted to the mA/um form the
solvers use (`dw`, `a`, `b`, `Lmin` stand for the PDK's own constants):

* `em_jmax_dc_avg EQU <mult> * <J> * ( w - <dw> ) ... L > <Lmin>`
  A current limit for a wire of width w: `<J>` mA/um (its slope in w) on the
  width less `<dw>`, the form the process file's `width_loss_um` holds
  (I_max = J x (W - dW)). Both are read by evaluating the expression at two
  widths, and the offset is written as `width_loss_um` with its source (the
  largest of the avg and peak lines' offsets: the strictest), so a narrow
  wire is judged as the ICT judges it. A long-wire branch (`L > <Lmin>`) is
  the conservative rule — short wires are usually allowed more, which a
  check that does not know segment length cannot claim.
* `em_jmax_dc_peak` / `em_jmax_ac_peak` — same form, same conversion.
* `em_jmax_ac_rms EQU sqrt( K * delta_T * (w-dw)^2 * (w-dw+a)/(w-dw+b) )`
  This is the Joule self-heating limit and it is genuinely width dependent.
  Divided by w it tends to **sqrt(K * delta_T)** mA/um as w grows, and that
  asymptote is the *minimum* over width — narrow wires are allowed more. So the
  wide-wire value is the conservative one to hand a width-agnostic check.
* `jmax_factor T f T f ...` — the temperature derating table for the avg limit.
* `temp_tc1` / `temp_tc2` with the process `temp_reference` — resistance vs
  temperature, so the solver can extract at the EM temperature.

Where the ICT gives vias only `em_jmax_dc_avg`, their rms and peak limits are
left out (reported as not checked): emir never estimates a limit. Curated
(unflagged) via rms/peak values already in the file are kept; values an older
import estimated (flagged `rms_peak_estimate: true`) are removed.

ICT block names: a layer `Metal1` is looked up as the conductor block given by
`--conductor-pattern` (default `{layer}_conn`, `{layer}` = the lower-cased
name, `{Layer}` = as written), then as `metal1` and `Metal1`. A layer or via
entry can name its block outright with `ict_name:`.
emir import-ict --ict ICT --emir EMIR [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --ict ICT (required)
  • --emir EMIR: emir.yaml to update in place (required)
  • -o OUT, --out OUT
  • --conductor-pattern CONDUCTOR_PATTERN: ICT conductor block name for a layer, e.g. '{layer}_conn' (the default; {layer} lower-cased, {Layer} as written). Also settable in the file as ict_conductor_pattern:; ict_name: on one layer names its block outright.

emir info

Where the tools were found.

emir info [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)

emir mcp

Serve EMIR over the Model Context Protocol (stdio) for MCP clients: one typed tool per command, returning the command's JSON document. An MCP client starts it; stdout is the protocol channel, logs go to stderr. Needs the MCP Python SDK (the mcp extra: pip install -e '.[mcp]' from a clone, or pip install mcp).

emir mcp [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --list: print the tools, resources and this machine's client configuration snippets, and exit (works without the SDK)
  • --cwd DIR: the working directory for the tools' relative paths (default: where the client starts the server)
  • --agent-dir DIR: a clone of the emir repository, to serve AGENTS.md and the agent playbooks as resources (default: found beside the package, in a clone)
  • --isolate: run every tool call in a fresh Python process: slower, but each call starts clean and a big run's memory is freed
  • --no-output-schema: do not advertise the tools' output schemas (for a client whose validator rejects them)

emir nets

List the nets of a DSPF and their sizes.

emir nets dspf [options]

Arguments

  • dspf: the DSPF; --dspf FILE is accepted as the same

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)

emir next

What to run next, and why.

emir next [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --dspf DSPF: the extracted DSPF, if there is one
  • --process PROCESS: the process file, if there is one
  • --cc-sim CC_SIM: a finished simulation result
  • --netlist NETLIST: a netlist emir would simulate
  • --currents JSON|FILE: DC currents {node: amps}, inline JSON or the path of a file holding it (read here as emir run reads it)
  • --mode {rcc}: rcc, the one method of a simulated run (accepted; it may be left out)
  • --net NET
  • --period S: the block's period in seconds (1e-08; on the command line also 10n or 10ns): the planned check and run average over the record's last whole periods of it, and the plan checks that the result gives that window (a transient needs it; DC currents and an operating point have none). rcc is exact for the simulated record over the whole periods you give (--period); whether the testbench has settled is yours to establish, as for any .meas.
  • --viewer: the person wants the results on the layout
  • --html: the person wants HTML reports
  • --lib LIB: OA library, for the viewer
  • --cell CELL: cell, for the viewer
  • --have-cadence, --no-have-cadence: whether cadence is available (default: detected, see emir info)
  • --have-xyce, --no-have-xyce: whether xyce is available (default: detected, see emir info)
  • --have-ngspice, --no-have-ngspice: whether ngspice is available (default: detected, see emir info)
  • --gds GDS: the block's layout (GDS): without a DSPF, magic extracts one (emir extract --tool magic); with one, the layout under the --html charts
  • --run-summary FILE: a finished run's summary (emir run --summary-out): plan what follows it; the run's inputs are read from it
  • --sim {spectre,hspice,xyce,ngspice}: the simulator the person uses (default: detected: Spectre at a Cadence site, then HSPICE, Xyce, ngspice); for a finished --cc-sim, the one that wrote it when the result does not say

emir pins

List the instance pins on one net.

emir pins dspf --net NET [options]

Arguments

  • dspf: the DSPF; --dspf FILE is accepted as the same

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --net NET (required)

emir process

Process data entered by hand, when no readable process file exists for the PDK (the ICT is missing or encrypted). emir process new writes the fill-in file for the layers and vias a DSPF uses; emir process check says what it still lacks. emir process new --help and emir process check --help for each.

emir process {new,check} [options]

Arguments

  • {new,check}: new: write the fill-in file; check: what it still lacks

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)

emir process new

Write a fill-in process file for the layers and vias a DSPF uses (or the ones you list), every value empty with its unit and a source slot, for a person to type from the PDK's design manual when no readable process data exists (the ICT is missing or encrypted). It never fills in a value.

emir process new [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --from-dspf DSPF: the DSPF whose layer tokens, $lvl numbers and vias the file covers
  • --pdk NAME: the PDK's name, written as pdk: (shown in reports)
  • -o FILE, --out FILE: the file to write (default emir_out/process.yaml); an existing file is never overwritten (EMIR-E326)
  • --layers L1,L2: without --from-dspf: the conductor layers, comma-separated
  • --vias V1,V2: without --from-dspf: the vias, comma-separated (their below/above are left for the person)
  • --interactive: ask a person for each value and its source at a terminal; refused when stdin is not a terminal (agents never use it)

emir process check

What a process file still lacks before a run: empty values (required: emir refuses to run; optional: that check is not made), values with no source in a hand-entered file, likely unit slips, limits out of order, and with --dspf the DSPF layers it does not cover. Exit 2 when a required value is missing or another check FAILs. emir check --process runs the same checks.

emir process check PROCESS [options]

Arguments

  • PROCESS: the process file to check

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --dspf DSPF: a DSPF of the block: the layers it uses must be in the file, and its wires wider than their width loss
  • --em-temp C: the analysis temperature to check the derating at (default: the file's em_tref)

emir report

The summary of a run to relay to a person.

emir report --from FILE [options]

Options

  • --format {md,json,text}: md (for a person, the default; text is the same) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --from FILE: the run summary (emir run --summary-out FILE); - reads stdin (required)
  • --top TOP: how many worst items to list (default 10)

emir run

EM / IR screening of one DSPF

emir run dspf [options]

Arguments

  • dspf: extracted DSPF (R or RC); --dspf FILE is accepted as the same

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --net NET: net to analyse, or all (the default when the run is driven: every net with resistors)
  • --process PROCESS: PDK EM/IR data file (emir.yaml); default from the site file
  • --em-temp C: the temperature (C) to analyse EM at (default: the process file's em_tref): R is scaled by the layer TCR, avg limits are derated by jmax_factor
  • --delta-t C: the self-heating temperature rise (C) the rms limits allow, for layers whose rms limit is sqrt(k * delta_T) (jmax_rms_k); default 5
  • --currents JSON|FILE: DC currents {"node": amps} into the net, inline JSON or the path of a file holding it; must balance (emir schema currents)
  • --ground GROUND: reference node
  • --cc-sim CC_SIM: the simulation result rcc reads: a transient of the RC-extracted netlist with every branch current saved (emir save-lines), as PSF ASCII or nutascii (a file, or a Spectre -raw directory), HSPICE ASCII (.tr0, .option post=2) or CSDF. The currents come from here instead of --currents.
  • --analysis ANALYSIS: which analysis to read from a --cc-sim directory; for a result with several sweep tables, sweep:N picks one
  • --sim {spectre,hspice,xyce,ngspice}: the simulator that wrote --cc-sim, when neither the result's header nor its names sidecar says (for the on-site verification, emir verify-sim); with --netlist, the simulator that runs it (default spectre)
  • --period S: the block's period in seconds (1e-08; on the command line also 10n or 10ns), needed for a transient result and a --netlist run (EMIR-E428): every average is over the record's last whole periods of it, up to three. rcc is exact for the simulated record over the whole periods you give (--period); whether the testbench has settled is yours to establish, as for any .meas. Refused, with no number: fewer than two whole periods (EMIR-E431), or the last two differ by more than 2 % on a branch carrying 1 % of its net's largest current (EMIR-E429)
  • --feed FEED: node the net is fed at (default: the DSPF port): the IR reference unless --ground is given. One net only.
  • --netlist NETLIST: the testbench of the RC netlist to SIMULATE with Spectre instead of reading a finished --cc-sim result (Spectre is licensed: it runs only with --run; emir simulate drives HSPICE, Xyce and ngspice)
  • --mode {rcc}: rcc, the one method of a simulated run (it may be left out): the RC netlist was simulated with every branch current saved, and every metric (avg, rms and peak EM, static and dynamic IR) is read from them, exactly. A DC run (--currents) takes no mode
  • --run: spectre (licensed): run it on --netlist; without it the command is printed and nothing runs (ask the person first)
  • --sim-timeout S: stop the Spectre run of --netlist after this many seconds (default 3600)
  • --save-branches: print the Spectre save lines an RCC run needs. With --net all (or no --net) that covers EVERY net, which is what EM needs -- any wire carrying current is subject to it, not just the rails.
  • --save-prefix SAVE_PREFIX: instance path to prepend to saved names when the extracted subckt sits in a testbench, e.g. "XI0."
  • --html DIR: write a self-contained HTML report to this directory (e.g. emir_out/nets). The net map is inline SVG, so it zooms losslessly in a browser; with matplotlib, the run's EM/IR chart beside it (emir_chart.png and emir_chart_light.png: every net, the worst items numbered).
  • --gds GDS: with --html: the layout under the chart, drawn by KLayout (a DSPF whose coordinates are the layout's: emir extract --tool magic writes them so); --cell names its cell
  • --open: open the HTML report in a browser when done
  • --viewer DIR: write the layout-viewer data to this directory (e.g. emir_out/viewer): SKILL for the Virtuoso EMIR Explorer and a marker database for KLayout. Results land on the layout itself, which is where the fix happens.
  • --viewer-all: write every segment into the viewer data; by default a run with more than 20000 segments keeps the worst (clean ones and IR off the rails left out)
  • --lib LIB: OA library the viewer should open (default from the site file)
  • --spectre SPECTRE: spectre executable for --netlist (default: $SPECTRE_BIN, site file, then $PATH)
  • --no-check: skip the input checker (not recommended)
  • --force: run even if the input checker reports FAIL
  • --summary-out FILE: write the run summary (the emir.run/1 JSON document, the same one --format json prints) to this file; emir report --from FILE turns it into the summary for a person
  • --power-nets POWER_NETS: comma-separated supply/ground nets. IR is a PDN quantity by convention, so these set the IR colour scale and are what the viewer opens on; other nets stay selectable (analog bias and reference lines have real drop). Inferred from net names if omitted.
  • --cell CELL: cell the viewer should open, and the --gds cell under the chart (default: the DSPF design name)
  • --fail-on-violation: exit 1 when any net's verdict is FAIL (for CI and agents); without it a completed run exits 0

emir save-lines

Print the lines that save every branch current an rcc run reads: Spectre save, HSPICE .probe (with the ASCII output option), Xyce .print, ngspice .save (--sim).

emir save-lines dspf [options]

Arguments

  • dspf: the DSPF; --dspf FILE is accepted as the same

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --net NET: one net (default: all)
  • --mode {rcc}: rcc, the one method (it may be left out): every branch current, for a simulation of the RC netlist
  • --prefix PREFIX: instance path in the testbench, e.g. "XI0."
  • --out FILE: also write the lines to FILE (to include in the testbench)
  • --sim {spectre,hspice,xyce,ngspice}: the simulator whose syntax to print (default spectre)
  • --names-out FILE: hspice/xyce/ngspice: write the names sidecar here (<result>.names), mapping the simulator's current names to the DSPF's
  • --raw FILE: hspice/xyce: the result file the lines write (HSPICE: the .tr0 of hspice -o <stem>; default: --names-out without .names)

emir schema

Print the JSON Schema (2020-12) of a document emir reads or writes.

emir schema [name] [options]

Arguments

  • [name]: e.g. run, check, process, error

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --list: every schema

emir selftest

Offline proof that the install works (a few seconds).

emir selftest [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --keep: keep the output directory
  • --out OUT: output directory (default: temp)

emir simulate

Simulate a testbench so that emir run --cc-sim can read the currents: writes a copy of the testbench with the lines that save every branch current rcc reads (Xyce .print, ngspice .save, HSPICE .probe with ASCII output; Spectre: a deck that includes the testbench and a file of save statements), runs it to a text result, and writes the <result>.names sidecar that maps the simulator's names to the DSPF's. The testbench is the person's: stimulus, models, a .tran analysis, and the RC-extracted netlist (the DSPF itself). Spectre and HSPICE need a licence: without --run the deck is written and the exact command printed, nothing runs (ask the person, then add --run).

emir simulate testbench --sim {spectre,hspice,xyce,ngspice} --dspf DSPF [options]

Arguments

  • testbench: the testbench (its .include files are followed; Spectre: any syntax Spectre reads)

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --sim {spectre,hspice,xyce,ngspice}: the simulator (spectre and hspice: licensed, planned unless --run) (required)
  • --dspf DSPF: the DSPF the currents are for (required)
  • --net NET: one net (default: every net)
  • --mode {rcc}: rcc, the one method (it may be left out): the testbench simulates the RC netlist and every branch current is saved
  • --out RAW: the result to write (default emir_out/sim/result.raw; HSPICE: <stem>.tr0; Spectre: a PSF ASCII directory); the deck, the log and the names sidecar go beside it
  • --prefix PREFIX: the instance path of the extracted block in the testbench, e.g. XI0. (default: found in the testbench; Spectre: required, '' for the top level)
  • --subckt SUBCKT: the block's .subckt name (default: the DSPF's design)
  • --process PROCESS: the process file, so the next steps are the exact check and run commands
  • --timeout S: stop the simulator after this many seconds (default 3600)
  • --run: spectre, hspice (licensed): run the simulator; without it the deck is written and the command printed, and nothing runs (the open simulators always run)
  • --sim-args ARGS: extra arguments for the simulator's command line, split as a shell would: Spectre APS '+aps', Spectre X '+preset=cx +postlpreset=off' (keep the parasitic resistors for rcc) ...

emir validate

Run the analytic validation suite (6 closed-form cases).

emir validate [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --out OUT: directory for the test files (default: a temp dir, removed when every case passes)
  • --keep: keep the output directory
  • --quick: leave out the slow cases (none is slow now: kept for the scripts that pass it)
  • --no-skip: kept for the scripts that pass it: every case needs only numpy, scipy and PyYAML, so none is skipped for a missing package

emir verify-sim

Prove on this machine that a simulator's route into EMIR gives the right numbers: simulate small testbenches with hand-checkable answers (the sample rail with ideal current-source loads, DC and pulsed, R and RC; and with real devices on it -- a diode-connected PMOS and NMOS, a resistor, a subcircuit-wrapped NMOS), every branch current saved, through the same route a run takes (save lines, names sidecar, reader), run rcc on them and compare with the analytic answers; and record the outcome in the EMIR state directory ($EMIR_STATE_DIR, else ~/.emir/verified.json). Runs then count a result as verified only when the latest record for its simulator, version, format and --sim-args passed with this emir minor version. Spectre and HSPICE need a licence: without --run the decks are written and the commands printed, nothing runs. Screening, not sign-off.

emir verify-sim --sim {spectre,hspice,xyce,ngspice} [options]

Options

  • --format {text,json}: text (for a person, the default) or json (one JSON document on stdout, logs on stderr; emir schema describes it)
  • --sim {spectre,hspice,xyce,ngspice}: the simulator to verify (required)
  • --run: spectre, hspice (licensed): run them (ask the person first); xyce and ngspice always run
  • --out DIR: where the testbenches and results go (default emir_out/verify-sim/<sim>)
  • --timeout S: stop each simulation after this many seconds (default 600)
  • --record-host: also keep this machine's host name in the record (left out unless asked); a record with a host counts only on that host
  • --sim-args ARGS: extra simulator arguments, as your runs use them (Spectre APS '+aps', Spectre X '+preset=cx +postlpreset=off' ...): the verification then covers that configuration only (runs simulated with the same --sim-args); kept in the record