CoolFace
Apppublic

diva29/chip-floorplanner

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

Chip Floorplanner โ€” Macro Placement Optimization Environment

A professional-grade Reinforcement Learning environment for VLSI Chip Floorplanning (Macro Placement), designed strictly for the OpenEnv evaluation framework.

๐Ÿ—๏ธ Motivation: The 'Spatial Intelligence' Frontier

Autonomous chip floorplanning remains a critical bottleneck in Electronic Design Automation (EDA). The task is fundamentally an NP-hard optimization challenge, isomorphic to a combined 2D bin-packing and quadratic assignment problem. Traditional analytic solvers (e.g., simulated annealing, forced-directed placement) suffer from immense computational overhead on high-density node graphs.

This environment provides a high-fidelity simulation of this engineering workflow. It forces autonomous agents to resolve spatial reasoning, connectivity-driven placement (routing congestion), and hard legalization constraints. As such, this serves as a premier benchmark for evaluating the zero-shot spatial intelligence and constrained-optimization capabilities of advanced Large Language Models (LLMs).

๐Ÿ•น๏ธ System Architecture & State Spaces

Macro Placement Action Space

Agents perform sequential Floorplan Legalization by providing coordinates for physical logic macros (IP cores / memory blocks):

  • โ€”x, y (int): Absolute Cartesian grid coordinates for the lower-left scalar origin.
  • โ€”rotate (bool): 90ยฐ orientation toggle for anisotropic rectangular macros.

High-Dimensional Observation Space

  • โ€”Netlist Graph Tensor: Full topological connectivity mapping determining net weights.
  • โ€”Dynamic Occupancy Matrix: Real-time boolean feedback grid dictating available silicon real estate and legalization status.
  • โ€”Topological Legalization Hints: Connectivity-aware placement gradients provided to the agent to minimize wire routing congestion.

๐Ÿ“ Challenging Task Tiers

TierIP MacrosRoutable NetsEvaluation ObjectiveMax Canvas (Grid)
Easy42Baseline spatial reasoning logic and topology alignment.20x20
Medium75Multi-objective optimization Pareto fronts (Area vs. HPWL).30x30
Hard1210Global floorplan legalization on high-density grids.40x40

๐Ÿ† Programmatic Grader & Reward Formulation

The environment grades agents based on a rigorous reward formulation that penalizes manufacturing impossibilities:

R_total = (ฮฑ * R_overlap) + V(ฯ‡) * [ (ฮฒ * R_hpwl) + (ฮณ * R_area) ]

The "Brutal" Viability Multiplier `V(ฯ‡)`: The grader enforces a strict Zero-Tolerance Overlap Policy. If the spatial intersection ฯ‡ between any two placed macros m1 โˆฉ m2 > 0, the multiplier drops to 0.10. This 90% viability penalty reflects the binary nature of semiconductor manufacturing failures (overlapping transistors equals an invalid chip).

  • โ€”Overlap/Legalization (ฮฑ=0.50): Enforces hard physical separation.
  • โ€”Routing HPWL (ฮฒ=0.25): Evaluates the Half-Perimeter Wirelength (bounding box approximation of Rectilinear Steiner Minimum Trees) to minimize signal propagation delay.
  • โ€”Silicon Footprint (ฮณ=0.25): Evaluates bounding-box coordinates to maximize global die-density.

๐Ÿš€ Deployment & Baselining

Playing Manually vs Deploying

An interactive web-based UI provides a visual rendering canvas so engineers can mechanically test multi-net constraints and penalty logic.

bash
python chip_floorplanner/server/app.py

Open your browser to http://localhost:7860.

Evaluation TargetTask TierNormalized Baseline Score (out of 1.0)
Qwen/Qwen2.5-72B-InstructEasy0.741
Qwen/Qwen2.5-72B-InstructMedium0.771
Qwen/Qwen2.5-7B-Instruct (Lite)Easy0.829
Qwen/Qwen2.5-7B-Instruct (Lite)Medium0.316 (Spatial Reasoning Collapse)
meta-llama/Llama-3.1-70B-InstructEasy0.795
Deterministic Proximal HeuristicsHard0.728
[!NOTE] Empirical benchmarking reveals distinct capability stratifications. While 7B-parameter models successfully exploit sparse constraints on Easy grids ($R=0.829$), their spatial intelligence collapses ($R=0.316$) upon introducing advanced topological congestion graphs in the Medium tier. Larger models like Qwen 72B handled the step-up with ease ($R=0.771$). To verify system viability unconstrained by current API context limits, the Hard tier was validated strictly via local deterministic proximal heuristics ($R=0.728$).