Skip to content

Native flow steps

Seven commands do, inside the rustroad executable, the file-level work that a producer manifest runs between the engine commands: preparing PDK collateral, running and recording the grouped antenna session, reviewing that record, and the post-route electrical repair loop. They replace the Python helpers of the Ibex SG13G2/EZ130 recipe (native_physical_inputs.py with scripts/build_rc_profile.py, antenna_session/native_antenna_groups.py, antenna_session/verify.py, native_postroute.py), which remain in the RustEDA repository as the reference implementations.

Command Replaces Opens a workspace Runs child processes
physical-inputs native_physical_inputs.py no no
bundle-cell-gds its GDS merge no no
gds-layer-map its layer-map projection no no
rc-profile scripts/build_rc_profile.py (ihp, sky130, gf180) no no
antenna-session native_antenna_groups.py no one repair-antenna-groups
verify-antenna-lineage antenna_session/verify.py no no
postroute-repair native_postroute.py (screen order) no rustroad, rusteda, ruststa

Conventions shared by all of them:

  • Inputs are one JSON file (--inputs) of pinned file records {"path", "sha256", "bytes"}, re-hashed before use, or plain file arguments for the three single-purpose commands. --workspace is not used.
  • Output directory (--out-dir) must be fresh: postroute-repair requires that it does not exist; the others create it, take workspace.lock exclusively and fail with REVISION_CONFLICT if it holds anything else. A successful step leaves HEAD = rev1 where the reference helper did.
  • Result: JSON on stdout. The four step commands print one line: the step result (physical-inputs, verify-antenna-lineage; the same object is stored indented as result.json) or its summary fields (antenna-session, postroute-repair; the full record is lineage.json, result.json). The three single-purpose commands print an indented object. Errors are one JSON object on stderr, {"status":"error","code":CODE,"message":...}, exit status 2. A failed postroute-repair, antenna-session or verify-antenna-lineage also leaves its failure record (result.json with status: "error", failure.json, result.json with status: "rejected_or_unverified").
  • Bytes: every JSON file these commands write is what CPython's json module writes for the same data (key order, repr(float), ensure_ascii escapes, indentation), because later steps pin these files by SHA-256 and two implementations must not disagree about them. crates/rustroad-pyjson is that writer and an order-preserving reader; its tests compare against strings written by CPython.
  • Engine work is not linked in. A step that needs the timing engine or another rustroad run starts the pinned executable named in its inputs and reads the files that process wrote. rustroad does not link RustSTA.

physical-inputs: cell GDS bundle, GDS layer map, nominal RC profile

rustroad physical-inputs --inputs physical-inputs.json --out-dir backend/profiles

rusteda.native-physical-inputs.v2:

{
  "schema": "rusteda.native-physical-inputs.v2",
  "pdk_root": "/path/to/IHP-Open-PDK",
  "files": {
    "std_gds": {"path": "...", "sha256": "...", "bytes": 0},
    "ram_gds": {}, "layer_map": {}, "tech_lef": {},
    "rules_nom": {}, "magic_tech": {}, "magic_extract": {}
  }
}

Exactly these seven records. rules_nom must be one of the PDK's two nominal calibration tables (IHP_rcx_patterns.rules or ihp-sg13g2.nom.magic.rules) and the two Magic files the PDK's own, under pdk_root/ihp-sg13g2. The directory then holds combined-cells.gds, gds-inputs.json, gds-map.json, ihp-rc-nom.json, result.json (status: "prepared_not_qualified", the input records and the three artifact identities), HEAD and workspace.lock. The v1 schema of the Python helper additionally pinned rc_builder, the profile script it imported; that record is the only difference between the two helpers' result.json.

That schema is the Ibex SG13G2/EZ130 recipe and is unchanged. Any other PDK profile uses rusteda.native-physical-inputs.v3, which names nothing by its place in a PDK tree:

{
  "schema": "rusteda.native-physical-inputs.v3",
  "pdk": "sky130A",
  "library": "sky130_fd_sc_hd",
  "cell_gds": ["std_gds", "ram_gds"],
  "layers": ["li1", "mcon", "met1", "via", "met2", "via2", "met3", "via3", "met4", "via4", "met5"],
  "rc": {"builder": "sky130", "resistance_model": "magic"},
  "files": {
    "std_gds": {"path": "...", "sha256": "...", "bytes": 0}, "ram_gds": {},
    "tech_lef": {}, "layer_map": {},
    "rules_nom": {}, "magic_tech": {}
  }
}
  • cell_gds lists the keys of the GDS libraries to bundle, in order; every record whose key ends in _gds must be listed once (one library or many: cells, then macros).
  • The layer map is files.layer_map, the PDK's KLayout LEF/DEF map, projected onto layers (bottom to top; a layer is a cut layer when files.tech_lef declares it TYPE CUT, and must be a routing or cut layer), or files.gds_map, a tracked rustroad.gds-layer-map.v1 that is copied (layers is then empty).
  • The RC profile is built from files.rules_nom, files.magic_tech and, for a table entry with a second Magic file, files.magic_extract, by the entry rc.builder of rc-profile with rc.resistance_model; or it is files.rc_profile, a tracked nominal rustroad.rc-profile.v1 whose technology_lef_sha256 is the digest of files.tech_lef, copied (rc is then {}).
  • No other record is accepted. The built profile must name exactly the pinned files as its sources (RC profile sources differ otherwise), so a file is identified by its bytes and not by its name.

The directory holds combined-cells.gds, gds-inputs.json, gds-map.json, rc-nom.json and result.json (with pdk and library after status).

The three parts are also commands of their own:

rustroad bundle-cell-gds --gds std.gds --gds ram.gds --out combined.gds
rustroad gds-layer-map --map sg13g2.map --out gds-map.json
rustroad gds-layer-map --map sky130A.map --pdk sky130A --library sky130_fd_sc_hd \
  --technology-lef sky130_fd_sc_hd__nom.tlef --layer li1 --layer mcon --layer met1 \
  --out gds-map.json
rustroad rc-profile --corner nom --pdk-root /path/to/IHP-Open-PDK \
  --resistance-model openrcx-pdk --rules IHP_rcx_patterns.rules \
  --technology-lef ez130_sg13g2_tech.lef --out ihp-rc-nom.json
rustroad rc-profile --pdk sky130 --corner nom --pdk-root / \
  --rules /pdk/sky130A/libs.tech/openlane/rules.openrcx.sky130A.nom.calibre \
  --technology-lef /pdk/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef \
  --magic /pdk/sky130A/libs.tech/magic/sky130A.tech --out sky130-rc-nom.json
  • bundle-cell-gds copies every structure (BGNSTR..ENDSTR) byte for byte: the first library's header through UNITS, the structures sorted by name, ENDLIB. Libraries must have the same UNITS record (nothing is rescaled) and a structure name that occurs twice must have identical bytes. Caps: 32 MiB, one million records, 8192 structures. Result: sources, output, structures, records, scope.
  • gds-layer-map projects a KLayout LEF/DEF layer map (<layer> <purposes> <gds layer> <datatype>) onto rustroad.gds-layer-map.v1: per LEF layer the pairs of its NET, SPNET, VIA and PIN purposes, the label pair and the source lines; a cut layer keeps only VIA; DIEAREA gives the boundary. --layer (repeatable) selects the layers. Two forms exist. Without --technology-lef the projection is the IHP recipe's, unchanged: the default layers are the SG13G2 stack Metal1..TopMetal2, a layer whose name contains Via is a cut layer, the label row is NAME <layer>/PIN, every row that names the layer is cited, and the source is called ihp_map. With --technology-lef (and --layer) a layer is a cut layer when the LEF declares it TYPE CUT (SKY130's mcon, via, via2), the label row is a NAME row that lists <layer>/LABEL or <layer>/PIN (both PDKs write NAME <layer>/LABEL[,<layer>/LEFPIN]), only the rows an entry was read from are cited, a cut entry has lef, kind, via and cite only, and the source is called klayout_map. That is the form of the tracked fixtures/pdk/sky130-gds-map.json and gf180-gds-map.json: for the maps of the two PDK trees (SHA-256 80a0e06e... and ac49b08c...) the projection gives the same layers and boundary values, layer for layer and line for line. The tracked files differ in what the projection does not read: they also cite the Magic technology file (sources[1] and a second cite entry per layer), carry notes, and record the map's path on the machine that wrote them.
  • rc-profile builds a rustroad.rc-profile.v1 profile from the PDK data files only (extraction.md describes the model). It is scripts/build_rc_profile.py, value for value: --pdk ihp|sky130|gf180 selects the table entry (the files below --pdk-root, the routing layers, the Magic types and planes, the contact type of each cut, whether the technology LEF's RC statements are valid cross-check data), --corner min|nom|max, --resistance-model magic|openrcx-pdk (the latter for ihp only, as in the script). --rules, --technology-lef, --magic and, for ihp, --magic-extract replace the entry's files; given as absolute paths they make --pdk-root irrelevant, which is how a flow passes its pinned files (the SKY130 tree of open_pdks 1.0.471 keeps the rules under libs.tech/openlane, not libs.tech/librelane). The profile's generator field keeps the script's name, so a profile has the same bytes whichever implementation wrote it. The tests compare all three entries at all three corners with profiles the script wrote for synthetic PDK trees (tests/fixtures/steps/generate.py, generate_pdk_profiles.py).

antenna-session: one grouped repair session and its lineage

rustroad antenna-session --inputs antenna-inputs.json --out-dir backend/antenna-repair

rusteda.native-antenna-inputs.v2 is unchanged from the Python runner: design_workspace, initial_revision, the pinned tool (the rustroad that runs the session), limits (threads 2, 4 or 16, max_rounds 1..3 and the fixed work bounds) and grouping (the pinned policy of antenna-groups.md).

The controller and the engine are two processes. The controller writes native-plan.json, runs

<tool> --workspace W --threads N --max-expansions 8000000 \
  repair-antenna-groups --base-rev R --plan native-plan.json

as its one child, stores that argv (native-session-command.json), the child's stdout (native-session.json) and stderr, and then rebuilds the record from the report files on disk: for every check report its canonical selection (<name>-selection.json) and its header (<name>-header.json, every top-level field except the raw rows), for every repair its selection, final-head.txt, and lineage.json (rusteda.native-antenna-lineage.v4): one typed entry per in-process operation with the report's SHA-256, the attempt chain with its logical revisions, the two materialized revisions' design files, the child's receipt and the session accounting copied from the engine summary.

The session stays a child process on purpose. The lineage's commands entry is a parent-side receipt (exact argv, exit code, captured bytes, wall time); an engine that wrote its own lineage could only report these about itself, and the record would no longer be the one verify-antenna-lineage and the earlier runs' reviewers check. The cost is one extra process start and a second read of the reports.

A failed engine child or any binding failure leaves failure.json and the partial evidence; an unresolved native result is a successful step with status: "unresolved" (foundry antenna signoff is a separate gate).

verify-antenna-lineage: independent review of the session record

rustroad verify-antenna-lineage --inputs antenna-verification-inputs.json \
  --out-dir backend/antenna-verification

Inputs rusteda.antenna-v3-independent-verifier-inputs.v2: lineage and controller_inputs (file records), tool, design_workspace, evidence_kind. The .v1 schema of the Python verifier, which also names a source_manifest of pinned source files, is accepted unchanged (each listed file is re-hashed, and the review repeats the record).

The review never runs an EDA command and trusts nothing the session wrote in memory: crates/rustroad-antenna-verify depends on neither the engine crate nor the flow crate, decodes every file again as generic JSON and re-hashes every file identity, twice (when first used and at the end). In the order of the reference verifier, with its rejection codes:

  • the controller inputs, the session plan, and the single native process receipt: exact 12-element argv, exit code 0, captured stdout byte-equal to native-reports/summary.json;
  • every operation: name, verb, report path, selection and base revision;
  • every check report: rows streamed one at a time and counted per net against the coverage (rows, shapes, gate_terminals, observation), verdict counts, worst-net summary, status, work and report-memory ledger, selection fingerprint and physical-source fingerprint; its header file must equal the report's own top-level fields;
  • the attempt chain: eligible nets recomputed from the planning check, the fresh pre-repair check, the repair report, work accounting, logical revisions (not materialized, a new physical source after each mutating repair), the committed final revision and its parent;
  • inventories before and after (names, ids, counts, LEF sources re-hashed), the connectivity model, the final groups as an exact partition of the inventory, observation counts, unresolved and macro-touching nets;
  • the report-byte and work ledgers recomputed from the reports.

result.json is rusteda.antenna-v3-independent-lineage-review.v1 with status: "metadata_lineage_verified_requires_full_signoff": the records are consistent with each other and with the files. It never says the layout is antenna clean. verifier_source is the reviewing executable, resources the applied 2 GiB address-space limit and the peak RSS. A rejection writes {"status": "rejected_or_unverified", "error": CODE} and exits 2 with ANTENNA_LINEAGE: CODE.

postroute-repair: screen, equal-width upsize, ECO rebuild

rustroad postroute-repair --inputs postroute-inputs.json --out-dir backend/postroute

rusteda.native-postroute-inputs.v3 is the Python runner's v2 without its Python pins:

  • top, trial (workspace, revision rev4), final_workspace (<out-dir>/road), final_spef (a fresh path beside the output directory), prects_netlist;
  • recipe: the argument lists of the final import, place, cts, route and extract runs (@NETLIST@ and @SPEF@ markers);
  • screen: file records of the trial SPEF, the extraction report and the producer's command record of that extraction;
  • antenna: file records of the session inputs and lineage, and of the verifier_inputs and verification (both or neither);
  • profiles (sizing, delay, cell_buses, cell_lef), timing (std_tt, ram_tt, std_ss, ram_ss, sdc), tools (rustroad, rusteda, ruststa), policy (near_limit_ratio, target_ratio, max_rounds <= 3, max_resizes <= 1024), limits (threads, deadline_seconds);
  • optionally profile, the PDK identity of a flow that is not the Ibex SG13G2/EZ130 recipe: pdk (the label of the equal-width sizing profile), corners (exactly two names: the repair policy compares two Liberty corners), groups (the Liberty groups, std first, then one per macro master: the libraries of a corner are timing.<group>_<corner>) and dbu_per_um (the database unit of the workspaces, in which the sizing profile gives cell widths). Without it the step uses ihp-sg13g2, tt and ss, std and ram, and 1000, and writes the files it always wrote.

One command instead of a planning command plus manifest steps: the repair is a data-dependent loop of zero to max_rounds rebuilds, each of which is import, place, clock tree, ECO route, antenna session, review and extraction; a producer manifest is a fixed list of steps and cannot express it, and the result record lists the commands that actually ran.

The protocol, per round:

  1. Bind the screened layout: the workspace HEAD, the SHA-256 of its design.json and routes.rbin (the design file must be the antenna lineage's final one), the extraction report naming this SPEF and RC profile, and the SHA-256 of the exact extraction argv. The trial is never extracted again.
  2. Time it: rustroad export-verilog, rusteda init and import (TT and SS Liberty, stub cells for physical-only LEF macros, the SPEF at both corners), ruststa run, then the summary and drv reports of both corners (the four read-only queries run together).
  3. Plan: rows of max_capacitance/max_transition at or above near_limit_ratio of the limit, or violating, ask for an upsize of the net's driver within its equal-footprint family (same pins, directions and output functions in both Liberty corners, same LEF width and height, no sequential, bus, clock-gating or dont_use cell). A transition row takes the strongest member; capacitance rows take the weakest member whose limit times target_ratio covers the load. Rows without an upsize are recorded as residual (violating) or skipped.
  4. No resize: the final workspace is the screened one, hard-linked file for file with a fresh HEAD and lock, and the final SPEF is a hard link of its SPEF. Otherwise apply-eco writes the resized pre-CTS netlist, the recipe is replayed with the screened route as ECO prior, the rebuild is antenna-repaired (antenna-session), reviewed (verify-antenna-lineage), extracted with the same argument template, and screened again.

Outputs: equal-width-sizing.json, check<n>/ (stub libraries, the STA workspace), logs/<name>.stdout|.stderr of every child, plan<n>.json, netlist<n>.v, build<n>/, antenna<n>/ for rebuilds, road/, and result.json (rusteda.native-postroute-result.v2: status clean, repaired, residual_violations or round_budget_exhausted, every screen, round, resize and command). Nothing here is signoff: setup and hold are recorded, not repaired, and the timing, DRC, LVS and antenna gates remain separate. The earlier order of the recipe, in which the runner extracted the pre-antenna trial itself, is not ported.

Byte identity with the reference helpers

Checked on the Ibex SG13G2/EZ130 run by replaying each step at one path with the Python helper and with the native command (the same pinned engine binaries as children), and by a complete producer run:

Step Files Identical Differences
physical-inputs 7 6 result.json and stdout: inputs.rc_builder absent
antenna-session 1,545 1,542 run times only: wall_seconds of the engine summary (2 files) and of lineage.json, and the summary's SHA-256 in the lineage
verify-antenna-lineage (v1 inputs) 3 2 result.json: verifier_source, resources.peak_rss_kib_self
postroute-repair 84 79 result.json: input_manifest (the v3 inputs file), policy_source, no tools.python, wall_seconds, resources; the timing engine's own time stamps (4 files of its workspace)

The same differences appear between two runs of the Python helpers, except the provenance records (rc_builder, verifier_source, policy_source, tools.python, the inputs schema).

A complete producer run with the native steps (2026-11-13, same work path and tool paths as a run with the Python helpers the hour before) gives the same GDS, DEF, final and powered netlists and native SPEF (SHA-256 fba3206d..., b0ffd146..., a03ce194..., f97fe4c5..., a8d158e6..., the 2026-11-05 campaign's). Of the 2,010 files of the backend, its logs and the trial workspace, 1,890 are byte-identical. The other 120 differ in: the pinned rustroad identity wherever it is recorded (session inputs, lineage, review, post-route result, the build field of the workspace receipts); the dropped Python records listed above and the input schemas (checked_file_ids of the review is 1,547 instead of 1,554: the manifest of frozen helper sources and its six files); run times, time stamps, memory and cgroup telemetry and the hashes of files that contain them; and the outputs of the external tools that are not byte-deterministic between any two runs (the OpenRCX SPEF and what the timing step derives from it, KLayout's LVS database).

The rebuild path of postroute-repair does not occur on that run (its status is clean). Its policy was checked on the run's real data: for the real final and pre-CTS netlists, both Liberty corners, the cell LEF and the 16,436 DRV rows of the two corners, the plan of the Python runner and the native plan are byte-identical at (near_limit_ratio, target_ratio) = (0.9, 0.8): no resize; (0.7, 0.5): 24 resizes, 16 skipped rows; (0.5, 0.3): 284 resizes, 103 skipped. The loop itself (apply-eco, rebuild, antenna session, review, extraction, re-screen, round budget) is compared with the Python runner by the RustEDA repository's protocol test (tests/test_native_backend_steps.py), which runs both against the same stand-in tools.

Tests: crates/rustroad-pyjson/tests (CPython-written numbers and documents); crates/rustroad-flow/tests/steps_reference.rs (synthetic PDK files, Liberty, LEF, netlists and DRV rows) and antenna_session_reference.rs, crates/rustroad-antenna-verify/tests/review_reference.rs (one recorded session: the Python controller's records, the Python verifier's review and its rejection code for thirteen mutations). The expectations were written by the reference helpers; tests/fixtures/steps/generate.py regenerates them.

Measurements

Ibex SG13G2/EZ130, 4-vCPU host, 2026-11-13. Each step was replayed in the finished producer tree five times with the Python helper and five times with the native command, interleaved, under GNU time with the producer's environment; both run the same pinned binaries as children (the antenna session and the timing engine at 4 threads). One-minute load 1.2-1.7. Median (range):

Step Python helper, wall s native, wall s Python helper, CPU s native, CPU s
be_profiles (physical-inputs) 0.12 (0.11-0.14) 0.01 (0.01-0.02) 0.11 (0.10-0.12) 0.01 (0.01-0.01)
be_antenna_repair (antenna-session) 8.78 (8.31-9.18) 7.18 (6.83-7.50) 11.25 (10.54-11.40) 9.64 (9.31-9.96)
be_antenna_verify (verify-antenna-lineage) 2.07 (1.96-2.14) 1.23 (1.11-1.28) 2.04 (1.94-2.13) 1.23 (1.10-1.27)
be_postroute (postroute-repair) 4.42 (4.35-4.63) 4.26 (4.17-4.41) 7.79 (7.68-7.96) 7.72 (7.55-7.99)
sum of the medians 15.39 12.68 21.19 18.60

What is left is the children. In the producer run the session's engine child took 6.91 s of the step's 7.25 s (40 repair attempts, 528 report operations), and the post-route children 4.6 s of 5.10 s (rusteda import 1.11 s, ruststa run 3.38 s, the netlist export and four report queries the rest). The review is all this command's own time: it decodes every check report twice and hashes every pinned file when it is first used and again at the end.