Skip to content

feat(cli): add ecc macro manual placement and rename macro_location.tcl - #285

Merged
Emin017 merged 5 commits into
mainfrom
yell/cli_mp
Sep 15, 2026
Merged

Emin017 merged 5 commits into
mainfrom
yell/cli_mp

Conversation

@Yell-walkalone

Copy link
Copy Markdown
Contributor

What Changed

Manual hard-macro placement via CLI, plus the handoff file rename. The top two commits are the feature; the bottom three are the yell/fix_config fixes this branch carries (no open PR existed for them).

  • Add the ecc macro set/remove/show command group and the macro.placements parameter (JSON list of {instance, x, y, orientation} in microns, instances committed fixed). Project scope stores it in ecc.toml [params.macro]; workspace scope writes home/params.toml through the existing parameter transaction (snapshot + refresh + invalidation from macroPlacement).
  • Render macro.placements into config/macro_location.tcl on workspace creation and on every config refresh; an empty parameter leaves the file untouched so DreamPlace's own handoff survives.
  • Rename the handoff file macro_localtion.tclmacro_location.tcl; workspaces still carrying the legacy filename are migrated automatically when opened.
  • While macro.placements is non-empty, macroPlacement keeps its load/save flow but skips DreamPlace macro placement; postFloorplan commits the macros from the generated file, so the flow chain is unchanged.
  • Docs: configuration reference §1.5, user guide §9.5, tutorial §6.5, and the floorplan-flow handoff section (EN + CN).
  • Carried from yell/fix_config: direct-config param overrides no longer crash divergence checks (3653f34), stale STA pre-init dropped from timing-driven routing (9d23a19), Sizer records the native crash signal and first fatal log line (0d282fe).

Scope

  • CLI - command behavior, Typer command surface, output formats, or workspace commands.
  • Flow/runtime - workspace lifecycle, EngineFlow, step execution, logs, metrics, or artifacts.
  • EDA integration - Yosys, ECC-Tools, DreamPlace, KLayout, PDKs, or native/runtime wrappers.
  • Build/package - Nix, PyInstaller, wheels, uv.lock, or release artifacts.
  • CI/release - GitHub Actions, version checks, changelog, or release automation.
  • Tests/docs only

Runtime And Packaging Impact

  • No runtime or packaging impact
  • CLI output or machine-readable contract changed
  • Workspace layout, flow state, or artifact paths changed
  • Native toolchain or wrapper behavior changed
  • ecc-tools or ecc-dreamplace dependency changed
  • PyInstaller, Nix, or release artifact changed

Notes:

  • New ecc macro commands; the workspace handoff file is renamed with automatic migration of the legacy filename, so existing workspaces keep working.
  • No gitlink change: the pinned ecc-tools submodule already contains the parser/writer for the command-prefixed handoff format (e2751b03b). Prebuilt ecc-tools binaries older than that commit reject the format, so deployments must build ecc-tools from the current pin.

Validation

List the commands you ran. Mark checks that are not applicable as N/A.

  • uv run pytest test/ — 2573 passed, 3 skipped, 1 deselected, 4 xfailed
  • uv run ruff check chipcompiler test — all checks passed
  • uv run ruff format --check chipcompiler test — clean (854d1c1)
  • PyInstaller smoke: ecc --help, ecc --version, ecc version --json — N/A
  • Nix smoke: nix run .#cli -- --help — N/A
  • Manual flow smoke: obsidian_engine design (16 ROM hard macros, ics55 PDK) entering from the synthesis netlist — ecc macro set for all 16 instances, then ecc run --from preFloorplan --to postFloorplan: all three steps Success; the macroPlacement subflow records macro placement in 0s with no DreamPlace artifacts and the generated Tcl untouched; the postFloorplan DEF has all 16 instances + FIXED at exactly the CLI-specified micron coordinates (R0 → N) with the configured halos.

Skipped checks and reason:

  • PyInstaller/Nix smoke: no packaging or build inputs changed.

Checklist

  • I kept the change scoped to ECC.
  • I updated docs or user-facing CLI text where behavior changed.
  • I included lockfile or version metadata updates when dependencies changed. (No dependency changes.)
  • I documented any submodule updates and why they are needed. (No submodule updates.)
  • I did not include local caches, virtual environments, or generated build outputs.
  • I explained skipped validation and remaining risk.

Remaining risk: none known in the Python paths; runtime environments must use an ecc-tools build from the current submodule pin (see the note above).

Direct config/PDK parameters (maps_to=None) are applied through their
explicit config target and have no legacy backend projection.
_backend_leaf_keys now returns an empty tuple for them instead of
calling .items() on None, and a diverging direct-config override
reports its canonical parameter name rather than an invented backend
leaf key.

Covers both --set runs and project-level ecc.toml [params] runs, with
registry-wide regressions over every schema mapping shape.
The routing path and save_data still called release_sta/init_sta/
report_timing, an STA lifecycle that ecc-tools removed on 2026-07-29
(1a4440525) and that no longer exists on ECCToolsModule or the raw
binding. Enabling route.RT.-enable_timing therefore crashed the routing
step with AttributeError before the router started.

iRT's timing mode is self-contained: RTInterface builds its own timing
engine from the shared db config (lib paths, SDC set by load_data), so
the Python-side pre-init is removed rather than ported. save_data's
report_timing block was unreachable (every caller passed False) and is
dropped together with the parameter; the unused is_rt_timing_enable
wrapper follows.
Timing-opt failures now distinguish a fatal signal
(signal=SIGABRT(6)) from a plain tool exit (exit_code=N) and surface
the first native fatal banner from the step log (e.g. glibc buffer
overflow), so tool crashes, external kills, and timeouts remain
separable in the wrapper evidence.
- rename the macro-placement Tcl handoff to macro_location.tcl (legacy
  macro_localtion.tcl files migrate automatically when a workspace opens)
- add the macro.placements parameter (json list of {instance, x, y,
  orientation} in microns, instances committed fixed) rendered into
  config/macro_location.tcl on workspace creation and every config refresh
- add the ecc macro set/remove/show command group with project and
  workspace scopes; workspace scope reuses the parameter transaction
  (snapshot + refresh + invalidation from macroPlacement)
- skip DreamPlace in macroPlacement when manual placements are set; the
  step keeps its load/save flow and postFloorplan commits the macros from
  the generated file
- update config reference, user guide, tutorial, and floorplan-flow docs
@Emin017 Emin017 added the enhancement New feature or request label Sep 15, 2026
@Emin017 Emin017 added this to the 0.1.0-alpha.13 milestone Sep 15, 2026

@Emin017 Emin017 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Emin017
Emin017 merged commit 0d2b176 into main Sep 15, 2026
5 checks passed
@Emin017 Emin017 added the bug Something isn't working label Sep 15, 2026
@Emin017
Emin017 deleted the yell/cli_mp branch September 15, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants