Skip to main content
Attar: the fast loop for physical design

Diverse P&R benchmarks, distilled into one plug-and-play PyTorch environment on the GPU.
Evolve placement and timing-optimization algorithms in minutes, not days.

Python PyTorch Validated Tests License

Install  ·  Why Attar  ·  Roadmap  ·  Two modes  ·  How it works  ·  Gallery


Install

pip install attar
import attar
d = attar.load('after_fp/orfs_asap7/aes', device='cuda')   # downloaded from the zoo on first use

Python 3.8 or newer, with PyTorch (a CUDA GPU for the speed; everything also runs on the CPU). The designs come from the Attar zoo on the Hugging Face Hub (246 designs, 731 MB in all); attar.zoo(remote=True) lists them. The latest code: pip install git+https://github.com/RayChang987/Attar.

  • The first timing run on a GPU machine compiles the timer's Triton kernels (about two minutes, once); later runs reuse them and take seconds.
  • With g++ on the path, nets of more than 256 pins get OpenROAD's exact Steiner parasitics (built on first use); without it they fall back to a lumped wire model, with a warning.
  • No GPU at hand: the demo below runs in Colab (free T4, g++ included): Open In Colab

Why Attar

  1. Speed decides quality. When AI agents do the research, iteration speed is more than a metric: in our view it decides the quality of results (QoR). An agent that can propose, test and discard an idea in seconds finds what works. When every run takes hours, even the best algorithm starves for feedback.
  2. Data preparation is painful. Traditional place-and-route (P&R) tools take minutes to hours per run, and every benchmark suite comes in its own format (LEF/DEF, Bookshelf, YAL, GSRC blocks) with its own gaps. Getting a design ready to experiment on is slow, fragmented work, repeated for every suite.
  3. Attar is the fast loop. Attar distills diverse P&R benchmarks into one plug-and-play PyTorch environment: attar.load a name, and the design is on the GPU. Each reader hands over only the facts its source has, with their provenance, and nothing missing is made up (a design is a state). The fast loop stays faithful to the full flows without their overhead: its HPWL equals OpenROAD's to 7 digits, its legality equals check_placement, its placements route in OpenROAD-flow-scripts with 0 DRC, and HPWL ranks placements as routed wirelength does in 951 routed Innovus runs, once they differ by 2% or more (validation).
  4. GPU-native. Layouts and design features are tensors on the GPU, so researchers, developers and AI agents train, evaluate and debug in the same few lines of Python: exact HPWL of 8.9M pins in 3 ms, a 2.2M-cell design placed and legalized in 49 s. An algorithm is a function from tensors to positions: no database API, no TCL, no file formats.

Roadmap

Roadmap mind map. Attar in the center. Left, Data, as tensors: contest benchmarks, one per suite (placement: ISPD 2005, 2015, 2018, 2019, 2024, ICCAD 2025, GSRC placement; floorplan: MCNC, GSRC blocks, IBM-HB+), ASAP7 (15 placement, 5 floorplan designs) and NS3K (99 placement designs). Right, Naive Engine: floorplan (packing, macro placement, IO placement) and placement (placer, legalizer, PDN-aware refinement), all done. Right, Evaluation: HPWL, global routing OVF and timing done; blocked pin checking not yet; detailed routing and DRV checks will not be built

Evaluation

Each evaluator against OpenROAD on the same netlist and placement; full tables in docs/validation.

Evaluator Call Compared with Accuracy
HPWL ev.hpwl OpenROAD's HPWL from its database; 23 ORFS designs (ASAP7, Nangate45) up to 1.05M cells within 0.00002% on every design (table)
Legality ev.legality OpenROAD check_placement same verdict on all 23 ORFS designs and the 62 NS3K floorplans OpenROAD can check; placements broken by half a site rejected by both
Timing d.timing() OpenSTA after estimate_parasitics -placement; 31 designs (ASAP7, Nangate45, NS3K) up to 1.05M cells WNS median error 0.00% (ORFS) and 0.11% (NS3K), max 0.34%; hold slack MAE at most 0.36 ps; 5-30x faster than OpenSTA
Pin and net slack d.timing().pin_slack(), .net_slack() OpenSTA's slack_max of every pin; 8 designs (ASAP7, Nangate45) up to 384k pins Pearson at least 0.9995; on the pins with negative slack, MAE at most 1.03 ps; 7-32 ms after a timing run
Timing after sizing d.resize + d.timing() OpenROAD replace_cell + OpenSTA, 20% of the cells swapped at random; 16 designs WNS error at most 0.23%, TNS at most 0.37%
Timing after netlist edits d.edit(), d.debuffer() + d.timing() OpenSTA on the DEF Attar exports: after 1,548 buffers and 443 clones inserted (10 NS3K designs up to 163k cells), and after d.debuffer() removed 45,991 buffers and 83 inverters (10 ORFS designs) setup Pearson at least 0.9997, WNS error at most 0.04% after debuffer and 1.18% after the NS3K edits; hold MAE at most 0.36 ps
Global routing OVF d.gr_overflow() OpenROAD's gcell capacities and global route; 13 ORFS designs capacities exact without macros, within 0.16% with them; ranks designs as OpenROAD does (Spearman 0.97); a pre-route estimate: reads mild congestion high and heavy congestion low
Steiner wirelength, RUDY, density overflow ev.steiner_wirelength, ev.rudy, ev.density_overflow

