TL;DR
ReLay is a bidirectional framework that decompiles existing analog layouts into structured, process-portable Python code. By learning reusable design patterns from a massive new benchmark of 1,050 layouts, it enables seamless process migration and significantly lowers the barrier for LLMs to generate high-quality analog designs.
What Problem Does This Paper Address?
Analog layout remains the "last mile" of automation in integrated circuit design. While digital design flows are highly automated from RTL to GDSII, analog layout is still largely a manual, handcrafted process. Designers must juggle complex constraints like device matching, symmetry, and parasitic effects, often resulting in design knowledge being "trapped" in static geometry.
Existing "generator" frameworks allow designers to write code that produces layouts, but these are limited by handcrafted libraries. If a designer creates a novel structure by hand, it can't easily be reused or ported to a new process. Furthermore, while Large Language Models (LLMs) are becoming adept at writing code, they struggle with the raw geometric coordinates required for direct layout generation. ReLay aims to bridge this gap by treating layout as a decompilation problem.
Methods
ReLay introduces a bidirectional workflow that moves between geometry and code. The system consists of two primary components:
- Layout Decompiler: This tool translates a finished layout (GDS) into a "flat" program. It uses Device Inversion—combining LVS extraction with symbolic execution—to recover the original parameters (like width, length, and placement) that produced a specific shape. It then uses an exact-cover algorithm (Algorithm X) to determine the best set of generator calls to explain every polygon in the layout.
- Program Reconstructor: This component transforms the flat, literal code into a structured, human-readable generator. It employs several advanced techniques:
- Repetition Folding: Uses e-graphs and equality saturation to identify arrays, loops, and mirrored structures.
- Library Learning: Uses the Stitch algorithm to find recurring patterns across different designs and promote them to reusable library functions.
- Subcircuit Recognition: Automatically identifies common circuit blocks like current mirrors and differential pairs from the netlist.
Datasets
The authors introduce the first large-scale layout–code benchmark, consisting of 1,050 hand-drawn layouts across 27 circuit families.
- PDKs: The benchmark spans three open-source Process Design Kits: SkyWater SKY130, GlobalFoundries GF180MCU, and IHP SG13G2.
- Scope: Designs range from simple primitive cells to full test chips with pad rings.
- Content: Each entry includes the layout, extracted netlist, and both the recovered flat and structured programs.
Key Insights and Ideas
- Layout as Decompilation: The core "aha moment" is treating a finished layout not just as a set of polygons, but as the output of a program that can be reversed. By recovering the intent (e.g., "this is a 4-finger NMOS") rather than just the coordinates, the design becomes editable and portable.
- Evolving Libraries: Instead of a static, handcrafted library, ReLay’s vocabulary grows. As it processes more layouts, it "learns" new abstractions, making the library more expressive over time.
- PDK Agnosticism: Because the recovered code describes the design at a functional level (e.g., "place a guard ring around this row"), the same program can generate DRC-clean layouts in entirely different manufacturing processes by simply changing one line of configuration.
- LLM Synergy: LLMs are far more fluent in code than in geometry. ReLay provides a high-level API that allows LLM agents to act as "architects" rather than "draftspeople," focusing on composing blocks rather than calculating micron-level offsets.
Key Results
- Recovery Accuracy: In a held-out test of 133 layouts, ReLay exactly recovered 107 of them. The failures were typically due to custom constructions not yet in the library, providing a roadmap for future library growth.
- Code Compression: The Program Reconstructor successfully shrunk median programs to just 26% of their flat size, significantly improving readability.
- Process Portability: ReLay achieved high success rates in "retargeting" designs. For example, 98% of designs migrated from GF180 to IHP were verified as DRC and LVS clean.
- LLM Efficiency: Using ReLay's learned library, LLM agents (like GPT-4 or Claude) completed layout tasks with 64–77% lower API costs and higher success rates compared to writing raw geometry.
Limitations and Future Work
- Data Scarcity: ReLay currently relies on the relatively small pool of open-source analog layouts. Its power will grow as more designs are published.
- Source Quality: The tool recovers what is there. If a source layout has poor electrical properties or "hacks," the recovered code will reflect those choices.
- Complex Custom Geometry: While ReLay handles standard primitives and routes well, extremely unusual, non-templated hand-drawn shapes (like custom-tapered inductors) still pose a challenge for exact programmatic recovery.
- Future Directions: The authors aim to extend the benchmark as the open-source ecosystem grows and further refine the library learning to capture even more complex design expertise.
Summary updated