Naive Engine

Engine Mode Call What it does
Packing before_fp naive.place_macros(packing=True) block-level designs: B*-tree packing, annealed into the core, then for HPWL
Macro placement before_fp naive.place_macros mixed-size global placement, then macros legalized on their routing tracks with a halo
IO placement before_fp naive.place_io IO pins on the die boundary, net-aware once cells are placed
Placer both naive.global_place electrostatic (ePlace/DREAMPlace style, Nesterov, CUDA graphs) at the source flow's own target density; routability=True: DREAMPlace's cell inflation
Legalizer after_fp naive.legalize multi-row-height cells, power-rail parity, signal pins clear of the PDN's via metal
PDN-aware refinement after_fp inside naive.legalize row DP and repair that keep cells clear of the PDN

d.floorplan(utilization=...) sizes the die (naive.make_die), then places the IO pins and the macros; d.place() is global placement plus legalization.

Timing-driven placement written in fifteen lines of Python, run on cva6 and swerv: place for wirelength, time it, weight the nets by their slack as OpenROAD's global placement does, place again, time it

Your algorithm, in fifteen lines (examples/timing_driven.py; run it in Colab). Real runs on an RTX 3080 Ti, the same code on two ASAP7 designs: place for wirelength, take every net's slack (net_slack(), as OpenSTA's), weight the worst 10% of the nets from 1 to 5 by criticality as OpenROAD's timing-driven global placement does, place again. cva6 (121k cells, 8 SRAMs): WNS -195 to -75 ps, TNS -85.7k to -5.1k ps, HPWL +6.7%, in 2.2 s. swerv (103k cells): WNS -205 to -117 ps, TNS -39.5k to -1.2k ps, HPWL +1.1%, in 1.9 s. Both legal.

Floorplan mode: GSRC n100 at 85% block area, floorplanned twice: GP plus LP legalization leaves 5 macros outside the core (not legal), B*-tree packing fits them all (legal)

Floorplan mode (before_fp). GSRC n100: 100 hard blocks, no die; Attar sizes one for 85% block area, places the IO pins and the macros. GP + LP legalization never overlaps macros, but here 5 stick out of the core: not legal. packing=True (B*-tree, annealed into the core, then for HPWL) fits them all in 5.1 s, at 8% more wire. The lines are the strongest connections between macros and IO pins.

Two modes

In production chip design, the power delivery network (PDN) is the dividing line: once the power grid and the macros are locked down, the design enters a different phase. Attar splits its problems at that line. It does not synthesize a PDN, and it should not: a before_fp answer goes to a flow that draws one, and an after_fp problem comes with the PDN its flow drew.

Before-floorplan (before_fp) After-floorplan (after_fp)
given the netlist (an initial die for ORFS designs) die, IO pins, macros, rows and PDN: a fixed floorplan
the answer target utilization (the die), IO pin placement, macro placement standard-cell placement; then timing optimization and global routing on the same floorplan
one call d.floorplan(utilization=0.6) d.place()
goes out as a DEF: your flow draws the PDN and places a DEF: your flow routes and times
in the zoo 55 designs, 6 suites 191 designs, 16 suites

Attar measures wirelength, congestion (RUDY, GROV), density, legality and timing; see the roadmap.

How it works

Sources (LEF/DEF, Bookshelf, YAL, GSRC blocks) are distilled into the Attar IR and loaded as a Design on the GPU; attar.naive moves it and adds facts, the Evaluator measures it; export writes a DEF for your own flow (OpenROAD, Innovus, ICC2, ...)

  1. Distill. A reader turns a benchmark into the Attar IR: integer arrays in a safetensors file, plus a manifest that lists which facts the source provides and where each came from. Readers exist for LEF/DEF, Bookshelf, YAL and GSRC blocks.
  2. Load. attar.load puts the arrays on the GPU as a Design. d.status() shows each fact, each capability, and what is left before export.
  3. Move. Your algorithm, or the built-in engines (attar.naive), changes the positions: die, IO pins and macros for before_fp, cells for after_fp.
  4. Measure. attar.Evaluator computes HPWL (exact, batched), Steiner wirelength, RUDY, density overflow and legality, on the current placement or on any positions you pass.
  5. Export. d.export(out_def) writes the design back into its source DEF's frame: the PDN, IO pin shapes and fixed cells as they were, the cells and nets from the IR (a changed die, IO pins and macros included). Your own flow (OpenROAD, Innovus, ICC2, ...) takes it from there.

More: concepts · benchmarks · API · validation

What the Evaluator sees: each view is d.plot(tiles=...) on a real run of attar.naive.

cva6 after placement, colored by global-routing load on OpenROAD's gcells ariane136 after global placement: cells with a signal pin on the PDN, in stripes along the power grid
Global-routing overflow (d.gr_overflow(), tiles='gr_overflow'): cva6 (ASAP7) placed in 2.4 s, RUDY demand against OpenROAD's gcell capacities. GROV 0.73%: the channel left of the SRAMs and the dense logic at the lower right are where the router will struggle. Pin access (tiles='pin_access'): ariane136 (NS3K, 136 SRAMs) right after global placement. 12,165 cells have a signal pin on the PDN's via metal, in stripes along the power grid: NS3K's via stacks cross the M1 pin layer.
ariane136 legalized: legal, rails and PDN included GSRC n300 floorplanned by B*-tree packing, with the strongest connections between blocks and IO pins
Legality (ev.legality()): the same design legalized in 2.4 s. Rows, sites, overlaps, power-rail parity and the PDN all check out: 0 cells left on the PDN. Floorplan legality and connections (d.floorplan_legal(), nets): GSRC n300, 300 hard blocks and 569 IO pins, no die given. Attar sizes one for 85% block area and packs the blocks (B*-tree) in 43 s: legal, HPWL 565k. The lines are the strongest connections between blocks and IO pins.

A design is a state

>>> d = attar.load('after_fp/orfs_asap7/aes'); d.status()
aes_cipher_top  (orfs/asap7, fidelity F1)
  placement target density 0.71 (orfs 3_3 global_place (GPL-0023))
Problem facts
  ✅ netlist           def             12268 nets, 42885 pins
  ✅ cell_geometry     lef             12420 cells (12009 movable, 0 macros), 56 masters
  ✅ floorplan.die     def             1 die(s), 48.71 x 48.71 um
  ✅ floorplan.io      def             388 IO pins placed
  ✅ rows              def             164 rows, height 0.27 um
  ✅ pdn               def             1815 wire and 4785 via shapes on M1, M2, M3
  ✅ def_frame         def             PDN, pins, fixed cells of the source DEF, kept verbatim (849 kB)
  ...
Solution state
  ❌ placement         12009 movable cells unplaced  (snapshots: reference)
  ...
  -> only a placement is missing: place the design (or restore a snapshot), then d.export("out.def")

Every reader states which facts it provides, and every engine and metric states which facts it needs:

  • a Bookshelf design has no cell library, so it does not export to DEF;
  • a design with no special nets on the pin layers has no pdn rule to keep;
  • a block floorplan has no rows;
  • a soft-block benchmark has no cell geometry.

Each can do exactly what its facts allow. Engines add facts with provenance (placement: naive), so it is always clear which part of a design came from where. See docs/concepts.md.

Acknowledgements

Attar's global placement follows ePlace, DREAMPlace and Xplace, and its routability option DREAMPlace's cell inflation; its rail and PDN checks follow OpenROAD's detailed placer, and its PDN repair the row DP of pa_pdn. Attar is validated against OpenROAD-flow-scripts on the ASAP7 and Nangate45 platforms. Benchmarks are from the ISPD, ICCAD and GSRC contests, MCNC and ORFS.

License

MIT License

Copyright © 2026 RayChang987  ·  free to use, modify and distribute; see LICENSE

Attar

Metadata

Release files for attar 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attar 1.0.2
File Size Uploaded Provenance Actions
attar-1.0.2.tar.gz 300.9 kB Without provenance Details for attar-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for attar 1.0.2
File Interpreter ABI Platform Actions
attar-1.0.2-py3-none-any.whl Python 3 none any Details for attar-1.0.2-py3-none-any.whl

Total release size: 593.3 kB

Release files / attar-1.0.2.tar.gz

Download URL attar-1.0.2.tar.gz
Size 300.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d57337b5eebd8d2d46cd0bd1b55520e5adf62306b4d0ac9c55d2e771eb7fdc0d
BLAKE2b-256 checksum
How to use checksums
4e8992d30212b26e9be364ac8dbb67e194516d415fbe43f02f267162ab99103f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / attar-1.0.2-py3-none-any.whl

Download URL attar-1.0.2-py3-none-any.whl
Size 292.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a13b6dde3a8454f9c5293a2f1f0b9de79596e2a72c5a0e58a743565707171c5f
BLAKE2b-256 checksum
How to use checksums
e37f8f17b5c49c3e808a959dc76f32646b8c091b7c120f9cde047d1c8f899a53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Security for attar 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page